com.gwtplatform.dispatch.server
Class AbstractDispatchImpl
java.lang.Object
com.gwtplatform.dispatch.server.AbstractDispatchImpl
- All Implemented Interfaces:
- Dispatch
public abstract class AbstractDispatchImpl
- extends Object
- implements Dispatch
This is the server-side implementation of the Dispatch
service with an arbitrary action type, for which the
client-side async service is DispatchAsync
.
This class is closely related to com.gwtplatform.dispatch.server.guice.DispatchServiceImpl
.
In fact, this class wouldn't be needed, but we use it
to workaround a GWT limitation described in DispatchAsync
.
- Author:
- Christian Goudreau, David Peterson
- See Also:
DispatchAsync
,
Dispatch
,
com.gwtplatform.dispatch.server.guice.DispatchImpl
,
DispatchService
,
DispatchServiceAsync
,
com.gwtplatform.dispatch.server.guice.DispatchServiceImpl
Method Summary |
|
execute(A action)
Executes the specified action and returns the appropriate result. |
|
undo(A action,
R result)
Undoes a previously executed action. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractDispatchImpl
protected AbstractDispatchImpl(ActionHandlerValidatorRegistry actionHandlerValidatorRegistry)
execute
public <A extends Action<R>,R extends Result> R execute(A action)
throws ActionException,
ServiceException
- Description copied from interface:
Dispatch
- Executes the specified action and returns the appropriate result.
- Specified by:
execute
in interface Dispatch
- Type Parameters:
A
- The Action
type.R
- The Result
type.- Parameters:
action
- The Action
.
- Returns:
- The action's result.
- Throws:
ActionException
- if the action execution failed.
ServiceException
- if the execution failed due to a service error.
undo
public <A extends Action<R>,R extends Result> void undo(A action,
R result)
throws ActionException,
ServiceException
- Description copied from interface:
Dispatch
- Undoes a previously executed action.
- Specified by:
undo
in interface Dispatch
- Type Parameters:
A
- The Action
type.R
- The Result
type.- Parameters:
action
- The Action
to undo.result
- The result obtained when the action was previously executed.
- Throws:
ActionException
- if undoing the action failed.
ServiceException
- if the execution failed due to a service error.
Copyright © 2010-2013 JBoss by Red Hat. All Rights Reserved.