edu.ksu.cis.cadena.core.queue
Class AbstractModelChangeAction

java.lang.Object
  extended by edu.ksu.cis.cadena.core.queue.AbstractModelChangeAction
All Implemented Interfaces:
IModelChangeAction

public abstract class AbstractModelChangeAction
extends java.lang.Object
implements IModelChangeAction


Nested Class Summary
static class AbstractModelChangeAction.State
           
 
Constructor Summary
AbstractModelChangeAction()
           
 
Method Summary
 void completed()
          Called by the queue after an has successfully completed
 java.lang.Exception getException()
          Gets the exception that occured during execution.
 ModelChangeQueue getQueue()
          Gets the queue that this action is contained within.
abstract  void run()
          Run the action.
 void setException(java.lang.Exception exception)
          This is set by the ModelChangeQueue if an exception was caught while executing this action.
 void setQueue(ModelChangeQueue queue)
          Called by ModelChangeQueue when it is added to a queue or removed from a queue.
 void started()
          Called by the queue directly before the action is started
 void waitForExecution()
          Waits for the action to be run by the containing queue.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractModelChangeAction

public AbstractModelChangeAction()
Method Detail

run

public abstract void run()
Description copied from interface: IModelChangeAction
Run the action. This should be called by ModelChangeQueue

Specified by:
run in interface IModelChangeAction

setQueue

public void setQueue(ModelChangeQueue queue)
Description copied from interface: IModelChangeAction
Called by ModelChangeQueue when it is added to a queue or removed from a queue.

Specified by:
setQueue in interface IModelChangeAction
Parameters:
queue - The queue it was added to.

started

public void started()
Description copied from interface: IModelChangeAction
Called by the queue directly before the action is started

Specified by:
started in interface IModelChangeAction

completed

public void completed()
Description copied from interface: IModelChangeAction
Called by the queue after an has successfully completed

Specified by:
completed in interface IModelChangeAction

setException

public void setException(java.lang.Exception exception)
Description copied from interface: IModelChangeAction
This is set by the ModelChangeQueue if an exception was caught while executing this action.

Specified by:
setException in interface IModelChangeAction
Parameters:
exception - The exception.

getException

public java.lang.Exception getException()
Description copied from interface: IModelChangeAction
Gets the exception that occured during execution. If no exception occured during execution, null is returned.

Specified by:
getException in interface IModelChangeAction
Returns:
The exception.
See Also:
IModelChangeAction.setException(java.lang.Exception)

getQueue

public ModelChangeQueue getQueue()
Description copied from interface: IModelChangeAction
Gets the queue that this action is contained within.

Specified by:
getQueue in interface IModelChangeAction
Returns:
The queue that the action is in. Returns null if the action has not been added to a queue, or the action has already run.

waitForExecution

public void waitForExecution()
Description copied from interface: IModelChangeAction
Waits for the action to be run by the containing queue. Returns immeadiately if the action has not been added to a queue, or if it has already ran.

Specified by:
waitForExecution in interface IModelChangeAction