Class BootstrapRegistry
java.lang.Object
de.aristaflow.adept2.base.service.AbstractADEPT2Service
de.aristaflow.adept2.base.service.AbstractAuthenticatedService
de.aristaflow.adept2.base.registry.AbstractRegistry
de.aristaflow.adept2.base.registry.PluginRegistry
de.aristaflow.adept2.base.registry.InstanceToInstanceRegistry
de.aristaflow.adept2.base.registry.LocalServiceRegistry
de.aristaflow.adept2.base.registry.ServiceRegistry
de.aristaflow.adept2.core.registry.BootstrapRegistry
- All Implemented Interfaces:
GlobalInvocationResolver,GlobalRegistryServiceProvider,ConfMgrRegistry,ADEPT2Service,AuthenticatingService,LogService,NameResolution,ServiceThreadHandling
- Direct Known Subclasses:
TwoPhaseBootstrap
@ConfigurationDescription(properties={@Property(name="Components.ClientService",isRequired=true,description="A required service to provide clients convenient access to platform services."),,,,,,})
public class BootstrapRegistry
extends ServiceRegistry
This bootstrap registry is the central entity from which other registries and
services can be retrieved. Therefore this registry kind of represents the
whole platform. After bootstrapping, the convenience methods for the client
service and the registry (wrapper) can be used. While the client service
provides access to services for usage by clients, the registry wrapper
provides access the way server services have.
Bootstrapping consists of creating the bootstrap registry which implicitly validates its configuration and the actual bootstrapping.
Bootstrapping consists of creating the bootstrap registry which implicitly validates its configuration and the actual bootstrapping.
The configuration of a bootstrap registry requires the client service, a security manager identifying an org model manager which will be used for authentication in the platform as well as an arbitrary instance name for the registry. The name is used for logging and identifying the API user of the registry (client service and registry wrapper).
-
Nested Class Summary
Nested classes/interfaces inherited from class de.aristaflow.adept2.base.registry.ServiceRegistry
ServiceRegistry.ConfigurationValidatorNested classes/interfaces inherited from class de.aristaflow.adept2.base.registry.LocalServiceRegistry
LocalServiceRegistry.ServiceExportInformation, LocalServiceRegistry.ServiceNameResolution, LocalServiceRegistry.ServiceStarterNested classes/interfaces inherited from class de.aristaflow.adept2.base.registry.PluginRegistry
PluginRegistry.URLClassloaderPrivilegedActionNested classes/interfaces inherited from class de.aristaflow.adept2.base.registry.AbstractRegistry
AbstractRegistry.DefaultNameResolution, AbstractRegistry.InstanceInformation, AbstractRegistry.InstantiationModeNested classes/interfaces inherited from class de.aristaflow.adept2.base.service.AbstractADEPT2Service
AbstractADEPT2Service.ActiveSessions -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StringThe name of the bootstrap registry, which equals the configured name of the platform (client or server).Fields inherited from class de.aristaflow.adept2.base.registry.ServiceRegistry
clusterName, GLOB_STUB_CACHING_REM_IT_ALIVE_TIME_EXTENSION, GLOB_STUB_CACHING_REM_IT_INIT_ALIVE_TIME, GLOB_STUB_PROXY_ANNOT_CACHE_SIZE, GLOB_STUB_PROXY_LAZY_METHOD_VALID_TIME, globalRegCache, hierInstName, protocolPriority, reexportedServicesFields inherited from class de.aristaflow.adept2.base.registry.LocalServiceRegistry
autoStartServices, failedServices, gsmAvailable, nodeName, release, serviceStarterPool, serviceStartLocker, shuttingDown, startedServices, startingLock, startingRequiredServices, startingServiceFields inherited from class de.aristaflow.adept2.base.registry.InstanceToInstanceRegistry
usedInstancesFields inherited from class de.aristaflow.adept2.base.registry.PluginRegistry
declaredPluginTypes, defaultInstances, dynamicPlugins, pluginInstances, runtimePlugins, runtimePluginTypeCLs, singletonPluginsFields inherited from class de.aristaflow.adept2.base.registry.AbstractRegistry
componentInterfaces, configurationManager, declaredInstances, INIT_INSTANTIATED_OBJECT_METHOD, nameResolution, singletonInstancesFields inherited from class de.aristaflow.adept2.base.service.AbstractAuthenticatedService
CFG_EARLY_SERVICEAUTH_ORGPOSID, CFG_EARLY_SERVICEAUTH_ORGPOSNAME, CFG_EARLY_SERVICEAUTH_PASSWORD, CFG_EARLY_SERVICEAUTH_USERNAME, CFG_SERVICEAUTH_ORGPOSID, CFG_SERVICEAUTH_ORGPOSNAME, CFG_SERVICEAUTH_PASSWORD, CFG_SERVICEAUTH_USERNAMEFields inherited from class de.aristaflow.adept2.base.service.AbstractADEPT2Service
CONF_CSV_LOGGING, configuration, logger, registry, runtimeRequiredServices, startupRequiredServices -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBootstrapRegistry(UrlConfigurationManager confMgr, Class<? extends BootstrapRegistry> bootstrapClass) Creates a new bootstrap registry having the designated configuration manager. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidBootstraps this registry and therefore the platform.protected ClientServiceGets the client service providing convenient access to the services provided by this registry and needed by client components.protected RegistryGets the wrapper for access to this registry via theRegistry-interface.Prepares the security manager that is, the global security manager will be retrieved (and started) if necessary.Gets the cluster and the instance name for this registry from the designated configuration.voidshutdown(boolean emergency) Shut down all started services.protected voidTerminates all started services or until the designated service and signals the shutdown of this registry.Methods inherited from class de.aristaflow.adept2.base.registry.ServiceRegistry
autoStartServices, beforeLocalTermination, checkServiceURI, chooseAppropriateURI, createMBeanName, createRegistryWrapper, exportService, getCommunicationService, getGlobalRegistry, getInstanceNameFromServiceURI, getInvocationTarget, getLocallyExportedService, getLocalServiceObject, getService, getService, getServiceInformation, globalRegistryChanged, init, initExportServices, invalidateGlobalRegistry, prepareExport, prioritiseProtocols, readMetaConfiguration, start, unpublishServiceMethods inherited from class de.aristaflow.adept2.base.registry.LocalServiceRegistry
checkServiceInterface, checkServiceUriSyntax, checkStartupRequiredService, createLocalServiceURI, determineNodeName, getAndCheckRequiredService, getConfiguredPlugin, getGlobalSequence, getInstantiationMode, getRegistry, getSecurityManager, getServiceForInstance, notifyDataSourceToConfMgr, registryActive, renewConfiguration, startLocalService, syncExecute, terminateServiceMethods inherited from class de.aristaflow.adept2.base.registry.InstanceToInstanceRegistry
getUsedComponentInstanceNameForInstance, getUsedObjectForInstanceMethods inherited from class de.aristaflow.adept2.base.registry.PluginRegistry
createPluginLoader, getConfiguredPlugin, getConfiguredPlugin, getConfiguredPlugins, getConfiguredPluginTypes, prepareRuntimePlugin, readMetaConfigurationMethods inherited from class de.aristaflow.adept2.base.registry.AbstractRegistry
checkAndStoreProvidedObject, checkConfiguration, checkImplementingClass, checkSupertype, createInstanceForInterface, getAppropriateMethod, getArbitrarilyNamedObject, getComponentType, getFormattedSignature, getHierarchicalInstanceName, getInstanceInformation, getInterfaceForComponentType, getNames, getObjectForInstanceName, getObjectForInstanceName, getObjectForInstanceName, getSimpleInstanceName, initialiseInstantiatedObjectMethods inherited from class de.aristaflow.adept2.base.service.AbstractAuthenticatedService
_sessionActive, authenticateService, awaitActiveSessions, createChildSession, createSession, getAgent, getSessionFactory, getStartupRequired, getTopLevelAgent, getUserCredentials, globalSecurityManagerAvailable, isEarlyService, sessionHasAllCapabilities, sessionHasAllTopLevelCapabilities, sessionHasOneCapability, sessionHasOneTopLevelCapabilityMethods inherited from class de.aristaflow.adept2.base.service.AbstractADEPT2Service
_sessionFinished, activeOrInvalidServiceStateException, changeLogContext, changeLogContext, changeLogContext, consoleLog, csvLoggingEnabled, getClassSpecificJulLogger, getDependencyRegistry, getLocalUris, getLogger, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, isActive, isSessionActive, isShutdown, logMethodEntry, logMethodEntry, logMethodEntry, logMethodExit, logMethodExit, ping, preShutdown, privilegeSession, privilegeThread, revertLogContextChanges, sessionActive, sessionActive, sessionActive, sessionActive, sessionFinished, sessionFinished, signalShutdown, signalStart, unprivilegeThreadMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.aristaflow.adept2.base.service.ADEPT2Service
getLocalUris, getRelease, getRuntimeRequiredServices, getServiceInstanceName, getStartupRequiredServices, getURIs, ping, preShutdown
-
Field Details
-
instanceName
The name of the bootstrap registry, which equals the configured name of the platform (client or server).
-
-
Constructor Details
-
BootstrapRegistry
protected BootstrapRegistry(UrlConfigurationManager confMgr, Class<? extends BootstrapRegistry> bootstrapClass) throws AbortServiceException Creates a new bootstrap registry having the designated configuration manager. Before creating the registry, the root configuration will be validated against the designated class.- Parameters:
confMgr- The initial configuration manager that provides the root configuration and configurations for the loaded component instances.bootstrapClass- The class the root configuration is validated against the configuration description. Use this class unless you have a subclass that has its own configuration description. This class is also used for retrieving the release information from the version file.- Throws:
ConfigurationException- If the registry configuration is invalid, aConfigurationExceptionwill be thrown.AbortServiceException- If the initialisation or starting of the registry fails, anAbortServiceExceptionwill be thrown.
-
-
Method Details
-
bootstrap
Bootstraps this registry and therefore the platform. The registry is initialised with either the configured URI or a local URI with the instance name. Afterwards the registry is started.- Throws:
AbortServiceException- If the initialisation or starting of the registry fails, anAbortServiceExceptionwill be thrown.
-
shutdown
public void shutdown(boolean emergency) Description copied from class:LocalServiceRegistryShut down all started services.- Specified by:
shutdownin interfaceADEPT2Service- Overrides:
shutdownin classLocalServiceRegistry- Parameters:
emergency- Whether the shutdown will be an emergency shutdown.
-
terminate
Description copied from class:LocalServiceRegistryTerminates all started services or until the designated service and signals the shutdown of this registry. If a service name is provided all services will be shut down that have been started after the designated service. The shutdown of the registry will not be signalled yet.
Just call this method again afterwards usingnullas service name.- Overrides:
terminatein classLocalServiceRegistry- Parameters:
emergency- Whether it is an emergency shutdown.hierServName- The hierarchical name of the service until which to shutdown all services started later. If this isnull, all services and the registry will be shut down.
-
resolveInstanceName
Description copied from class:ServiceRegistryGets the cluster and the instance name for this registry from the designated configuration.Note that this method is called from the constructor and must not rely on instance fields!
- Specified by:
resolveInstanceNamein classServiceRegistry- Parameters:
conf- The configuration to retrieve the instance name from.- Returns:
- The cluster and the instance name for this registry from the
designated configuration. The cluster name may be
null. - Throws:
ConfigurationException- If the instance name does not exist in the configuration, aConfigurationExceptionwill be thrown. However, this should never happen if the configuration is validated beforehand.
-
prepareGlobalSecurityManager
Description copied from class:LocalServiceRegistryPrepares the security manager that is, the global security manager will be retrieved (and started) if necessary.
This method will be called before (auto) starting any service. Implementations may then prepare a global security manager and provide it appropriately. Before this method has been called, the security manager will authenticate locally. Afterwards it will work with the global security manager.- Specified by:
prepareGlobalSecurityManagerin classLocalServiceRegistry- Returns:
- The prepared global security manager to use instead of the local authentication.
- Throws:
ServiceNotKnownException- If the security manager could not be retrieved, aServiceNotKnownExceptionwill be thrown. The registry must not continue starting in this case!!
-
getClientService
Gets the client service providing convenient access to the services provided by this registry and needed by client components.- Returns:
- The registry for usage by client components.
- Throws:
ServiceNotKnownException- If there are problems loading the registry, aServiceNotKnownExceptionwill be thrown.
-
getRegistry
Gets the wrapper for access to this registry via theRegistry-interface. This is used by (server) services to access the registry. Clients should always use an appropriateclient service. Only use this registry for very special purposes.- Returns:
- The registry wrapper for this registry.
- Throws:
ServiceNotKnownException- If there are problems loading the registry, aServiceNotKnownExceptionwill be thrown.
-