Class: ServiceReference

vertx-service-discovery-js/service_reference~ ServiceReference

Methods

cached() → {Object}

Gets the service object if already retrieved. It won't try to acquire the service object if not retrieved yet.
Source:
Returns:
the object, null if not yet retrieved
Type
Object

cachedAs(x) → {Object}

Gets the service object if already retrieved. It won't try to acquire the service object if not retrieved yet. Unlike ServiceReference#cached, this method return the warpped object to the desired (given) type.
Parameters:
Name Type Description
x todo the type of object
Source:
Returns:
the object, null if not yet retrieved
Type
Object

get() → {Object}

Gets 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. This method returns the Java version and primary facet of the object, use ServiceReference#getAs to retrieve the polyglot instance of the object or another facet..
Source:
Returns:
the object to access the service
Type
Object

getAs(x) → {Object}

Gets 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. This method wraps the service object into the desired type.
Parameters:
Name Type Description
x todo the type of object
Source:
Returns:
the object to access the service wrapped to the given type
Type
Object

isHolding(object) → {boolean}

Checks whether or not the service reference has the given service object.
Parameters:
Name Type Description
object Object the service object, must not be null
Source:
Returns:
true if the service reference service object is equal to the given object, false otherwise.
Type
boolean

record() → {Object}

Source:
Returns:
the service record.
Type
Object

release()

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.
Source: