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

Quick Search    Search Deep

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

java.lang.Object
  extended byorg.jbossmx.cluster.watchdog.mbean.watchdog.BaseCorrectiveAction
All Implemented Interfaces:
java.lang.Cloneable, CorrectiveAction
Direct Known Subclasses:
CallScriptCorrectiveAction, InvokeMethodCorrectiveAction, RestartAgentCorrectiveAction

public abstract class BaseCorrectiveAction
extends java.lang.Object
implements CorrectiveAction

Base class for CorrectiveActions


Field Summary
private  CorrectiveActionContext m_correctiveActionContext
          The CorrectiveActionContext of this CorrectiveAction
private  int m_numberOfTimesFailed
          The number of consecutive times this CorrectiveAction has failed
private  int m_numberOfTimesToApply
          The number of times to apply this CorrectiveAction
 
Constructor Summary
BaseCorrectiveAction()
          Default Constructor for BaseCorrectiveAction
 
Method Summary
 boolean apply()
          Apply this CorrectiveAction
protected abstract  boolean applyImpl()
          Actual implementation of the CorrectiveAction, defered to derived classes.
 boolean canApply()
          Returns whether this CorrectiveAction can be applied.
 java.lang.Object clone()
          Returns a clone of this CorrectiveAction
 CorrectiveActionContext getCorrectiveActionContext()
          Returns the CorrectiveActionContext of this CorrectiveAction
 int getNumberOfTimesToApply()
          Get the total number of times this CorrectiveAction can be applied.
 boolean isOverridenBy(java.util.Set correctiveActions)
          Determine if any of the CorrectiveActions in correctiveActions overides this one.
 CorrectiveAction setCorrectiveActionContext(CorrectiveActionContext correctiveActionContext)
          Sets the CorrectiveActionContext of this CorrectiveAction
 CorrectiveAction setNumberOfTimesToApply(int numberOfTimesToApply)
          Sets the number of times this CorrectiveAction can be applied
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jbossmx.cluster.watchdog.mbean.watchdog.CorrectiveAction
isOverridenBy
 

Field Detail

m_numberOfTimesToApply

private int m_numberOfTimesToApply
The number of times to apply this CorrectiveAction


m_numberOfTimesFailed

private int m_numberOfTimesFailed
The number of consecutive times this CorrectiveAction has failed


m_correctiveActionContext

private CorrectiveActionContext m_correctiveActionContext
The CorrectiveActionContext of this CorrectiveAction

Constructor Detail

BaseCorrectiveAction

public BaseCorrectiveAction()
Default Constructor for BaseCorrectiveAction

Method Detail

setCorrectiveActionContext

public final CorrectiveAction setCorrectiveActionContext(CorrectiveActionContext correctiveActionContext)
Sets the CorrectiveActionContext of this CorrectiveAction

Specified by:
setCorrectiveActionContext in interface CorrectiveAction

getCorrectiveActionContext

public final CorrectiveActionContext getCorrectiveActionContext()
Returns the CorrectiveActionContext of this CorrectiveAction

Specified by:
getCorrectiveActionContext in interface CorrectiveAction

setNumberOfTimesToApply

public final CorrectiveAction setNumberOfTimesToApply(int numberOfTimesToApply)
Sets the number of times this CorrectiveAction can be applied

Specified by:
setNumberOfTimesToApply in interface CorrectiveAction

getNumberOfTimesToApply

public final int getNumberOfTimesToApply()
Get the total number of times this CorrectiveAction can be applied.

Specified by:
getNumberOfTimesToApply in interface CorrectiveAction

isOverridenBy

public final boolean isOverridenBy(java.util.Set correctiveActions)
Determine if any of the CorrectiveActions in correctiveActions overides this one.

Specified by:
isOverridenBy in interface CorrectiveAction

apply

public final boolean apply()
                    throws CorrectiveActionException,
                           java.lang.Exception
Apply this CorrectiveAction

Specified by:
apply in interface CorrectiveAction

canApply

public final boolean canApply()
Returns whether this CorrectiveAction can be applied.

Specified by:
canApply in interface CorrectiveAction

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a clone of this CorrectiveAction


applyImpl

protected abstract boolean applyImpl()
                              throws java.lang.Exception
Actual implementation of the CorrectiveAction, defered to derived classes.