de.cau.cs.kieler.sim.kiem.automated.execution
Class CancelManager

java.lang.Object
  extended by de.cau.cs.kieler.sim.kiem.automated.execution.CancelManager

public final class CancelManager
extends Object

Manager for everything related to the premature termination of the current execution run.

Rating proposed yellow
(2010-02-08)

Nested Class Summary
static class CancelManager.CancelStatus
          The status of the operation.
static class CancelManager.MonitorChecker
          This thread checks whether the user canceled the monitor while a step was being processed.
 
Field Summary
static int DISPLACEMENT
          The displacement from the KIEMs timeout, in order to cancel before KIEM does.
 
Method Summary
 void cancelExecution(CancelManager.CancelStatus status)
          Cancel the currently running execution.
 void cancelExecutionFile(CancelManager.CancelStatus status)
          Cancel the currently running execution file.
 void cancelIteration(CancelManager.CancelStatus status)
          Cancel the currently running iteration.
 void cancelModelFile(CancelManager.CancelStatus status)
          Cancel the currently running model file.
static CancelManager getInstance()
          Getter for the singleton instance.
protected static int getTimeout()
          Getter for the timeout.
protected  CancelManager.CancelStatus isExecutionCanceled()
          Determine whether or not the entire execution should be canceled.
protected  CancelManager.CancelStatus isExecutionFileCanceled()
          Determine whether or not the current execution file should be skipped.
protected  CancelManager.CancelStatus isIterationCanceled()
          Determine whether or not the current iteration should be skipped.
protected  CancelManager.CancelStatus isModelFileCanceled()
          Determine whether or not the current model file should be skipped.
protected static void loadTimeout()
          Load the timeout from the KiemPlugin or use default value.
protected  void resetExecutionCancel()
          Reset the cancel conditions.
protected  void resetExecutionFileCancel()
          Reset the cancel conditions.
protected  void resetIterationCancel()
          Reset the cancel conditions.
protected  void resetModelFileCancel()
          Reset the cancel conditions.
protected static void restoreTimeout()
          Restore the saved timeout in KIEM.
 void setMonitor(IProgressMonitor monitorParam)
          Setter for the monitor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISPLACEMENT

public static final int DISPLACEMENT
The displacement from the KIEMs timeout, in order to cancel before KIEM does.

See Also:
Constant Field Values
Method Detail

getInstance

public static CancelManager getInstance()
Getter for the singleton instance.

Returns:
the instance

cancelIteration

public void cancelIteration(CancelManager.CancelStatus status)
Cancel the currently running iteration.

Parameters:
status - the status that the operation was canceled with.

isIterationCanceled

protected CancelManager.CancelStatus isIterationCanceled()
Determine whether or not the current iteration should be skipped.

Returns:
the status of the operation

resetIterationCancel

protected void resetIterationCancel()
Reset the cancel conditions.


cancelModelFile

public void cancelModelFile(CancelManager.CancelStatus status)
Cancel the currently running model file.

Parameters:
status - the status of the operation

isModelFileCanceled

protected CancelManager.CancelStatus isModelFileCanceled()
Determine whether or not the current model file should be skipped.

Returns:
the status of the operation

resetModelFileCancel

protected void resetModelFileCancel()
Reset the cancel conditions.


cancelExecutionFile

public void cancelExecutionFile(CancelManager.CancelStatus status)
Cancel the currently running execution file.

Parameters:
status - the status of the operation

isExecutionFileCanceled

protected CancelManager.CancelStatus isExecutionFileCanceled()
Determine whether or not the current execution file should be skipped.

Returns:
the status of the operation

resetExecutionFileCancel

protected void resetExecutionFileCancel()
Reset the cancel conditions.


cancelExecution

public void cancelExecution(CancelManager.CancelStatus status)
Cancel the currently running execution.

Parameters:
status - the status of the operation

isExecutionCanceled

protected CancelManager.CancelStatus isExecutionCanceled()
Determine whether or not the entire execution should be canceled.

Returns:
the status of the operation

resetExecutionCancel

protected void resetExecutionCancel()
Reset the cancel conditions.


setMonitor

public void setMonitor(IProgressMonitor monitorParam)
Setter for the monitor.

Parameters:
monitorParam - the monitor to set

loadTimeout

protected static void loadTimeout()
Load the timeout from the KiemPlugin or use default value.


getTimeout

protected static int getTimeout()
Getter for the timeout.

Returns:
the timeout

restoreTimeout

protected static void restoreTimeout()
Restore the saved timeout in KIEM.