ch.tatool.core.element.handler.timeout
Class DefaultTimeoutHandler

java.lang.Object
  extended by ch.tatool.core.element.AbstractPropertyHolder
      extended by ch.tatool.core.element.NodeImpl
          extended by ch.tatool.core.element.handler.timeout.DefaultTimeoutHandler
All Implemented Interfaces:
TimeoutHandler, PropertyHolder, Node, ExecutionPhaseListener

public class DefaultTimeoutHandler
extends NodeImpl
implements ExecutionPhaseListener, TimeoutHandler

Aspect that provides task timeout capability. This aspect only makes sense when attached to a task.

Author:
Michael Ruflin

Field Summary
protected static LongProperty durationProperty
           
static String PROPERTY_DURATION
           
static String PROPERTY_REACTION_TIME
           
protected static LongProperty reactionTimeProperty
           
protected  Timer timer
          Timer used for the timeout.
 
Constructor Summary
DefaultTimeoutHandler()
           
 
Method Summary
 void cancelTimeout()
          Cancels the timeout.
 long getDefaultTimerDuration()
           
 long getReactionTime()
           
protected  Timer getTimer()
           
protected  long getTimerStartTimestamp()
           
 boolean isLogTrialProperties()
           
 void processExecutionPhase(ExecutionContext context)
           
 void setDefaultTimerDuration(long defaultTimerDuration)
           
 void setLogTrialProperties(boolean logTrialProperties)
          Set whether timeout information should be logged in the trial.
 void setReactionTime(long reactionTime)
           
 void startTimeout(ExecutionContext context)
          Starts the timer.
protected  void timerElapsed()
           
 
Methods inherited from class ch.tatool.core.element.NodeImpl
assignParent, assignParent, assignParents, getId, getLocalId, getParent, setId, setLocalId, setParent
 
Methods inherited from class ch.tatool.core.element.AbstractPropertyHolder
clearProperties, getKeys, getProperty, removeProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ch.tatool.element.Node
getParent, setParent
 
Methods inherited from interface ch.tatool.data.PropertyHolder
clearProperties, getId, getKeys, getProperty, removeProperty, setProperty
 

Field Detail

PROPERTY_DURATION

public static final String PROPERTY_DURATION
See Also:
Constant Field Values

PROPERTY_REACTION_TIME

public static final String PROPERTY_REACTION_TIME
See Also:
Constant Field Values

timer

protected Timer timer
Timer used for the timeout.


durationProperty

protected static LongProperty durationProperty

reactionTimeProperty

protected static LongProperty reactionTimeProperty
Constructor Detail

DefaultTimeoutHandler

public DefaultTimeoutHandler()
Method Detail

startTimeout

public void startTimeout(ExecutionContext context)
Starts the timer.

Specified by:
startTimeout in interface TimeoutHandler

cancelTimeout

public void cancelTimeout()
Cancels the timeout.

Specified by:
cancelTimeout in interface TimeoutHandler

timerElapsed

protected void timerElapsed()

getTimerStartTimestamp

protected long getTimerStartTimestamp()

processExecutionPhase

public void processExecutionPhase(ExecutionContext context)
Specified by:
processExecutionPhase in interface ExecutionPhaseListener

getTimer

protected Timer getTimer()

isLogTrialProperties

public boolean isLogTrialProperties()

setLogTrialProperties

public void setLogTrialProperties(boolean logTrialProperties)
Set whether timeout information should be logged in the trial.


getDefaultTimerDuration

public long getDefaultTimerDuration()
Specified by:
getDefaultTimerDuration in interface TimeoutHandler

setDefaultTimerDuration

public void setDefaultTimerDuration(long defaultTimerDuration)
Specified by:
setDefaultTimerDuration in interface TimeoutHandler

getReactionTime

public long getReactionTime()

setReactionTime

public void setReactionTime(long reactionTime)


Copyright © 2012. All Rights Reserved.