org.hibernate.search.engine.service.impl

## Class StandardServiceManager

- java.lang.Object
- - org.hibernate.search.engine.service.impl.StandardServiceManager

- All Implemented Interfaces:
    ServiceManager

      public class StandardServiceManager
      extends Object
      implements ServiceManager

  Default implementation of the `ServiceManager` interface.
  Author:
    Emmanuel Bernard, Sanne Grinovero, Hardy Ferentschik

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StandardServiceManager(SearchConfiguration searchConfiguration, BuildContext buildContext)`
    `StandardServiceManager(SearchConfiguration searchConfiguration, BuildContext buildContext, Map<Class<? extends Service>,String> defaultServices)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `BeanResolver` | `getBeanResolver()` Provides direct access to the `BeanResolver`.
    `ClassLoaderService` | `getClassLoaderService()` Provides direct access to the `ClassLoaderService`.
    `void` | `releaseAllServices()` Stops and releases all services.
    `<S extends Service> void` | `releaseService(Class<S> serviceRole)` Releases the service in the specified service role.
    `<S extends Service> ServiceReference<S>` | `requestReference(Class<S> serviceRole)` Gets a reference to the service with the requested role.
    `<S extends Service> S` | `requestService(Class<S> serviceRole)` Gets the service in the specified service role.

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

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

- - ### Constructor Detail

    - #### StandardServiceManager

          public StandardServiceManager(SearchConfiguration searchConfiguration,
                                        BuildContext buildContext)

    - #### StandardServiceManager

          public StandardServiceManager(SearchConfiguration searchConfiguration,
                                        BuildContext buildContext,
                                        Map<Class<? extends Service>,String> defaultServices)

  - ### Method Detail

    - #### requestService

          public <S extends Service> S requestService(Class<S> serviceRole)

      Description copied from interface: `ServiceManager`
      Gets the service in the specified service role.
      Specified by:
        `requestService` in interface `ServiceManager`
      Type Parameters:
        `S` - the type of the service
      Parameters:
        `serviceRole` - the service to retrieve. Cannot be `null`.
      Returns:
        the single service fulfilling the specified role.

    - #### requestReference

          public <S extends Service> ServiceReference<S> requestReference(Class<S> serviceRole)

      Description copied from interface: `ServiceManager`
      Gets a reference to the service with the requested role.
      Specified by:
        `requestReference` in interface `ServiceManager`
      Type Parameters:
        `S` - the type of the service
      Parameters:
        `serviceRole` - the service to retrieve. Cannot be `null`.
      Returns:
        the single service fulfilling the specified role.

    - #### releaseService

          public <S extends Service> void releaseService(Class<S> serviceRole)

      Description copied from interface: `ServiceManager`
      Releases the service in the specified service role.
      Specified by:
        `releaseService` in interface `ServiceManager`
      Type Parameters:
        `S` - the type of the service
      Parameters:
        `serviceRole` - the service to be released. Cannot be `null`.

    - #### releaseAllServices

          public void releaseAllServices()

      Description copied from interface: `ServiceManager`
      Stops and releases all services. After this method is called no further services can be requested. An `IllegalStateException` will be thrown in this case.
      Specified by:
        `releaseAllServices` in interface `ServiceManager`

    - #### getClassLoaderService

          public ClassLoaderService getClassLoaderService()

      Description copied from interface: `ServiceManager`
      Provides direct access to the `ClassLoaderService`. This service lookup is treated as a special case both for convenience and performance reasons.
      Specified by:
        `getClassLoaderService` in interface `ServiceManager`
      Returns:
        the `ClassLoaderService`

    - #### getBeanResolver

          public BeanResolver getBeanResolver()

      Description copied from interface: `ServiceManager`
      Provides direct access to the `BeanResolver`. This service lookup is treated as a special case for convenience.
      Specified by:
        `getBeanResolver` in interface `ServiceManager`
      Returns:
        the `BeanResolver`

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