org.hibernate.service.internal
Class BootstrapServiceRegistryImpl

java.lang.Object
  extended by org.hibernate.service.internal.BootstrapServiceRegistryImpl
All Implemented Interfaces:
BootstrapServiceRegistry, ServiceRegistry, ServiceBinding.ServiceLifecycleOwner, ServiceRegistryImplementor

public class BootstrapServiceRegistryImpl
extends Object
implements ServiceRegistryImplementor, BootstrapServiceRegistry, ServiceBinding.ServiceLifecycleOwner

ServiceRegistry implementation containing specialized "bootstrap" services, specifically:


Constructor Summary
BootstrapServiceRegistryImpl()
           
BootstrapServiceRegistryImpl(ClassLoaderService classLoaderService, IntegratorService integratorService)
           
BootstrapServiceRegistryImpl(ClassLoaderService classLoaderService, LinkedHashSet<Integrator> providedIntegrators)
           
 
Method Summary
<R extends Service>
void
configureService(ServiceBinding<R> binding)
           
 void destroy()
          Release resources
 ServiceRegistry getParentServiceRegistry()
          Retrieve this registry's parent registry.
<R extends Service>
R
getService(Class<R> serviceRole)
          Retrieve a service by role.
<R extends Service>
R
initiateService(ServiceInitiator<R> serviceInitiator)
           
<R extends Service>
void
injectDependencies(ServiceBinding<R> binding)
           
<R extends Service>
ServiceBinding<R>
locateServiceBinding(Class<R> serviceRole)
          Locate the binding for the given role.
<R extends Service>
void
startService(ServiceBinding<R> binding)
           
<R extends Service>
void
stopService(ServiceBinding<R> binding)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BootstrapServiceRegistryImpl

public BootstrapServiceRegistryImpl()

BootstrapServiceRegistryImpl

public BootstrapServiceRegistryImpl(ClassLoaderService classLoaderService,
                                    IntegratorService integratorService)

BootstrapServiceRegistryImpl

public BootstrapServiceRegistryImpl(ClassLoaderService classLoaderService,
                                    LinkedHashSet<Integrator> providedIntegrators)
Method Detail

getService

public <R extends Service> R getService(Class<R> serviceRole)
Description copied from interface: ServiceRegistry
Retrieve a service by role. If service is not found, but a BasicServiceInitiator is registered for this service role, the service will be initialized and returned.

NOTE: We cannot return <R extends Service<T>> here because the service might come from the parent...

Specified by:
getService in interface ServiceRegistry
Type Parameters:
R - The service role type
Parameters:
serviceRole - The service role
Returns:
The requested service.

locateServiceBinding

public <R extends Service> ServiceBinding<R> locateServiceBinding(Class<R> serviceRole)
Description copied from interface: ServiceRegistryImplementor
Locate the binding for the given role. Should, generally speaking, look into parent registry if one.

Specified by:
locateServiceBinding in interface ServiceRegistryImplementor
Type Parameters:
R - generic return type.
Parameters:
serviceRole - The service role for which to locate a binding.
Returns:
The located binding; may be null

destroy

public void destroy()
Description copied from interface: ServiceRegistryImplementor
Release resources

Specified by:
destroy in interface ServiceRegistryImplementor

getParentServiceRegistry

public ServiceRegistry getParentServiceRegistry()
Description copied from interface: ServiceRegistry
Retrieve this registry's parent registry.

Specified by:
getParentServiceRegistry in interface ServiceRegistry
Returns:
The parent registry. May be null.

initiateService

public <R extends Service> R initiateService(ServiceInitiator<R> serviceInitiator)
Specified by:
initiateService in interface ServiceBinding.ServiceLifecycleOwner

configureService

public <R extends Service> void configureService(ServiceBinding<R> binding)
Specified by:
configureService in interface ServiceBinding.ServiceLifecycleOwner

injectDependencies

public <R extends Service> void injectDependencies(ServiceBinding<R> binding)
Specified by:
injectDependencies in interface ServiceBinding.ServiceLifecycleOwner

startService

public <R extends Service> void startService(ServiceBinding<R> binding)
Specified by:
startService in interface ServiceBinding.ServiceLifecycleOwner

stopService

public <R extends Service> void stopService(ServiceBinding<R> binding)
Specified by:
stopService in interface ServiceBinding.ServiceLifecycleOwner


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.