Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jbossmx.cluster.watchdog.mbean
Class WatchdogCorrectiveAction  view WatchdogCorrectiveAction download WatchdogCorrectiveAction.java

java.lang.Object
  extended byorg.jbossmx.cluster.watchdog.mbean.WatchdogCorrectiveAction

public class WatchdogCorrectiveAction
extends java.lang.Object

This class encapsulates the sequences of corrective actions the Watchdog should take when the StartableMBean fails.


Field Summary
static int INVOKE_RESTART_METHOD
          Constant identifying an Invoke Restart Method Corrective Action
private  int m_count
          The number of times that the current Corrective Action has been applied
private  int m_currentCorrectiveAction
          The current Corrective Action
private  int m_initialCorrectiveAction
          The initial Corrective Action
private  WatchdogMBean m_watchdogInterface
          The WatchdogMBean which is watching the MBean that this Corrective Action applied to
private  int m_worstCorrectiveAction
          The worst Corrective Action
static int REREGISTER_MBEAN
          Constant identifying a Reregister MBean Corrective Action
static int RESTART_AGENT
          Constant identifying a Restart Agent Corrective Action
static int RESTART_MACHINE
          Constant identifying a Restart Machine Corrective Action
 
Constructor Summary
WatchdogCorrectiveAction(WatchdogMBean watchdogInterface)
          Constructor for WatchdogCorrectiveAction
WatchdogCorrectiveAction(WatchdogMBean watchdogInterface, int initialCorrectiveAction)
          Constructor for WatchdogCorrectiveAction
 
Method Summary
private  int getCount()
          Gets the number of times that the current Corrective Action has been applied
 int getCurrentCorrectiveAction()
          Gets the current Corrective Action
private  int getInitialCorrectiveAction()
          Gets the initial Corrective Action
private  int getNextAvailableCorrectiveAction(int startingCorrectiveAction)
          Gets the next available Corrective Action that is applicable, returns -1 if there are no Corrective Actions >= startingCorrectiveAction
private  int getNumTimesToAttemptCorrectiveAction(int correctiveAction)
          Gets the number of times a Corrective Action can be attempted
private  WatchdogMBean getWatchdogInterface()
          Gets the WatchdogMBean which is watching the MBean that this Corrective Action applied to.
 int getWorstCorrectiveAction()
          Gets the worst current CorrectiveAction so far
private  boolean hasCountReachedMax()
          Gets whether the current corrective action has reached the maximum number of times it can be attempted.
private  void increaseCorrectiveActionSeverity()
          Update the current Corrective Action to point to the next Corrective Action that is applicable.
 void setCorrectiveActionSucceeded(boolean succeeded)
          Set whether the current Corrective Action succeeded
private  void setCount(int count)
          Sets the number of times that the current Corrective Action has been applied
private  void setCurrentCorrectiveAction(int currentCorrectiveAction)
           
private  void setInitialCorrectiveAction(int initialCorrectiveAction)
          Sets the initial Corrective Action
private  void setWatchdogInterface(WatchdogMBean watchdogInterface)
          Sets the WatchdogMBean which is watching the MBean that this Corrective Action applied to.
private  void setWorstCorrectiveAction(int worstCorrectiveAction)
           
private  void updateCorrectiveAction(int correctiveAction)
          Update the current Corrective Action, also updates the worst current Corrective Action.
private  void updateWorstCorrectiveAction()
          Updates the worst corrective action so that it is at least equal to the current corrective action.
private  void validateCorrectiveAction(int correctiveAction)
          Validates a Corrective Action.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INVOKE_RESTART_METHOD

public static final int INVOKE_RESTART_METHOD
Constant identifying an Invoke Restart Method Corrective Action

See Also:
Constant Field Values

REREGISTER_MBEAN

public static final int REREGISTER_MBEAN
Constant identifying a Reregister MBean Corrective Action

See Also:
Constant Field Values

RESTART_AGENT

public static final int RESTART_AGENT
Constant identifying a Restart Agent Corrective Action

See Also:
Constant Field Values

RESTART_MACHINE

public static final int RESTART_MACHINE
Constant identifying a Restart Machine Corrective Action

