org.talika.tarsis.command.action
Class AbstractAction

java.lang.Object
  extended by org.talika.tarsis.command.action.AbstractAction
All Implemented Interfaces:
Action
Direct Known Subclasses:
ActionWrapper, DefaultAction

public abstract class AbstractAction
extends java.lang.Object
implements Action

Base implementation of Action interface.

Defines all method except validate and execute method.

Version:
$Revision: 121 $
Author:
Jose M. Palomar

Constructor Summary
AbstractAction()
          Constructs a new AbstractAction object.
 
Method Summary
 void destroy()
          Called by Tarsis MVC Framework to destroy action.
abstract  java.lang.String execute(Request request, Response response)
          Called by Tarsis MVC Framework to handle request everytime command is invoked.
protected  Context getContext()
          Returns the Tarsis context.
 void init(Context context)
          Called by Tarsis MVC Framework to initialize action.
abstract  void validate(Request request)
          Called by Tarsis MVC Framework to validate request everytime command is invoked.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAction

public AbstractAction()
Constructs a new AbstractAction object.

Method Detail

init

public void init(Context context)
          throws ActionException
Called by Tarsis MVC Framework to initialize action.

This method should be used to initialize any static resource needed by action.

This implementation simply saves context for later use.

Specified by:
init in interface Action
Parameters:
context - Context contex of Tarsis MVC Framework.
Throws:
ActionException - if an exception has occurred that interferes with the action's normal operation.
See Also:
Action.init(Context)

destroy

public void destroy()
Called by Tarsis MVC Framework to destroy action.

This implementation do nothing.

Specified by:
destroy in interface Action
See Also:
Action.destroy()

validate

public abstract void validate(Request request)
                       throws ActionException
Called by Tarsis MVC Framework to validate request everytime command is invoked.

This method is called only if command is validable.

Specified by:
validate in interface Action
Parameters:
request - Request object representing client's request.
Throws:
ActionException - if an exception has occurred that interferes with the action's normal operation.

execute

public abstract java.lang.String execute(Request request,
                                         Response response)
                                  throws ActionException
Called by Tarsis MVC Framework to handle request everytime command is invoked.

Specified by:
execute in interface Action
Parameters:
request - Request object representing client's request.
response - Response object representing client's reponse.
Returns:
String the name of view to be forwarded or null for default view.
Throws:
ActionException - if an exception has occurred that interferes with the action's normal operation.
See Also:
Action.execute(Request, Response)

getContext

protected final Context getContext()
Returns the Tarsis context.

Returns:
Context the Tarsis context.


Copyright © 2002-2012 Talika Open Source Group. All Rights Reserved.