org.springframework.osgi.service.importer
Interface ServiceReferenceProxy

All Superinterfaces:
ServiceReference

public interface ServiceReferenceProxy
extends 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).

Author:
Costin Leau

Method Summary
 ServiceReference getTargetServiceReference()
          Returns the target, native service reference used, at the moment of the call, by the proxy.
 
Methods inherited from interface org.osgi.framework.ServiceReference
getBundle, getProperty, getPropertyKeys, getUsingBundles, isAssignableTo
 

Method Detail

getTargetServiceReference

ServiceReference getTargetServiceReference()
Returns the target, native service reference used, at the moment of the call, by the proxy.

Returns:
target service reference


Copyright © 2006-2009 Spring Framework. All Rights Reserved.