org.caleigo.core
Class ActionQueue

java.lang.Object
  extended byorg.caleigo.core.ActionQueue

public class ActionQueue
extends java.lang.Object

The ActionQueue class containes an ordred queue of perform requests with ITransactionEntityAction objects and connected relevant action data.

Version:
1.00
Author:
Dennis Zikovic

Nested Class Summary
protected static class ActionQueue.ActionRequest
          Queue item that groups an ITransactionEntityAction with execution data together as an quable item.
protected  class ActionQueue.DirtyOnlyRequest
          Queue item that groups an ITransactionEntityAction with execution data together as an quable item.
 
Constructor Summary
ActionQueue()
          Creates a new instance of ActionQueue
 
Method Summary
 void addAction(ITransactionEntityAction entityAction, IDataBundle dataBundle)
          Adds the provided action request to the queue with the provided data bundle.
 void addAction(ITransactionEntityAction entityAction, IEntity entity)
          Adds the provided action request to the queue with the provided entity.
 void clear()
          Clears all queued actions from the called ActionQueue.
 void clear(ITransactionEntityAction action)
          Clears all queued actions request of the provided action from the called ActionQueue.
 void clear(IUnaryEntityAction action, IEntity entity)
          Clears all queued IUnaryEntityAction requests of the specified type targeted on the provided entity.
 ITransactionEntityAction getAction(int index)
          Returns the indexed action object from the queue.
 int getActionCount()
          Returns the number of queued entity actions.
 IDataBundle getActionData(int index)
          Returns the indexed action data object from the queue.
 java.util.Iterator getActions()
          Access method that returns an iterator for all contained action objects in the called ActionQueue.
 boolean isEmpty()
          Returns the true if no action request are queued.
 void prepareTransaction(IDataTransaction transaction)
          Action method tha will add all queued actions on the transaction in the order they were added to the called ActionQueue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionQueue

public ActionQueue()
Creates a new instance of ActionQueue

Method Detail

prepareTransaction

public void prepareTransaction(IDataTransaction transaction)
Action method tha will add all queued actions on the transaction in the order they were added to the called ActionQueue. Note that the queue will not be cleraed automatically when this method is called.


addAction

public void addAction(ITransactionEntityAction entityAction,
                      IDataBundle dataBundle)
Adds the provided action request to the queue with the provided data bundle.


addAction

public void addAction(ITransactionEntityAction entityAction,
                      IEntity entity)
Adds the provided action request to the queue with the provided entity.


clear

public void clear()
Clears all queued actions from the called ActionQueue.


clear

public void clear(ITransactionEntityAction action)
Clears all queued actions request of the provided action from the called ActionQueue.


clear

public void clear(IUnaryEntityAction action,
                  IEntity entity)
Clears all queued IUnaryEntityAction requests of the specified type targeted on the provided entity. If action is null all IUnaryEntityAction requests on the targeted entity is removed.


isEmpty

public boolean isEmpty()
Returns the true if no action request are queued.


getActionCount

public int getActionCount()
Returns the number of queued entity actions.


getAction

public ITransactionEntityAction getAction(int index)
Returns the indexed action object from the queue.


getActionData

public IDataBundle getActionData(int index)
Returns the indexed action data object from the queue.


getActions

public java.util.Iterator getActions()
Access method that returns an iterator for all contained action objects in the called ActionQueue.



Copyright © 2005 Caleigo. All Rights Reserved.