vertx-lang-scala-docs_2.12 3.4.0 API < Back
 

# Packages

-  package root
  Definition Classes
    root
-  package io
  Definition Classes
    root
-  package vertx
  Definition Classes
    io
-  package scala
  Definition Classes
    vertx
-  package servicediscovery
  Definition Classes
    scala
-  package spi
  Definition Classes
    servicediscovery
-  package types
  Definition Classes
    servicediscovery
- Record
- ServiceDiscovery
- ServiceDiscoveryOptions
- ServiceReference

c

io.vertx.scala.servicediscovery

# ServiceReference 

###
Companion object ServiceReference

#### class ServiceReference extends AnyRef

Once a consumer has chosen a service, it builds a io.vertx.scala.servicediscovery.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 io.vertx.scala.servicediscovery.ServiceReference#get method * release the reference - so the binding between the consumer and the provider is removed

Linear Supertypes
AnyRef, Any
 
Ordering

1. Alphabetic
2. By Inheritance

Inherited

1. ServiceReference
2. AnyRef
3. Any

1. Hide All
2. Show All

Visibility

1. Public
2. All

### Instance Constructors

1.  new ServiceReference(_asJava: AnyRef)

### Value Members

1.  final def !=(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
2.  final def ##(): Int
   Definition Classes
     AnyRef → Any
3.  final def ==(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
4.  final def asInstanceOf[T0]: T0
   Definition Classes
     Any
5.  def asJava: AnyRef
6.  def cached[T]()(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): T

   Gets the service object if already retrieved.

   Gets the service object if already retrieved. It won't try to acquire the service object if not retrieved yet.

   returns

     the object, `null` if not yet retrieved

7.  def cachedAs[X](x: Class[X])(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[X]): X

   Gets the service object if already retrieved.

   Gets the service object if already retrieved. It won't try to acquire the service object if not retrieved yet. Unlike io.vertx.scala.servicediscovery.ServiceReference#cached, this method return the warpped object to the desired (given) type.

   x

     the type of object

   returns

     the object, `null` if not yet retrieved

8.  def clone(): AnyRef
   Attributes
     protected[java.lang]
   Definition Classes
     AnyRef
   Annotations
     @throws( ... )
9.  final def eq(arg0: AnyRef): Boolean
   Definition Classes
     AnyRef
10.  def equals(arg0: Any): Boolean
    Definition Classes
      AnyRef → Any
11.  def finalize(): Unit
    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws( classOf[java.lang.Throwable] )
12.  def get[T]()(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[T]): T

    Gets the object to access the service.

    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 io.vertx.scala.servicediscovery.ServiceReference#getAs to retrieve the polyglot instance of the object or another facet..

    returns

      the object to access the service

13.  def getAs[X](x: Class[X])(implicit arg0: scala.reflect.api.JavaUniverse.TypeTag[X]): X

    Gets the object to access the service.

    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.

    x

      the type of object

    returns

      the object to access the service wrapped to the given type

14.  final def getClass(): Class[_]
    Definition Classes
      AnyRef → Any
15.  def hashCode(): Int
    Definition Classes
      AnyRef → Any
16.  def isHolding(object: AnyRef): Boolean

    Checks whether or not the service reference has the given service object.

    Checks whether or not the service reference has the given service object.

    object

      the service object, must not be `null`

    returns

      `true` if the service reference service object is equal to the given object, `false` otherwise.

17.  final def isInstanceOf[T0]: Boolean
    Definition Classes
      Any
18.  final def ne(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
19.  final def notify(): Unit
    Definition Classes
      AnyRef
20.  final def notifyAll(): Unit
    Definition Classes
      AnyRef
21.  def record(): Record

    returns

      the service record.see Record

22.  def release(): Unit

    Releases the reference.

    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.

23.  final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
      AnyRef
24.  def toString(): String
    Definition Classes
      AnyRef → Any
25.  final def wait(): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
26.  final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
27.  final def wait(arg0: Long): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )

### Inherited from AnyRef

### Inherited from Any

### Ungrouped