Once a consumer has chosen a service, it builds a ServiceReference managing the binding with the chosen service provider.
The reference lets the consumer: * access the service (via a proxy or a client) with the ServiceReference.get method * release the reference - so the binding between the consumer and the provider is removed
Constructor and description |
---|
ServiceReference
(java.lang.Object delegate) |
Type | Name and description |
---|---|
T |
cached() Gets the service object if already retrieved. |
T |
get() Gets the object to access the service. |
java.lang.Object |
getDelegate() |
java.util.Map<java.lang.String, java.lang.Object> |
record() @return the service record. |
void |
release() Releases the reference. |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Gets the service object if already retrieved. It won't try to acquire the service object if not retrieved yet.
null
if not yet retrievedGets the object to access the service. It can be a proxy, a client or whatever object. The type depends on the service type and the server itself.
Releases the reference. Once released, the consumer must not use the reference anymore. This method must be idempotent and defensive, as multiple call may happen.