Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ServiceReference

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 {@link ServiceReference#get} method * release the reference - so the binding between the consumer and the provider is removed

Hierarchy

  • ServiceReference

Index

Methods

cached

  • cached<T>(): T
  • Gets the service object if already retrieved. It won't try to acquire the service object if not retrieved yet.

    Type parameters

    • T

    Returns T

cachedAs

  • cachedAs<X>(x: any): X
  • Gets the service object if already retrieved. It won't try to acquire the service object if not retrieved yet. Unlike {@link ServiceReference#cached}, this method return the warpped object to the desired (given) type.

    Type parameters

    • X

    Parameters

    • x: any

    Returns X

get

  • get<T>(): T
  • 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 {@link ServiceReference#getAs} to retrieve the polyglot instance of the object or another facet..

    Type parameters

    • T

    Returns T

getAs

  • getAs<X>(x: any): X
  • 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.

    Type parameters

    • X

    Parameters

    • x: any

    Returns X

isHolding

  • isHolding(object: any): boolean
  • Checks whether or not the service reference has the given service object.

    Parameters

    • object: any

    Returns boolean

record

  • Returns Record

release

  • release(): void
  • 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.

    Returns void

Generated using TypeDoc