public class StandardServiceManager extends Object implements ServiceManager
ServiceManager
interface.Constructor and Description |
---|
StandardServiceManager(SearchConfiguration searchConfiguration,
BuildContext buildContext) |
StandardServiceManager(SearchConfiguration searchConfiguration,
BuildContext buildContext,
Map<Class<? extends Service>,String> defaultServices) |
Modifier and Type | Method and Description |
---|---|
ClassLoaderService |
getClassLoaderService()
Provides direct access to the
ClassLoaderService . |
void |
releaseAllServices()
Stops and releases all services.
|
<S extends Service> |
releaseService(Class<S> serviceRole)
Releases the service in the specified service role.
|
<S extends Service> |
requestReference(Class<S> serviceRole)
Gets a reference to the service with the requested role.
|
<S extends Service> |
requestService(Class<S> serviceRole)
Gets the service in the specified service role.
|
public StandardServiceManager(SearchConfiguration searchConfiguration, BuildContext buildContext)
public StandardServiceManager(SearchConfiguration searchConfiguration, BuildContext buildContext, Map<Class<? extends Service>,String> defaultServices)
public <S extends Service> S requestService(Class<S> serviceRole)
ServiceManager
requestService
in interface ServiceManager
S
- the type of the serviceserviceRole
- the service to retrieve. Cannot be null
.public <S extends Service> ServiceReference<S> requestReference(Class<S> serviceRole)
ServiceManager
requestReference
in interface ServiceManager
S
- the type of the serviceserviceRole
- the service to retrieve. Cannot be null
.public <S extends Service> void releaseService(Class<S> serviceRole)
ServiceManager
releaseService
in interface ServiceManager
S
- the type of the serviceserviceRole
- the service to be released. Cannot be null
.public void releaseAllServices()
ServiceManager
IllegalStateException
will be thrown in this case.releaseAllServices
in interface ServiceManager
public ClassLoaderService getClassLoaderService()
ServiceManager
ClassLoaderService
.
This service lookup is treated as a special case both for convenience and performance reasons.getClassLoaderService
in interface ServiceManager
ClassLoaderService
Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved