Package org.distributeme.core.lifecycle
Enum Class 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
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptiongetHealthStatus(String serviceId) Returns the health status of a given service.Returns map with health status objects for all contained public services (usually one!).Returns a list of all publicly accessable services.getServiceInfo(String serviceId) Collects and returns the info about the specified service.booleanisOnline()Returns true if the service is online.voidLogs a standard message to info.voidPrints a standard message to system out.voidregisterPublicService(String descriptor, ServiceAdapter instance) Registers a service locally running service instance.voidShutdowns the current VM and logs the message.static LifecycleComponentImplReturns the enum constant of this class with the specified name.static LifecycleComponentImpl[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
The singleton instance.
-
-
Method Details
-
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
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 nameNullPointerException- 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:
isOnlinein interfaceLifecycleComponent- Returns:
- a boolean.
-
printStatusToSystemOut
public void printStatusToSystemOut()Prints a standard message to system out.- Specified by:
printStatusToSystemOutin interfaceLifecycleComponent
-
printStatusToLogInfo
public void printStatusToLogInfo()Logs a standard message to info.- Specified by:
printStatusToLogInfoin interfaceLifecycleComponent
-
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:
getPublicServicesin interfaceLifecycleComponent- Returns:
- a
Listobject.
-
registerPublicService
Registers a service locally running service instance.- Specified by:
registerPublicServicein interfaceLifecycleComponent- Parameters:
descriptor- aStringobject.instance- aServiceAdapterobject.
-
getServiceInfo
Collects and returns the info about the specified service.- Specified by:
getServiceInfoin interfaceLifecycleComponent- Parameters:
serviceId- the target service id.- Returns:
- a
ServiceInfoobject.
-
shutdown
Shutdowns the current VM and logs the message.- Specified by:
shutdownin interfaceLifecycleComponent- Parameters:
message- aStringobject.
-
getHealthStatus
Returns the health status of a given service.- Specified by:
getHealthStatusin interfaceLifecycleComponent- Parameters:
serviceId- aStringobject.- Returns:
- a
HealthStatusobject.
-
getHealthStatuses
Returns map with health status objects for all contained public services (usually one!).- Specified by:
getHealthStatusesin interfaceLifecycleComponent- Returns:
- a
Mapobject.
-