
|
If you were logged in you would be able to see more operations.
|
|
|
|
For a service reference defined as an <osgi:reference> bean, there should be an easy way to find the properties that the service was published with etc..
Given eg.
<osgi:reference id="someService" interface="SomeService"/>
How can we find out the properties of the service currently bound as the target of someService? One suggestion is to have the service proxy implement a well-known interface that the someService bean instance could be cast to. We could opt for the proxy implementing org.osgi.framework.ServiceReference directly, but that interface is wide enough that clashes with operations defined in the business interface may occur. Introducing our own interface such as org.springframework.osgi.ServiceReferenceAware:
public interface ServiceReferenceAware {
ServiceReference getServiceReference() ;
}
should do the trick.
For a service published as an OSGi service, it should also be possible to get hold of the ServiceRegistration object for that service (if desired). The current specification doesn't define the type of the bean defined by an osgi:service element. One design option here would be to have that bean be of type ServiceRegistration.
|
|
Description
|
For a service reference defined as an <osgi:reference> bean, there should be an easy way to find the properties that the service was published with etc..
Given eg.
<osgi:reference id="someService" interface="SomeService"/>
How can we find out the properties of the service currently bound as the target of someService? One suggestion is to have the service proxy implement a well-known interface that the someService bean instance could be cast to. We could opt for the proxy implementing org.osgi.framework.ServiceReference directly, but that interface is wide enough that clashes with operations defined in the business interface may occur. Introducing our own interface such as org.springframework.osgi.ServiceReferenceAware:
public interface ServiceReferenceAware {
ServiceReference getServiceReference() ;
}
should do the trick.
For a service published as an OSGi service, it should also be possible to get hold of the ServiceRegistration object for that service (if desired). The current specification doesn't define the type of the bean defined by an osgi:service element. One design option here would be to have that bean be of type ServiceRegistration. |
Show » |
|