org.bibalex.daf.entities.phase
Class PhaseActionPerformer

java.lang.Object
  extended by org.bibalex.daf.entities.phase.PhaseActionPerformer

public class PhaseActionPerformer
extends java.lang.Object

Performs the actions associted with the phase. The actions are performed in the order they are added to the class. Behavior of the class in case of failure of any action can be contrrolled.

Author:
Shehab.Kamal

Field Summary
private  java.util.ArrayList<PhaseAction> actions
          Holds the actions to be performed in order.
private  Policy policy
          Holds the policy of the action performer.
 
Constructor Summary
PhaseActionPerformer(Policy policy)
          Creates a new instance of PhaseACtionPerformer.
 
Method Summary
 void addAction(PhaseAction action)
          Adds an action to the list of actions associated with this instance.
 void performActions()
          Performs the actions taking the policy into consideration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

actions

private java.util.ArrayList<PhaseAction> actions
Holds the actions to be performed in order.


policy

private Policy policy
Holds the policy of the action performer.

Constructor Detail

PhaseActionPerformer

public PhaseActionPerformer(Policy policy)
Creates a new instance of PhaseACtionPerformer.

Parameters:
policy - The policy of this instance.
Method Detail

addAction

public void addAction(PhaseAction action)
Adds an action to the list of actions associated with this instance.

Parameters:
action - The action to add.

performActions

public void performActions()
                    throws PhaseActionException
Performs the actions taking the policy into consideration. Null actions won't be executed.

Throws:
PhaseActionException - If the policy instructs the performer to throw exception on error.