GWTP Dispatch Server Base 0.7-redhat-1

com.gwtplatform.dispatch.server
Interface ExecutionContext


public interface ExecutionContext

ExecutionContext instances are passed to ActionHandlers, and allows them to execute sub-actions. These actions can be automatically rolled back if any part of the action handler fails.

Author:
David Peterson

Method Summary
<A extends Action<R>,R extends Result>
R
execute(A action)
          Executes an action in the current context.
<A extends Action<R>,R extends Result>
void
undo(A action, R result)
          Undoes an action in the current context.
 

Method Detail

execute

<A extends Action<R>,R extends Result> R execute(A action)
                         throws ActionException,
                                ServiceException
Executes an action in the current context. If the surrounding execution fails, the action will be rolled back.

Type Parameters:
A - The Action type.
R - The Result type.
Parameters:
action - The Action.
Returns:
The Result.
Throws:
ActionException - if the action execution failed.
ServiceException - if the execution failed due to a service error.

undo

<A extends Action<R>,R extends Result> void undo(A action,
                                                 R result)
          throws ActionException,
                 ServiceException
Undoes an action in the current context. If the surrounding execution fails, the action will be rolled back.

Type Parameters:
A - The Action type.
R - The Result type.
Parameters:
action - The Action.
Throws:
ActionException - if the action execution failed.
ServiceException - if the execution failed due to a service error.

GWTP Dispatch Server Base 0.7-redhat-1

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