org.xwiki.gwt.user.client
Class CancelableAsyncCallback<T>

java.lang.Object
  extended by org.xwiki.gwt.user.client.CancelableAsyncCallback<T>
Type Parameters:
T - response data type
All Implemented Interfaces:
com.google.gwt.user.client.rpc.AsyncCallback<T>

public class CancelableAsyncCallback<T>
extends Object
implements com.google.gwt.user.client.rpc.AsyncCallback<T>

An AsyncCallback that can be canceled before it is called.

Version:
$Id$

Constructor Summary
CancelableAsyncCallback(com.google.gwt.user.client.rpc.AsyncCallback<T> callback)
          Wraps the given call-back and add the ability to cancel it.
 
Method Summary
 boolean isCanceled()
           
 void onFailure(Throwable caught)
          
 void onSuccess(T result)
          
 void setCanceled(boolean canceled)
          Sets the canceled state of this call-back.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CancelableAsyncCallback

public CancelableAsyncCallback(com.google.gwt.user.client.rpc.AsyncCallback<T> callback)
Wraps the given call-back and add the ability to cancel it.

Parameters:
callback - the call-back that might be canceled
Method Detail

onFailure

public void onFailure(Throwable caught)

Specified by:
onFailure in interface com.google.gwt.user.client.rpc.AsyncCallback<T>
See Also:
AsyncCallback.onFailure(Throwable)

onSuccess

public void onSuccess(T result)

Specified by:
onSuccess in interface com.google.gwt.user.client.rpc.AsyncCallback<T>
See Also:
AsyncCallback.onSuccess(Object)

isCanceled

public boolean isCanceled()
Returns:
true if this call-back is canceled, false otherwise

setCanceled

public void setCanceled(boolean canceled)
Sets the canceled state of this call-back.

Parameters:
canceled - true to cancel this call-back, false to reactivate it


Copyright © 2004-2011 XWiki. All Rights Reserved.