webwork.action.factory
Class ActionFactory

java.lang.Object
  extended bywebwork.action.factory.ActionFactory
Direct Known Subclasses:
ActionFactoryProxy, DefaultActionFactory, JavaActionFactory

public abstract class ActionFactory
extends java.lang.Object

Base action factory implementation that initializes the action factory delegation, establishes the ActionContext and provides access to the action factory. Upon instantiation, this class will initialize the action factory specified by the configuration property webwork.action.factory. If this property is not configured or the specified class cannot be instantiated, the DefaultActionFactory class will be instantiated.

Version:
$Revision: 1.20 $
Author:
Rickard Öberg (rickard@middleware-company.com)

Constructor Summary
ActionFactory()
           
 
Method Summary
 void flushCaches()
          Called if the configuration has been modified.
static Action getAction(java.lang.String aName)
          Returns the matching action found as the result of traversing the action factory delegation chain.
static ActionFactory getActionFactory()
          Returns the action factory implementation or the default action factory if not available.
abstract  Action getActionImpl(java.lang.String aName)
          Returns the action object for the specified action or a matching action on the action factory delegation chain.
static void setActionFactory(ActionFactory aFactory)
          Set the action factory implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionFactory

public ActionFactory()
Method Detail

getAction

public static Action getAction(java.lang.String aName)
                        throws java.lang.Exception
Returns the matching action found as the result of traversing the action factory delegation chain.

Parameters:
aName - name of action to return
Returns:
action located through the factory delegation chain
Throws:
java.lang.Exception

getActionFactory

public static ActionFactory getActionFactory()
Returns the action factory implementation or the default action factory if not available.

Returns:
action factory implementation

setActionFactory

public static void setActionFactory(ActionFactory aFactory)
                             throws java.lang.IllegalStateException
Set the action factory implementation. Can only be called once.

Throws:
java.lang.IllegalStateException

getActionImpl

public abstract Action getActionImpl(java.lang.String aName)
                              throws java.lang.Exception
Returns the action object for the specified action or a matching action on the action factory delegation chain.

Parameters:
aName - name of action to check for a match
Throws:
java.lang.Exception

flushCaches

public void flushCaches()
Called if the configuration has been modified. If an ActionFactory does any caching of results, it should override this method and flush its internal caches in it.



Copyright © 2001-2003 WebWork All Rights Reserved.