Enum Class LifecycleComponentImpl

java.lang.Object
java.lang.Enum<LifecycleComponentImpl>
org.distributeme.core.lifecycle.LifecycleComponentImpl
All Implemented Interfaces:
Serializable, Comparable<LifecycleComponentImpl>, Constable, LifecycleComponent

public enum LifecycleComponentImpl extends Enum<LifecycleComponentImpl> implements LifecycleComponent
Implementation of the LifecycleComponent. This one is a singleton.
Version:
$Id: $Id
Author:
lrosenberg
  • Enum Constant Details

  • Method Details

    • values

      public static LifecycleComponentImpl[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static LifecycleComponentImpl valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isOnline

      public boolean isOnline()
      Returns true if the service is online. Actually this method always returns true since all services are active for now, however you can call this method from a remote stub to detect whether the service replies at all.
      Specified by:
      isOnline in interface LifecycleComponent
      Returns:
      a boolean.
    • printStatusToSystemOut

      public void printStatusToSystemOut()
      Prints a standard message to system out.
      Specified by:
      printStatusToSystemOut in interface LifecycleComponent
    • printStatusToLogInfo

      public void printStatusToLogInfo()
      Logs a standard message to info.
      Specified by:
      printStatusToLogInfo in interface LifecycleComponent
    • getPublicServices

      public List<String> getPublicServices()
      Returns a list of all publicly accessable services. Publicly accessable in this context means that the service is accessible via the remote interface. It doesn't include support services like event service bridge or lifecycle service itself, which are meant to have another usage.
      Specified by:
      getPublicServices in interface LifecycleComponent
      Returns:
      a List object.
    • registerPublicService

      public void registerPublicService(String descriptor, ServiceAdapter instance)
      Registers a service locally running service instance.
      Specified by:
      registerPublicService in interface LifecycleComponent
      Parameters:
      descriptor - a String object.
      instance - a ServiceAdapter object.
    • getServiceInfo

      public ServiceInfo getServiceInfo(String serviceId)
      Collects and returns the info about the specified service.
      Specified by:
      getServiceInfo in interface LifecycleComponent
      Parameters:
      serviceId - the target service id.
      Returns:
      a ServiceInfo object.
    • shutdown

      public void shutdown(String message)
      Shutdowns the current VM and logs the message.
      Specified by:
      shutdown in interface LifecycleComponent
      Parameters:
      message - a String object.
    • getHealthStatus

      public HealthStatus getHealthStatus(String serviceId)
      Returns the health status of a given service.
      Specified by:
      getHealthStatus in interface LifecycleComponent
      Parameters:
      serviceId - a String object.
      Returns:
      a HealthStatus object.
    • getHealthStatuses

      public Map<String,HealthStatus> getHealthStatuses()
      Returns map with health status objects for all contained public services (usually one!).
      Specified by:
      getHealthStatuses in interface LifecycleComponent
      Returns:
      a Map object.