com.google.gwt.user.client.rpc.impl
Class RequestCallbackAdapter<T>

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

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

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


Nested Class Summary
static class RequestCallbackAdapter.ResponseReader
          Enumeration used to read specific return types out of a SerializationStreamReader.
 
Constructor Summary
RequestCallbackAdapter(SerializationStreamFactory streamFactory, java.lang.String methodName, int requestId, AsyncCallback<T> callback, RequestCallbackAdapter.ResponseReader responseReader)
           
 
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

RequestCallbackAdapter

public RequestCallbackAdapter(SerializationStreamFactory streamFactory,
                              java.lang.String methodName,
                              int requestId,
                              AsyncCallback<T> callback,
                              RequestCallbackAdapter.ResponseReader responseReader)
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