类 AbstractServiceRegistryImpl
- java.lang.Object
-
- org.hibernate.service.internal.AbstractServiceRegistryImpl
-
- 所有已实现的接口:
AutoCloseable,ServiceRegistry,ServiceBinding.ServiceLifecycleOwner,ServiceRegistryImplementor
public abstract class AbstractServiceRegistryImpl extends Object implements ServiceRegistryImplementor, ServiceBinding.ServiceLifecycleOwner
Basic implementation of the ServiceRegistry and ServiceRegistryImplementor contracts- 作者:
- Steve Ebersole, Sanne Grinovero
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringALLOW_CRAWLING
-
构造器概要
构造器 限定符 构造器 说明 protectedAbstractServiceRegistryImpl()protectedAbstractServiceRegistryImpl(boolean autoCloseRegistry)AbstractServiceRegistryImpl(BootstrapServiceRegistry bootstrapServiceRegistry)AbstractServiceRegistryImpl(BootstrapServiceRegistry bootstrapServiceRegistry, boolean autoCloseRegistry)protectedAbstractServiceRegistryImpl(ServiceRegistryImplementor parent)protectedAbstractServiceRegistryImpl(ServiceRegistryImplementor parent, boolean autoCloseRegistry)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected <R extends Service>
RcreateService(ServiceBinding<R> serviceBinding)protected <R extends Service>
voidcreateServiceBinding(ProvidedService<R> providedService)protected <R extends Service>
voidcreateServiceBinding(ServiceInitiator<R> initiator)voiddeRegisterChild(ServiceRegistryImplementor child)When a registry is created with a parent, the parent is notified of the child via this callback.voiddestroy()Release resourcesServiceRegistrygetParentServiceRegistry()Retrieve this registry's parent registry.<R extends Service>
RgetService(Class<R> serviceRole)Retrieve a service by role.<R extends Service>
voidinjectDependencies(ServiceBinding<R> serviceBinding)booleanisActive()<R extends Service>
ServiceBinding<R>locateServiceBinding(Class<R> serviceRole)Locate the binding for the given role.protected <R extends Service>
ServiceBinding<R>locateServiceBinding(Class<R> serviceRole, boolean checkParent)voidreactivate()voidregisterChild(ServiceRegistryImplementor child)When a registry is created with a parent, the parent is notified of the child via this callback.protected <R extends Service>
voidregisterService(ServiceBinding<R> serviceBinding, R service)voidresetParent(BootstrapServiceRegistry newParent)Very advanced and tricky to handle: not designed for this.<R extends Service>
voidstartService(ServiceBinding<R> serviceBinding)<R extends Service>
voidstopService(ServiceBinding<R> binding)protected voidvisitServiceBindings(Consumer<ServiceBinding> action)-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 org.hibernate.service.spi.ServiceBinding.ServiceLifecycleOwner
configureService, initiateService
-
从接口继承的方法 org.hibernate.service.ServiceRegistry
requireService
-
从接口继承的方法 org.hibernate.service.spi.ServiceRegistryImplementor
close
-
-
-
-
构造器详细资料
-
AbstractServiceRegistryImpl
protected AbstractServiceRegistryImpl()
-
AbstractServiceRegistryImpl
protected AbstractServiceRegistryImpl(boolean autoCloseRegistry)
-
AbstractServiceRegistryImpl
protected AbstractServiceRegistryImpl(ServiceRegistryImplementor parent)
-
AbstractServiceRegistryImpl
protected AbstractServiceRegistryImpl(ServiceRegistryImplementor parent, boolean autoCloseRegistry)
-
AbstractServiceRegistryImpl
public AbstractServiceRegistryImpl(BootstrapServiceRegistry bootstrapServiceRegistry)
-
AbstractServiceRegistryImpl
public AbstractServiceRegistryImpl(BootstrapServiceRegistry bootstrapServiceRegistry, boolean autoCloseRegistry)
-
-
方法详细资料
-
createServiceBinding
protected <R extends Service> void createServiceBinding(ServiceInitiator<R> initiator)
-
createServiceBinding
protected <R extends Service> void createServiceBinding(ProvidedService<R> providedService)
-
visitServiceBindings
protected void visitServiceBindings(Consumer<ServiceBinding> action)
-
getParentServiceRegistry
public ServiceRegistry getParentServiceRegistry()
从接口复制的说明:ServiceRegistryRetrieve this registry's parent registry.- 指定者:
getParentServiceRegistry在接口中ServiceRegistry- 返回:
- The parent registry. May be null.
-
locateServiceBinding
public <R extends Service> ServiceBinding<R> locateServiceBinding(Class<R> serviceRole)
从接口复制的说明:ServiceRegistryImplementorLocate the binding for the given role. Should, generally speaking, look into parent registry if one.- 指定者:
locateServiceBinding在接口中ServiceRegistryImplementor- 类型参数:
R- generic return type.- 参数:
serviceRole- The service role for which to locate a binding.- 返回:
- The located binding; may be
null
-
locateServiceBinding
protected <R extends Service> ServiceBinding<R> locateServiceBinding(Class<R> serviceRole, boolean checkParent)
-
getService
public <R extends Service> R getService(Class<R> serviceRole)
从接口复制的说明:ServiceRegistryRetrieve a service by role. If service is not found, but aServiceInitiatoris 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...- 指定者:
getService在接口中ServiceRegistry- 类型参数:
R- The service role type- 参数:
serviceRole- The service role- 返回:
- The requested service or null if the service was not found.
-
registerService
protected <R extends Service> void registerService(ServiceBinding<R> serviceBinding, R service)
-
createService
protected <R extends Service> R createService(ServiceBinding<R> serviceBinding)
-
injectDependencies
public <R extends Service> void injectDependencies(ServiceBinding<R> serviceBinding)
-
startService
public <R extends Service> void startService(ServiceBinding<R> serviceBinding)
-
isActive
public boolean isActive()
-
destroy
public void destroy()
从接口复制的说明:ServiceRegistryImplementorRelease resources- 指定者:
destroy在接口中ServiceRegistryImplementor
-
stopService
public <R extends Service> void stopService(ServiceBinding<R> binding)
-
registerChild
public void registerChild(ServiceRegistryImplementor child)
从接口复制的说明:ServiceRegistryImplementorWhen a registry is created with a parent, the parent is notified of the child via this callback.- 指定者:
registerChild在接口中ServiceRegistryImplementor
-
deRegisterChild
public void deRegisterChild(ServiceRegistryImplementor child)
从接口复制的说明:ServiceRegistryImplementorWhen a registry is created with a parent, the parent is notified of the child via this callback.- 指定者:
deRegisterChild在接口中ServiceRegistryImplementor
-
resetParent
public void resetParent(BootstrapServiceRegistry newParent)
Very advanced and tricky to handle: not designed for this. Intended for experiments only!
-
reactivate
public void reactivate()
-
-