se.lu.thep.waf
Interface ActionFactoryInterface


public interface ActionFactoryInterface

Implementations of this interface should initiate an action pool and associate these with an id. An action factory should be implemented as a singleton.

Author:
gregory

Method Summary
 void destroy()
           
 AbstractAction getAbstractAction(java.lang.String actionId, Event event)
          Returns a new action ready for running.
<D extends AbstractAction>
java.lang.String
getId(java.lang.Class<D> action)
           
 void init(ActionServlet servlet)
          Initiate the factory.
 void setLastEvent(Event event)
          Useful to store information about the last event.
 

Method Detail

init

void init(ActionServlet servlet)
Initiate the factory. Usually you would initiate any actions you want this factory to handle.


getAbstractAction

AbstractAction getAbstractAction(java.lang.String actionId,
                                 Event event)
Returns a new action ready for running. If the factory does not handle the action given by it's actionId null is returned.

Parameters:
actionId - to look for
event - that this action is part of
Returns:
the action that matches the actionId or null if no matching action is found

setLastEvent

void setLastEvent(Event event)
Useful to store information about the last event.

Parameters:
event - that was last run.

getId

<D extends AbstractAction> java.lang.String getId(java.lang.Class<D> action)
Type Parameters:
D - any action that extends AbstractAction
Parameters:
action - class to get the id of
Returns:
id of the given action class as a string.

destroy

void destroy()