net.sf.freecol.common.networking
Class NetworkReplyObject

java.lang.Object
  extended by net.sf.freecol.common.networking.NetworkReplyObject

public class NetworkReplyObject
extends java.lang.Object

Class for storing a network response. If the response has not been set when getResponse() have been called, this method will block until setResponse(java.lang.Object) has been called.


Constructor Summary
NetworkReplyObject(int networkReplyId, boolean streamed)
          The constructor.
 
Method Summary
 int getNetworkReplyId()
          Gets the unique identifier for the network message this object will store.
 java.lang.Object getResponse()
          Gets the response.
 void interrupt()
          Interrupts any thread waiting for a response.
 boolean isStreamed()
          Checks if this NetworkReplyObject expects streamed data.
 void setResponse(java.lang.Object response)
          Sets the response and continues getResponse().
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetworkReplyObject

public NetworkReplyObject(int networkReplyId,
                          boolean streamed)
The constructor.

Parameters:
networkReplyId - The unique identifier for the network message this object will store.
streamed - Should be set to true if the incoming data should be handled as stream data.
Method Detail

isStreamed

public boolean isStreamed()
Checks if this NetworkReplyObject expects streamed data.

Returns:
true if the incoming data should be handled as a stream.

setResponse

public void setResponse(java.lang.Object response)
Sets the response and continues getResponse().

Parameters:
response - The response.
See Also:
getResponse()

getNetworkReplyId

public int getNetworkReplyId()
Gets the unique identifier for the network message this object will store.

Returns:
the unique identifier.

getResponse

public java.lang.Object getResponse()
Gets the response. If the response has not been set, this method will block until setResponse(java.lang.Object) has been called.

Returns:
the response.

interrupt

public void interrupt()
Interrupts any thread waiting for a response.