org.hibernate.search.engine.service.spi

## Class ServiceReference<S extends Service>

- java.lang.Object
- - org.hibernate.search.engine.service.spi.ServiceReference<S>

- All Implemented Interfaces:
    AutoCloseable

      public class ServiceReference<S extends Service>
      extends Object
      implements AutoCloseable

  A auto-closable reference to a `Service`.
  Author:
    Gunnar Morling

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServiceReference(ServiceManager serviceManager, Class<S> serviceType)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `S` | `get()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ServiceReference

          public ServiceReference(ServiceManager serviceManager,
                                  Class<S> serviceType)

  - ### Method Detail

    - #### get

          public S get()

    - #### close

          public void close()

      Specified by:
        `close` in interface `AutoCloseable`

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved