Class LifecycleRegistration


  • @Deprecated
    public final class LifecycleRegistration
    extends Object
    Deprecated.
    the lifecycle services would be marked with LifecycleService annotation.
    Provides a fluent API for lifecycle service registration.
    Since:
    3.0.0
    • Method Detail

      • register

        public static LifecycleRegistration register​(ILifecyclePhaseAwareService service)
        Deprecated.
        Registers the specified service.
        Parameters:
        service - the service to register, cannot be null.
        Returns:
        a lifecycle registration instance, never null.
      • withName

        public LifecycleRegistration withName​(String serviceName)
        Deprecated.
        Sets the name for service registration.
        Parameters:
        serviceName - the service name to use while registration in the registry, cannot be null.
        Returns:
        a reference to this object, never null.
      • withDependencies

        public LifecycleRegistration withDependencies​(LifecyclePhase phase,
                                                      String... services)
        Deprecated.
        Adds service dependencies in the given context.
        This method can be executed several times. Dependencies are accumulated.

         ServiceRegistration sr = ...;
        
         sr.withDependencies(LifecyclePhase.CHECKING, "S1", "S4");
         sr.withDependencies(LifecyclePhase.CHECKING, "S2");
         sr.withDependencies(LifecyclePhase.RESOURCE_LOADING, "S2", "S3");
         
        In result for 'CHECKING' phase we will have {"S1", "S2", "S4"} and for 'RESOURCE_LOADING' - {"S2", "S3"}

        Parameters:
        phase - the phase to participate, cannot be null.
        services - the service names on which service is dependent, cannot be null.
        Returns:
        a reference to this object, never null.
        Throws:
        IllegalStateException - if dependency provider is already registered.
      • withDependencies

        public LifecycleRegistration withDependencies​(IServiceDependencyProvider dependencyProvider)
        Deprecated.
        Adds dependency provider for services with dynamic dependencies.
        Parameters:
        dependencyProvider - the service dependencies provider, cannot be null.
        Returns:
        a reference to this object.
        Throws:
        IllegalStateException - if static dependencies is already registered.
      • accept

        public void accept()
        Deprecated.
        Accepts the configured service to the lifecycle registry.