See Also:
Constant Field Values

m_watchdogInterface

private WatchdogMBean m_watchdogInterface
The WatchdogMBean which is watching the MBean that this Corrective Action applied to


m_initialCorrectiveAction

private int m_initialCorrectiveAction
The initial Corrective Action


m_currentCorrectiveAction

private int m_currentCorrectiveAction
The current Corrective Action


m_count

private int m_count
The number of times that the current Corrective Action has been applied


m_worstCorrectiveAction

private int m_worstCorrectiveAction
The worst Corrective Action

Constructor Detail

WatchdogCorrectiveAction

public WatchdogCorrectiveAction(WatchdogMBean watchdogInterface)
                         throws org.jbossmx.cluster.watchdog.HermesException
Constructor for WatchdogCorrectiveAction


WatchdogCorrectiveAction

public WatchdogCorrectiveAction(WatchdogMBean watchdogInterface,
                                int initialCorrectiveAction)
                         throws org.jbossmx.cluster.watchdog.HermesException
Constructor for WatchdogCorrectiveAction

Method Detail

getCurrentCorrectiveAction

public int getCurrentCorrectiveAction()
Gets the current Corrective Action


getWorstCorrectiveAction

public int getWorstCorrectiveAction()
Gets the worst current CorrectiveAction so far


setCorrectiveActionSucceeded

public void setCorrectiveActionSucceeded(boolean succeeded)
                                  throws org.jbossmx.cluster.watchdog.HermesException
Set whether the current Corrective Action succeeded


updateCorrectiveAction

private void updateCorrectiveAction(int correctiveAction)
                             throws org.jbossmx.cluster.watchdog.HermesException
Update the current Corrective Action, also updates the worst current Corrective Action.


increaseCorrectiveActionSeverity

private void increaseCorrectiveActionSeverity()
                                       throws org.jbossmx.cluster.watchdog.HermesException
Update the current Corrective Action to point to the next Corrective Action that is applicable.


getNextAvailableCorrectiveAction

private int getNextAvailableCorrectiveAction(int startingCorrectiveAction)
Gets the next available Corrective Action that is applicable, returns -1 if there are no Corrective Actions >= startingCorrectiveAction


getNumTimesToAttemptCorrectiveAction

private int getNumTimesToAttemptCorrectiveAction(int correctiveAction)
Gets the number of times a Corrective Action can be attempted


updateWorstCorrectiveAction

private void updateWorstCorrectiveAction()
                                  throws org.jbossmx.cluster.watchdog.HermesException
Updates the worst corrective action so that it is at least equal to the current corrective action.


hasCountReachedMax

private boolean hasCountReachedMax()
Gets whether the current corrective action has reached the maximum number of times it can be attempted.


getWatchdogInterface

private WatchdogMBean getWatchdogInterface()
Gets the WatchdogMBean which is watching the MBean that this Corrective Action applied to.


setWatchdogInterface

private void setWatchdogInterface(WatchdogMBean watchdogInterface)
Sets the WatchdogMBean which is watching the MBean that this Corrective Action applied to.


getInitialCorrectiveAction

private int getInitialCorrectiveAction()
Gets the initial Corrective Action


setInitialCorrectiveAction

private void setInitialCorrectiveAction(int initialCorrectiveAction)
                                 throws org.jbossmx.cluster.watchdog.HermesException
Sets the initial Corrective Action


setCurrentCorrectiveAction

private void setCurrentCorrectiveAction(int currentCorrectiveAction)
                                 throws org.jbossmx.cluster.watchdog.HermesException

setWorstCorrectiveAction

private void setWorstCorrectiveAction(int worstCorrectiveAction)
                               throws org.jbossmx.cluster.watchdog.HermesException

validateCorrectiveAction

private void validateCorrectiveAction(int correctiveAction)
                               throws org.jbossmx.cluster.watchdog.HermesException
Validates a Corrective Action. A Corrective Action is valid if it is >= INVOKE_RESTART_METHOD and <= RESTART_MACHINE.


setCount

private void setCount(int count)
Sets the number of times that the current Corrective Action has been applied


getCount

private int getCount()
Gets the number of times that the current Corrective Action has been applied