Action<BatchResult> batchAction = new BatchAction(OnException.CONTINUE, new ActionA(), new ActionB()) {
@Override
public String getServiceName() {
return DEFAULT_SERVICE_NAME;
}
@Override
public boolean isSecured() {
return false;
}
};
dispatchAsync.execute(batchAction, new AsyncCallback<BatchResult>() {
@Override
public void onFailure(Throwable caught) {
Window.alert("Error: " + caught.getMessage());
}
@Override
public void onSuccess(BatchResult result) {
Window.alert("Successfull !");
});
public class MyBatchAction extends BatchAction {
MyBatchAction() {
super(OnException.CONTINUE, new ActionA(), new ActionB());
}
@Override
public String getServiceName() {
return DEFAULT_SERVICE_NAME;
}
@Override
public boolean isSecured() {
return false;
}
}
public class MyBatchActionHandler implements ActionHandler<MyBatchAction, BatchResult> {
BatchActionHandler handler = new BatchActionHandler();
@Override
public BatchResult execute(MyBatchAction action, ExecutionContext context) throws ActionException {
return handler.execute(action, context);
}
@Override
public Class<MyBatchAction> getActionType() {
return MyBatchAction.class;
}
@Override
public void undo(MyBatchAction action, BatchResult result, ExecutionContext context) throws ActionException {
handler.undo(action, result, context);
}
}
public class ServerModule extends HandlerModule {
@Override
protected void configureHandlers() {
bindHandler(ActionA.class, ActionAHandler.class);
bindHandler(ActionB.class, ActionBHandler.class);
bindHandler(MyBatchAction.class, MyBatchActionHandler.class);
}
}
--
You received this message because you are subscribed to the Google Groups "GWTP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gwt-platform...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.