public abstract class AbstractServiceRegistryImpl extends Object implements ServiceRegistryImplementor, ServiceBinding.ServiceLifecycleOwner
Modifier and Type | Field and Description |
---|---|
static String |
ALLOW_CRAWLING |
Modifier | Constructor and Description |
---|---|
protected |
AbstractServiceRegistryImpl() |
protected |
AbstractServiceRegistryImpl(boolean autoCloseRegistry) |
|
AbstractServiceRegistryImpl(BootstrapServiceRegistry bootstrapServiceRegistry) |
|
AbstractServiceRegistryImpl(BootstrapServiceRegistry bootstrapServiceRegistry,
boolean autoCloseRegistry) |
protected |
AbstractServiceRegistryImpl(ServiceRegistryImplementor parent) |
protected |
AbstractServiceRegistryImpl(ServiceRegistryImplementor parent,
boolean autoCloseRegistry) |
Modifier and Type | Method and Description |
---|---|
protected <R extends Service> |
createService(ServiceBinding<R> serviceBinding) |
protected <R extends Service> |
createServiceBinding(ProvidedService<R> providedService) |
protected <R extends Service> |
createServiceBinding(ServiceInitiator<R> initiator) |
void |
deRegisterChild(ServiceRegistryImplementor child)
When a registry is created with a parent, the parent is notified of the child
via this callback.
|
void |
destroy()
Release resources
|
ServiceRegistry |
getParentServiceRegistry()
Retrieve this registry's parent registry.
|
<R extends Service> |
getService(Class<R> serviceRole)
Retrieve a service by role.
|
<R extends Service> |
injectDependencies(ServiceBinding<R> serviceBinding) |
boolean |
isActive() |
<R extends Service> |
locateServiceBinding(Class<R> serviceRole)
Locate the binding for the given role.
|
protected <R extends Service> |
locateServiceBinding(Class<R> serviceRole,
boolean checkParent) |
void |
registerChild(ServiceRegistryImplementor child)
When a registry is created with a parent, the parent is notified of the child
via this callback.
|
protected <R extends Service> |
registerService(ServiceBinding<R> serviceBinding,
R service) |
<R extends Service> |
startService(ServiceBinding<R> serviceBinding) |
<R extends Service> |
stopService(ServiceBinding<R> binding) |
protected void |
visitServiceBindings(Consumer<ServiceBinding> action) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
requireService
configureService, initiateService
public static final String ALLOW_CRAWLING
protected AbstractServiceRegistryImpl()
protected AbstractServiceRegistryImpl(boolean autoCloseRegistry)
protected AbstractServiceRegistryImpl(ServiceRegistryImplementor parent)
protected AbstractServiceRegistryImpl(ServiceRegistryImplementor parent, boolean autoCloseRegistry)
public AbstractServiceRegistryImpl(BootstrapServiceRegistry bootstrapServiceRegistry)
public AbstractServiceRegistryImpl(BootstrapServiceRegistry bootstrapServiceRegistry, boolean autoCloseRegistry)
protected <R extends Service> void createServiceBinding(ServiceInitiator<R> initiator)
protected <R extends Service> void createServiceBinding(ProvidedService<R> providedService)
protected void visitServiceBindings(Consumer<ServiceBinding> action)
public ServiceRegistry getParentServiceRegistry()
ServiceRegistry
getParentServiceRegistry
in interface ServiceRegistry
public <R extends Service> ServiceBinding<R> locateServiceBinding(Class<R> serviceRole)
ServiceRegistryImplementor
locateServiceBinding
in interface ServiceRegistryImplementor
R
- generic return type.serviceRole
- The service role for which to locate a binding.null
protected <R extends Service> ServiceBinding<R> locateServiceBinding(Class<R> serviceRole, boolean checkParent)
public <R extends Service> R getService(Class<R> serviceRole)
ServiceRegistry
ServiceInitiator
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...getService
in interface ServiceRegistry
R
- The service role typeserviceRole
- The service roleprotected <R extends Service> void registerService(ServiceBinding<R> serviceBinding, R service)
protected <R extends Service> R createService(ServiceBinding<R> serviceBinding)
public <R extends Service> void injectDependencies(ServiceBinding<R> serviceBinding)
injectDependencies
in interface ServiceBinding.ServiceLifecycleOwner
public <R extends Service> void startService(ServiceBinding<R> serviceBinding)
startService
in interface ServiceBinding.ServiceLifecycleOwner
public boolean isActive()
public void destroy()
ServiceRegistryImplementor
destroy
in interface ServiceRegistryImplementor
public <R extends Service> void stopService(ServiceBinding<R> binding)
stopService
in interface ServiceBinding.ServiceLifecycleOwner
public void registerChild(ServiceRegistryImplementor child)
ServiceRegistryImplementor
registerChild
in interface ServiceRegistryImplementor
public void deRegisterChild(ServiceRegistryImplementor child)
ServiceRegistryImplementor
deRegisterChild
in interface ServiceRegistryImplementor
Copyright © 2021 JBoss by Red Hat. All rights reserved.