|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--comm2j.Message
Message is the basic class used to send and receive message
to/from remote server.
It will be derived to manage different type of message.
Comm2J| Field Summary | |
protected java.lang.String |
className
|
protected java.lang.Object |
message
|
protected boolean |
messageHasBeenSet
|
| Constructor Summary | |
Message()
Constructor. |
|
| Method Summary | |
java.lang.Object |
getMessage()
Returns the current message |
java.lang.String |
getName()
Returns the name of the message class |
boolean |
isMessageSet()
Used to know if a message was set (by setMessage or writeMessage) |
java.lang.String |
readHeader(java.io.InputStream is)
Gets the header identifying the message type from the give InputStream |
int |
readMessage(java.io.InputStream is)
Reads a message from give InputStream. |
protected abstract void |
setInternalObject(java.lang.Object obj)
Sets the internal object. |
void |
setMessage(java.lang.Object message)
Sets the message |
java.lang.String |
toString()
Returns a string with the content of the message |
int |
writeHeader(java.io.OutputStream os)
Send an header identifying the message type throw the give OutputStream |
int |
writeMessage(java.io.OutputStream os)
Send current message throw given OutputStream |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected boolean messageHasBeenSet
protected java.lang.Object message
protected java.lang.String className
| Constructor Detail |
public Message()
| Method Detail |
public void setMessage(java.lang.Object message)
setMessage in interface MessageImessage - Message to be usedpublic java.lang.Object getMessage()
getMessage in interface MessageI
public int readMessage(java.io.InputStream is)
throws java.io.IOException
readMessage in interface MessageIis - The InputStream used to read datajava.io.IOException - if an error occours
public int writeMessage(java.io.OutputStream os)
throws java.io.IOException
writeMessage in interface MessageIos - The OutputStream used to read datajava.io.IOException - if an error occourspublic boolean isMessageSet()
isMessageSet in interface MessageI
public int writeHeader(java.io.OutputStream os)
throws java.io.IOException
writeHeader in interface MessageIos - The OutputStream used to read datajava.io.IOException - if an error occours
public java.lang.String readHeader(java.io.InputStream is)
throws java.io.IOException
readHeader in interface MessageIis - The InputStream used to read datajava.io.IOException - if an error occourspublic java.lang.String toString()
toString in interface MessageItoString in class java.lang.Objectpublic java.lang.String getName()
getName in interface MessageIprotected abstract void setInternalObject(java.lang.Object obj)
obj - Internal object to be set
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||