org.talika.tarsis.command.action
Interface Action

All Known Implementing Classes:
AbstractAction, ActionWrapper, DefaultAction

public interface Action

Interface that defines a command action in Tarsis MVC Framework.

The command action is the piece of software responsible of bussines logic. Action is executed when the command is invoked.
The interface define methods to initialize an action, validate a request, service a request and to put action out of service. These are known as life-cycle methods and are called in the following sequence:

  1. The action is instatiated and then initialized calling init method.
  2. Everytime command is invoked, if the command is validable then the validate is called to validate request and then the execute method is invoked.
  3. The action is taken out of service, then destroyed with the destroy method, then garbage collected and finalized.

Version:
$Revision: 121 $
Author:
Jose M. Palomar
See Also:
Command, View

Method Summary
 void destroy()
          Called by Tarsis MVC Framework to destroy action.
 java.lang.String execute(Request request, Response response)
          Called by Tarsis MVC Framework to handle request everytime command is invoked.
 void init(Context context)
          Called by Tarsis MVC Framework to initialize action.
 void validate(Request request)
          Called by Tarsis MVC Framework to validate request everytime command is invoked.
 

Method Detail

init

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.

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:
UnrecoverableException

validate

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.

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

execute

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

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.

destroy

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



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