Class ServiceReference

java.lang.Object
io.vertx.mutiny.servicediscovery.ServiceReference
All Implemented Interfaces:
MutinyDelegate

public class ServiceReference extends Object implements 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

NOTE: This class has been automatically generated from the original non Mutiny-ified interface using Vert.x codegen.

  • Field Details

  • Constructor Details

    • ServiceReference

      public ServiceReference(io.vertx.servicediscovery.ServiceReference delegate)
    • ServiceReference

      public ServiceReference(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.servicediscovery.ServiceReference getDelegate()
      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate used by this Mutiny object of generated type
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • record

      public io.vertx.servicediscovery.Record record()
      Returns:
      the service record.
    • get

      public <T> T get()
      Returns:
      the object to access the service
    • getAs

      public <X> X getAs(Class<X> x)
      Parameters:
      x - the type of object
      Returns:
      the object to access the service wrapped to the given type
    • cachedAs

      public <X> X cachedAs(Class<X> x)
      Parameters:
      x - the type of object
      Returns:
      the object, null if not yet retrieved
    • cached

      public <T> T cached()
      Returns:
      the object, null if not yet retrieved
    • release

      public void release()
    • isHolding

      public boolean isHolding(Object object)
      Parameters:
      object - the service object, must not be null
      Returns:
      true if the service reference service object is equal to the given object, false otherwise.
    • newInstance

      public static ServiceReference newInstance(io.vertx.servicediscovery.ServiceReference arg)