public interface ServiceReferenceProxy
extends org.osgi.framework.ServiceReference
ServiceReference
extension used by Spring-DM service importers.
The interface aim is to decouple clients from the dynamics of the
imported services. Without such a proxy, a target service change (when
dealing with dynamic proxies), would force the corresponding service
reference to changes as well causing returned references to become stale. To
avoid this situation, the importer returns a proxy which is updated
automatically so the client always calls the updated, correct service
reference.
In most cases, users should not be aware of this interface. However, for
cases where the service reference has to be reused for going service lookups
and the OSGi platform demands the raw service reference class, this interface
allows access to the target, unwrapped service reference instance (which does
does not support service tracking and might become stale as explained above).Modifier and Type | Method and Description |
---|---|
org.osgi.framework.ServiceReference |
getTargetServiceReference()
Returns the target, native service reference used, at the moment of the
call, by the proxy.
|
Copyright © 2006–2019. All rights reserved.