GWTP Dispatch Server Base 0.7-redhat-1

com.gwtplatform.dispatch.server.actionhandler
Interface ActionHandler<A extends Action<R>,R extends Result>

Type Parameters:
A - The type of the action extending Action.
R - The type of the result extending Result.
All Known Implementing Classes:
AbstractActionHandler, BatchActionHandler

public interface ActionHandler<A extends Action<R>,R extends Result>

Instances of this interface will handle specific types of Action classes.

Important! Your action handlers must be thread safe since they will be bound as singletons. For details, see http://code.google.com/p/google-guice/wiki/Scopes#Scopes_and_Concurrency.

Author:
David Peterson

Method Summary
 R execute(A action, ExecutionContext context)
          Handles the specified action.
 Class<A> getActionType()
           
 void undo(A action, R result, ExecutionContext context)
          Undoes the specified action.
 

Method Detail

execute

R execute(A action,
          ExecutionContext context)
                         throws ActionException
Handles the specified action. If you want to build a compound action that can rollback automatically upon failure, call ExecutionContext.execute(Action). See here for details.

Parameters:
action - The action.
context - The ExecutionContext.
Returns:
The Result.
Throws:
ActionException - if there is a problem performing the specified action.

getActionType

Class<A> getActionType()
Returns:
The type of Action supported by this handler.

undo

void undo(A action,
          R result,
          ExecutionContext context)
          throws ActionException
Undoes the specified action. If you want to build a compound action that can rollback automatically upon failure, call ExecutionContext.undo(Action, Result). See here for details.

Parameters:
action - The action.
result - The result of the action.
context - The ExecutionContext.
Throws:
ActionException - if there is a problem performing the specified action.

GWTP Dispatch Server Base 0.7-redhat-1

Copyright © 2010-2013 JBoss by Red Hat. All Rights Reserved.