org.jdesktop.wonderland.client.comms
Class OKErrorResponseListener

java.lang.Object
  extended by org.jdesktop.wonderland.client.comms.WaitResponseListener
      extended by org.jdesktop.wonderland.client.comms.OKErrorResponseListener
All Implemented Interfaces:
ResponseListener

public abstract class OKErrorResponseListener
extends WaitResponseListener

A base class of message response listeners that handles the case of a message that is guaranteed to get an OK or an Error.

Author:
kaplanj

Constructor Summary
OKErrorResponseListener()
           
 
Method Summary
abstract  void onFailure(MessageID messageID, java.lang.String message, java.lang.Throwable cause)
          Called when a message fails
abstract  void onSuccess(MessageID messageID)
          Called when a message receives an OK response
 void responseReceived(ResponseMessage response)
          Called when the response to a message is received
 
Methods inherited from class org.jdesktop.wonderland.client.comms.WaitResponseListener
notifyResponse, waitForResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OKErrorResponseListener

public OKErrorResponseListener()
Method Detail

responseReceived

public void responseReceived(ResponseMessage response)
Called when the response to a message is received

Specified by:
responseReceived in interface ResponseListener
Overrides:
responseReceived in class WaitResponseListener
Parameters:
response - the message that was received as a response

onSuccess

public abstract void onSuccess(MessageID messageID)
Called when a message receives an OK response

Parameters:
messageID - the ID of the message that succeeded

onFailure

public abstract void onFailure(MessageID messageID,
                               java.lang.String message,
                               java.lang.Throwable cause)
Called when a message fails

Parameters:
messageID - the ID of the message that failed
message - the reason for failure or null if there is no reason
cause - the exception, or null if there is no exception


Open Wonderland - http://openwonderland.org