com.google.gwt.rpc.client.impl
Class RpcCallbackAdapter<T>

java.lang.Object
  extended by com.google.gwt.rpc.client.impl.RpcCallbackAdapter<T>
Type Parameters:
T - the type parameter for the AsyncCallback
All Implemented Interfaces:
RequestCallback

public class RpcCallbackAdapter<T>
extends java.lang.Object
implements RequestCallback

Adapter from a RequestCallback interface to an AsyncCallback interface. For internal use only.


Constructor Summary
RpcCallbackAdapter(SerializationStreamFactory streamFactory, java.lang.String methodName, int requestId, AsyncCallback<T> callback)
           
 
Method Summary
 void onError(Request request, java.lang.Throwable exception)
          Called when a Request does not complete normally.
 void onResponseReceived(Request request, Response response)
          Called when a pending Request completes normally.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RpcCallbackAdapter

public RpcCallbackAdapter(SerializationStreamFactory streamFactory,
                          java.lang.String methodName,
                          int requestId,
                          AsyncCallback<T> callback)
Method Detail

onError

public void onError(Request request,
                    java.lang.Throwable exception)
Description copied from interface: RequestCallback
Called when a Request does not complete normally. A RequestTimeoutException is one example of the type of error that a request may encounter.

Specified by:
onError in interface RequestCallback
Parameters:
request - the request object which has experienced the error condition, may be null if the request was never generated
exception - the error that was encountered

onResponseReceived

public void onResponseReceived(Request request,
                               Response response)
Description copied from interface: RequestCallback
Called when a pending Request completes normally. Note this method is called even when the status code of the HTTP response is not "OK", 200.

Specified by:
onResponseReceived in interface RequestCallback
Parameters:
request - the object that generated this event
response - an instance of the Response class