|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectp2ps.imp.endpoint.AbstractMessageProtcol
An abstract implementation of MessageProtcolHandler. Provides default methods for packet handling.
| Constructor Summary | |
AbstractMessageProtcol()
|
|
| Method Summary | |
void |
addReceivePacket(byte[] packet)
Adds a packet to the queue of received packets |
void |
addSendData(byte[] data,
boolean block)
Adds data to the queue of application data to be sent |
abstract java.lang.Object[] |
createReceiveItems(byte[] packet)
|
abstract java.lang.Object[] |
createSendPackets(byte[] data)
|
DataMessage |
getReceiveData()
Retrieves the next data to be passed to the application |
byte[] |
getSendPacket()
Retrieves the next packet of information to be sent via the endpoint. |
boolean |
isReceiveData()
|
boolean |
isSendPacket()
|
void |
packetError(java.io.IOException except)
Called when an exception occured sending the packed |
void |
packetSent()
Called when the packet is successfully sent, advances to the next packet in the queue. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public AbstractMessageProtcol()
| Method Detail |
public abstract java.lang.Object[] createSendPackets(byte[] data)
public abstract java.lang.Object[] createReceiveItems(byte[] packet)
public void addSendData(byte[] data,
boolean block)
throws java.io.IOException
addSendData in interface MessageProtocolHandlerdata - the application data to be send by the endpoint
java.io.IOExceptionpublic byte[] getSendPacket()
getSendPacket in interface MessageProtocolHandlerpublic boolean isSendPacket()
isSendPacket in interface MessageProtocolHandlerpublic void packetSent()
packetSent in interface MessageProtocolHandlerpublic void packetError(java.io.IOException except)
packetError in interface MessageProtocolHandlerexcept - public void addReceivePacket(byte[] packet)
addReceivePacket in interface MessageProtocolHandlerpacket - the packet received by the endpointpublic DataMessage getReceiveData()
getReceiveData in interface MessageProtocolHandlerpublic boolean isReceiveData()
isReceiveData in interface MessageProtocolHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||