1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.springframework.osgi.service.importer;
18
19 import org.osgi.framework.ServiceReference;
20
21 /**
22 * {@link ServiceReference} extension used by Spring-DM service importers.
23 *
24 * <p/> The interface aim is to decouple clients from the dynamics of the
25 * imported services. Without such a proxy, a target service change (when
26 * dealing with dynamic proxies), would force the corresponding service
27 * reference to changes as well causing returned references to become stale. To
28 * avoid this situation, the importer returns a proxy which is updated
29 * automatically so the client always calls the updated, correct service
30 * reference.
31 *
32 * <p/> In most cases, users should not be aware of this interface. However, for
33 * cases where the service reference has to be reused for going service lookups
34 * and the OSGi platform demands the raw service reference class, this interface
35 * allows access to the target, unwrapped service reference instance (which does
36 * does not support service tracking and might become stale as explained above).
37 *
38 * @author Costin Leau
39 *
40 */
41 public interface ServiceReferenceProxy extends ServiceReference {
42
43 /**
44 * Returns the target, native service reference used, at the moment of the
45 * call, by the proxy.
46 *
47 * @return target service reference
48 */
49 ServiceReference getTargetServiceReference();
50 }