Class TwoPhaseBootstrap<T extends ADEPT2Service>

    • Field Detail

      • initialServiceCls

        protected final Class<T extends ADEPT2Service> initialServiceCls
        The class of the initial service.
      • initialServiceType

        protected final String initialServiceType
        The type name of the initial service.
    • Constructor Detail

      • TwoPhaseBootstrap

        public TwoPhaseBootstrap​(Class<T> initialServiceCls,
                                 String initialServiceType,
                                 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. If an initial service is provided (via its class and component type name), this registry bootstraps in two phases. In the first phase only the initial service will be retrieved. This will start all services required by the initial service but not the registry itself.
        Parameters:
        initialServiceCls - The class of the initial service. If this is null, this registry will act like the normal BootstrapRegistry.
        initialServiceType - The type name of the initial service. If this is null or the empty string, this registry will act like the normal BootstrapRegistry.
        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.
        Throws:
        AbortServiceException - If the initialisation or starting of the registry fails, an AbortServiceException will be thrown. If the registry configuration is invalid, a ConfigurationExceptionwill be thrown.
    • Method Detail

      • autoStartServices

        protected void autoStartServices()
                                  throws AbortServiceException
        Description copied from class: LocalServiceRegistry
        Prepares the global security manager, authenticates this registry, provides the data sources for the runtime configurations to the configuration manager if appropriate, and starts all services to be automatically started at startup of this registry.
        Overrides:
        autoStartServices in class ServiceRegistry
        Throws:
        AbortServiceException - If there are problems preparing the security manager or starting one of the services to be automatically started, an AbortServiceException will be thrown.
      • getInitialService

        protected T getInitialService()
        Gets the initial service that is provided in the first phase of bootstrapping.
        Returns:
        The initial service that is provided in the first phase of bootstrapping or null if no initial service is specified.
      • bootstrap

        protected void bootstrap()
                          throws AbortServiceException
        Description copied from class: BootstrapRegistry
        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.
        Overrides:
        bootstrap in class BootstrapRegistry
        Throws:
        AbortServiceException - If the initialisation or starting of the registry fails, an AbortServiceException will be thrown.
      • continueBootstrap

        protected GlobalRegistry continueBootstrap()
                                            throws AbortServiceException
        Continues the bootstrap. This will autostart the services of the superclass.
        Returns:
        The global registry which provides access to public services.
        Throws:
        AbortServiceException - If there are problems preparing the security manager or starting one of the services to be automatically started, an AbortServiceException will be thrown.
        See Also:
        ServiceRegistry.autoStartServices()
      • shutdownToInitialService

        public void shutdownToInitialService()
        Shuts down all services until the initial service. This can then be used before shutting down completely.