Package org.distributeme.core.lifecycle
Interface LifecycleComponent
- All Known Implementing Classes:
LifecycleComponentImpl
public interface LifecycleComponent
Defines an internal component that controls lifecycle of services inside of distributeme distributed vms.
- Version:
- $Id: $Id
- Author:
- lrosenberg
-
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 serviceId, ServiceAdapter instance) Registers a service locally running service instance.voidShutdowns the current VM and logs the message.
-
Method Details
-
isOnline
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.- Returns:
- a boolean.
-
printStatusToSystemOut
void printStatusToSystemOut()Prints a standard message to system out. -
printStatusToLogInfo
void printStatusToLogInfo()Logs a standard message to info. -
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.- Returns:
- a
Listobject.
-
registerPublicService
Registers a service locally running service instance.- Parameters:
serviceId- aStringobject.instance- aServiceAdapterobject.
-
getServiceInfo
Collects and returns the info about the specified service.- Parameters:
serviceId- the target service id.- Returns:
- a
ServiceInfoobject.
-
shutdown
Shutdowns the current VM and logs the message.- Parameters:
message- aStringobject.
-
getHealthStatus
Returns the health status of a given service.- Parameters:
serviceId- aStringobject.- Returns:
- a
HealthStatusobject.
-
getHealthStatuses
Map<String,HealthStatus> getHealthStatuses()Returns map with health status objects for all contained public services (usually one!).- Returns:
- a
Mapobject.
-