接口 ServiceRegistry
-
- 所有超级接口:
AutoCloseable
- 所有已知子接口:
BootstrapServiceRegistry,ServiceRegistryImplementor,SessionFactoryServiceRegistry,StandardServiceRegistry
- 所有已知实现类:
AbstractServiceRegistryImpl,BootstrapServiceRegistryImpl,SessionFactoryServiceRegistryImpl,StandardServiceRegistryImpl
public interface ServiceRegistry extends AutoCloseable
A registry ofservices.- 作者:
- Steve Ebersole
-
-
方法概要
所有方法 实例方法 抽象方法 默认方法 修饰符和类型 方法 说明 voidclose()ServiceRegistrygetParentServiceRegistry()Retrieve this registry's parent registry.<R extends Service>
RgetService(Class<R> serviceRole)Retrieve a service by role.default <R extends Service>
RrequireService(Class<R> serviceRole)Retrieve a service by role.
-
-
-
方法详细资料
-
getParentServiceRegistry
ServiceRegistry getParentServiceRegistry()
Retrieve this registry's parent registry.- 返回:
- The parent registry. May be null.
-
getService
<R extends Service> R getService(Class<R> serviceRole)
Retrieve 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...- 类型参数:
R- The service role type- 参数:
serviceRole- The service role- 返回:
- The requested service or null if the service was not found.
- 抛出:
UnknownServiceException- Indicates the service was not known.
-
requireService
default <R extends Service> R requireService(Class<R> serviceRole)
Retrieve 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...- 类型参数:
R- The service role type- 参数:
serviceRole- The service role- 返回:
- The requested service .
- 抛出:
UnknownServiceException- Indicates the service was not known.NullServiceException- Indicates the service was null.
-
close
void close()
- 指定者:
close在接口中AutoCloseable
-
-