|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface UnicastDispatcher
Implementations of this interface dispatch objects over the wire in a point-to-point fashion. It is important to note that implementations are expected to behave in a peer-to-peer fashion - they are at once client and server (for their siblings).
| Method Summary | |
|---|---|
void |
close()
Closes this instance - which should not be used thereafter. |
void |
dispatch(ServerAddress addr,
java.lang.String type,
java.lang.Object data)
Dispatches the given data to the node whose address is given. |
ServerAddress |
getAddress()
Returns the address of this instance. |
RespList |
send(java.util.List addresses,
java.lang.String type,
java.lang.Object data)
Sends the given data to the list of destinations specified, and returning the responses received from each destination. |
Response |
send(ServerAddress addr,
java.lang.String type,
java.lang.Object data)
Sends the given data to the node whose address is given, returning the corresponding response - received from the destination. |
void |
setBufsize(int size)
Sets this instance's "buffer size". |
void |
setSoTimeoutListener(SocketTimeoutListener listener)
Allows implementations to notify the passed in listener when a socket timeout occurs - this applies if the underlying implementation uses a server restricted to blocking IO. |
void |
start()
Starts this instance - should be called prior to using this instance. |
| Method Detail |
|---|
void dispatch(ServerAddress addr,
java.lang.String type,
java.lang.Object data)
throws java.io.IOException
addr - a ServerAddress that corresponds to the
destination node for the data passed in.type - the logical type of the data that is sent - allows the
receiver to perform logic according to the "type".data - the Object to send.
java.io.IOException
Response send(ServerAddress addr,
java.lang.String type,
java.lang.Object data)
throws java.io.IOException
addr - a ServerAddress that corresponds to the
destination node for the data passed in.type - the logical type of the data that is sent - allows the
receiver to perform logic according to the "type".data - the Object to send.
Response.
java.io.IOException
RespList send(java.util.List addresses,
java.lang.String type,
java.lang.Object data)
throws java.io.IOException
addresses - a List of ServerAddress instances.type - the logical type of the data that is sent - allows the
receiver to perform logic according to the "type".data - the Object to send.
RespList.
java.io.IOExceptionvoid start()
void close()
void setBufsize(int size)
the - size of this instance's internal buffer, in bytes.void setSoTimeoutListener(SocketTimeoutListener listener)
DatagramSocket.setSoTimeout(int),
ServerSocket.setSoTimeout(int)
ServerAddress getAddress()
throws java.lang.IllegalStateException
ServerAddress.
java.lang.IllegalStateException - if the address of this instance is not yet available.
This can be the case if the start() method has not yet been called;
therefore, always call start() before calling this method.start()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||