public class TucsonProtocolTCP extends AbstractTucsonProtocol
NODE_ACTIVE_QUERY
Constructor and Description |
---|
TucsonProtocolTCP(int port)
This constructor is typically used node side: it builds a new access
point to which an external agent can engage a new dialog.
|
TucsonProtocolTCP(java.lang.String host,
int port)
This constructor create a new dialog whit a specific host that identified
by host/port pair.
|
Modifier and Type | Method and Description |
---|---|
AbstractTucsonProtocol |
acceptNewDialog() |
void |
end() |
protected void |
flush() |
protected boolean |
receiveBoolean() |
InspectorContextEvent |
receiveInspectorEvent() |
NewInspectorMsg |
receiveInspectorMsg() |
protected int |
receiveInt() |
TucsonMsg |
receiveMsg() |
TucsonMsgReply |
receiveMsgReply() |
TucsonMsgRequest |
receiveMsgRequest() |
NodeMsg |
receiveNodeMsg() |
protected java.lang.Object |
receiveObject() |
protected java.lang.String |
receiveString() |
protected void |
send(boolean value) |
protected void |
send(byte[] value) |
protected void |
send(int value) |
protected void |
send(java.lang.Object value) |
protected void |
send(java.lang.String value) |
void |
sendInspectorEvent(InspectorContextEvent msg) |
void |
sendInspectorMsg(NewInspectorMsg msg) |
void |
sendMsg(TucsonMsg msg) |
void |
sendMsgReply(TucsonMsgReply reply) |
void |
sendMsgRequest(TucsonMsgRequest request) |
void |
sendNodeMsg(NodeMsg msg) |
getContextDescription, isEnterRequest, isEnterRequestAccepted, isNodeActiveQuery, receiveEnterRequest, receiveEnterRequestAnswer, receiveFirstRequest, sendEnterRequest, sendEnterRequestAccepted, sendEnterRequestRefused, sendNodeActiveReply
public TucsonProtocolTCP(int port) throws DialogInitializationException
port
- the listening port where to bindDialogInitializationException
- if something goes wrong in the udenrlying networkpublic TucsonProtocolTCP(java.lang.String host, int port) throws UnreachableNodeException, DialogInitializationException
host
- the host where to boundport
- the listening port where to boundUnreachableNodeException
- if the given host is unknown or no process is listening on
the given portDialogInitializationException
- if some network problems arisepublic AbstractTucsonProtocol acceptNewDialog() throws DialogAcceptException
acceptNewDialog
in class AbstractTucsonProtocol
DialogAcceptException
- if something goes wrong in the underlying networkpublic void end() throws DialogCloseException
end
in class AbstractTucsonProtocol
DialogCloseException
- if something goes wrong in the underlying networkpublic InspectorContextEvent receiveInspectorEvent() throws DialogReceiveException
receiveInspectorEvent
in class AbstractTucsonProtocol
DialogReceiveException
- if something goes wrong in the underlying networkpublic NewInspectorMsg receiveInspectorMsg() throws DialogReceiveException
receiveInspectorMsg
in class AbstractTucsonProtocol
DialogReceiveException
- if something goes wrong in the underlying networkpublic TucsonMsg receiveMsg() throws DialogReceiveException
receiveMsg
in class AbstractTucsonProtocol
DialogReceiveException
- if something goes wrong in the underlying networkpublic TucsonMsgReply receiveMsgReply() throws DialogReceiveException
receiveMsgReply
in class AbstractTucsonProtocol
DialogReceiveException
- if something goes wrong in the underlying networkpublic TucsonMsgRequest receiveMsgRequest() throws DialogReceiveException
receiveMsgRequest
in class AbstractTucsonProtocol
DialogReceiveException
- if something goes wrong in the underlying networkpublic NodeMsg receiveNodeMsg() throws DialogReceiveException
receiveNodeMsg
in class AbstractTucsonProtocol
DialogReceiveException
- if something goes wrong in the underlying networkpublic void sendInspectorEvent(InspectorContextEvent msg) throws DialogSendException
sendInspectorEvent
in class AbstractTucsonProtocol
msg
- the message to send over the networkDialogSendException
- if something goes wrong in the underlying networkpublic void sendInspectorMsg(NewInspectorMsg msg) throws DialogSendException
sendInspectorMsg
in class AbstractTucsonProtocol
msg
- the message to send over the networkDialogSendException
- if something goes wrong in the underlying networkpublic void sendMsg(TucsonMsg msg) throws DialogSendException
sendMsg
in class AbstractTucsonProtocol
msg
- the message to send over the networkDialogSendException
- if something goes wrong in the underlying networkpublic void sendMsgReply(TucsonMsgReply reply) throws DialogSendException
sendMsgReply
in class AbstractTucsonProtocol
reply
- the message to send over the networkDialogSendException
- if something goes wrong in the underlying networkpublic void sendMsgRequest(TucsonMsgRequest request) throws DialogSendException
sendMsgRequest
in class AbstractTucsonProtocol
request
- the message to send over the networkDialogSendException
- if something goes wrong in the underlying networkpublic void sendNodeMsg(NodeMsg msg) throws DialogSendException
sendNodeMsg
in class AbstractTucsonProtocol
msg
- the message to send over the networkDialogSendException
- if something goes wrong in the underlying networkprotected void flush() throws java.io.IOException
flush
in class AbstractTucsonProtocol
java.io.IOException
- if some network problems ariseprotected boolean receiveBoolean() throws java.io.IOException
receiveBoolean
in class AbstractTucsonProtocol
java.io.IOException
- if some network problems ariseprotected int receiveInt() throws java.io.IOException
receiveInt
in class AbstractTucsonProtocol
java.io.IOException
- if some network problems ariseprotected java.lang.Object receiveObject() throws java.lang.ClassNotFoundException, java.io.IOException
receiveObject
in class AbstractTucsonProtocol
java.lang.ClassNotFoundException
- if the received object's class cannot be foundjava.io.IOException
- if some network problems ariseprotected java.lang.String receiveString() throws java.io.IOException
receiveString
in class AbstractTucsonProtocol
java.io.IOException
- if some network problems ariseprotected void send(boolean value) throws java.io.IOException
send
in class AbstractTucsonProtocol
value
- the Jaba boolean value to sendjava.io.IOException
- if some network problems ariseprotected void send(byte[] value) throws java.io.IOException
send
in class AbstractTucsonProtocol
value
- the Java byte array to sendjava.io.IOException
- if some network problems ariseprotected void send(int value) throws java.io.IOException
send
in class AbstractTucsonProtocol
value
- the Java int value to sendjava.io.IOException
- if some network problems ariseprotected void send(java.lang.Object value) throws java.io.IOException
send
in class AbstractTucsonProtocol
value
- the Java object to sendjava.io.IOException
- if some network problems ariseprotected void send(java.lang.String value) throws java.io.IOException
send
in class AbstractTucsonProtocol
value
- the Java String to sendjava.io.IOException
- if some network problems arise