com.threerings.presents.util
Class ResultAdapter<T>

java.lang.Object
  extended by com.threerings.presents.util.ResultAdapter<T>
Type Parameters:
T - the type of result expected by the listener.
All Implemented Interfaces:
ResultListener<T>

public class ResultAdapter<T>
extends Object
implements ResultListener<T>

Adapts the response from a ResultListener to an InvocationService.ResultListener if the failure is an instance of InvocationException the message will be passed on to the result listener, otherwise they will be provided with InvocationCodes.INTERNAL_ERROR.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.samskivert.util.ResultListener
ResultListener.NOOP<T>
 
Field Summary
protected  InvocationService.ResultListener _listener
           
 
Fields inherited from interface com.samskivert.util.ResultListener
NOOP
 
Constructor Summary
ResultAdapter(InvocationService.ResultListener listener)
          Creates an adapter with the supplied listener.
 
Method Summary
 void requestCompleted(T result)
           
 void requestFailed(Exception cause)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_listener

protected InvocationService.ResultListener _listener
Constructor Detail

ResultAdapter

public ResultAdapter(InvocationService.ResultListener listener)
Creates an adapter with the supplied listener.

Method Detail

requestCompleted

public void requestCompleted(T result)
Specified by:
requestCompleted in interface ResultListener<T>

requestFailed

public void requestFailed(Exception cause)
Specified by:
requestFailed in interface ResultListener<T>