public class ServiceReference extends Object
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 get()
method
* release the reference - so the binding between the consumer and the provider is removed
original
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<ServiceReference> |
__TYPE_ARG |
Constructor and Description |
---|
ServiceReference(Object delegate) |
ServiceReference(ServiceReference delegate) |
Modifier and Type | Method and Description |
---|---|
<T> T |
cached()
Gets the service object if already retrieved.
|
<X> X |
cachedAs(Class<X> x)
Gets the service object if already retrieved.
|
boolean |
equals(Object o) |
<T> T |
get()
Gets the object to access the service.
|
<X> X |
getAs(Class<X> x)
Gets the object to access the service.
|
ServiceReference |
getDelegate() |
int |
hashCode() |
boolean |
isHolding(Object object)
Checks whether or not the service reference has the given service object.
|
static ServiceReference |
newInstance(ServiceReference arg) |
Record |
record() |
void |
release()
Releases the reference.
|
String |
toString() |
public static final io.vertx.lang.rx.TypeArg<ServiceReference> __TYPE_ARG
public ServiceReference(ServiceReference delegate)
public ServiceReference(Object delegate)
public ServiceReference getDelegate()
public Record record()
public <T> T get()
getAs(java.lang.Class<X>)
to retrieve the polyglot instance of the object or another facet..public <X> X getAs(Class<X> x)
x
- the type of objectpublic <X> X cachedAs(Class<X> x)
cached()
, this method return the warpped object to the desired (given) type.x
- the type of objectnull
if not yet retrievedpublic <T> T cached()
null
if not yet retrievedpublic void release()
public boolean isHolding(Object object)
object
- the service object, must not be null
true
if the service reference service object is equal to the given object, false
otherwise.public static ServiceReference newInstance(ServiceReference arg)
Copyright © 2024 Eclipse. All rights reserved.