com.caucho.env.health
Class HealthStatusService

java.lang.Object
  extended by com.caucho.env.service.AbstractResinSubSystem
      extended by com.caucho.env.health.HealthStatusService
All Implemented Interfaces:
ResinSubSystem

public class HealthStatusService
extends AbstractResinSubSystem

A service that any component can use to send notifications about health status changes. Listeners can register to receive these events.

Author:
paul

Field Summary
static int START_PRIORITY
           
 
Fields inherited from interface com.caucho.env.service.ResinSubSystem
START_PRIORITY_CACHE_SERVICE, START_PRIORITY_CLASSLOADER, START_PRIORITY_CLUSTER_SERVICE, START_PRIORITY_DEFAULT, START_PRIORITY_ENV_SYSTEM, START_PRIORITY_NETWORK_CLUSTER
 
Method Summary
 void addHealthStatusListener(HealthStatusListener listener)
          Registers a HealthStatusListener to receive health status notifications
static HealthStatusService createAndAddService()
           
static HealthStatusService getCurrent()
           
 int getStartPriority()
          Returns the start priority of the service, used to determine which services to start first.
static void updateCurrentHealthStatus(java.lang.Object source, HealthStatus status, java.lang.String message)
          Notify all HealthStatusListeners about a change in health status.
 void updateHealthStatus(java.lang.Object source, HealthStatus status, java.lang.String message)
          Notify all HealthStatusListeners about a change in health status.
 
Methods inherited from class com.caucho.env.service.AbstractResinSubSystem
destroy, getStopPriority, preCreate, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

START_PRIORITY

public static final int START_PRIORITY
See Also:
Constant Field Values
Method Detail

createAndAddService

public static HealthStatusService createAndAddService()

getCurrent

public static HealthStatusService getCurrent()

updateHealthStatus

public void updateHealthStatus(java.lang.Object source,
                               HealthStatus status,
                               java.lang.String message)
Notify all HealthStatusListeners about a change in health status.

Parameters:
source - object generating the notification; usually "this"
status - new health status
message - health status message

updateCurrentHealthStatus

public static void updateCurrentHealthStatus(java.lang.Object source,
                                             HealthStatus status,
                                             java.lang.String message)
Notify all HealthStatusListeners about a change in health status.

Parameters:
source - object generating the notification; usually "this"
status - new health status
message - health status message

addHealthStatusListener

public void addHealthStatusListener(HealthStatusListener listener)
Registers a HealthStatusListener to receive health status notifications

Parameters:
listener -

getStartPriority

public int getStartPriority()
Description copied from interface: ResinSubSystem
Returns the start priority of the service, used to determine which services to start first.

Specified by:
getStartPriority in interface ResinSubSystem
Overrides:
getStartPriority in class AbstractResinSubSystem