Package io.vertx.mutiny.servicediscovery
Class ServiceReference
java.lang.Object
io.vertx.mutiny.servicediscovery.ServiceReference
- All Implemented Interfaces:
MutinyDelegate
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 get() method
* release the reference - so the binding between the consumer and the provider is removed
original non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionServiceReference(io.vertx.servicediscovery.ServiceReference delegate) ServiceReference(Object delegate) -
Method Summary
Modifier and TypeMethodDescription<T> Tcached()<X> Xboolean<T> Tget()<X> Xio.vertx.servicediscovery.ServiceReferenceinthashCode()booleanstatic ServiceReferencenewInstance(io.vertx.servicediscovery.ServiceReference arg) io.vertx.servicediscovery.Recordrecord()voidrelease()toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
ServiceReference
public ServiceReference(io.vertx.servicediscovery.ServiceReference delegate) -
ServiceReference
-
-
Method Details
-
getDelegate
public io.vertx.servicediscovery.ServiceReference getDelegate()- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
record
public io.vertx.servicediscovery.Record record()- Returns:
- the service record.
-
get
public <T> T get()- Returns:
- the object to access the service
-
getAs
- Parameters:
x- the type of object- Returns:
- the object to access the service wrapped to the given type
-
cachedAs
- Parameters:
x- the type of object- Returns:
- the object,
nullif not yet retrieved
-
cached
public <T> T cached()- Returns:
- the object,
nullif not yet retrieved
-
release
public void release() -
isHolding
- Parameters:
object- the service object, must not benull- Returns:
trueif the service reference service object is equal to the given object,falseotherwise.
-
newInstance
-