|
Joram 5.3.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.joram.shared.messages.Message
public final class Message
Implements the Message
data structure.
Field Summary | |
---|---|
static int |
ADMIN
A admin message carries a streamable object. |
byte[] |
body
Body of the message. |
static int |
BYTES
A bytes message carries an array of bytes. |
java.lang.String |
correlationId
The correlation identifier field. |
int |
deliveryCount
The number of delivery attempts for this message. |
long |
expiration
The message expiration time, by default 0 for infinite time-to-live. |
java.lang.String |
id
The message identifier. |
static org.objectweb.util.monolog.api.Logger |
logger
logger |
static int |
MAP
A map message carries an hashtable. |
static int |
OBJECT
An object message carries a serializable object. |
Properties |
optionalHeader
Table holding header fields that may be required by particular clients (such as JMS clients). |
boolean |
persistent
true if the message must be persisted. |
static int |
persistentFlag
|
int |
priority
The message priority from 0 to 9, 9 being the highest. |
Properties |
properties
The message properties table. |
static byte |
QUEUE_TYPE
|
boolean |
redelivered
true if the message has been denied at least once by a
consumer. |
static int |
redeliveredFlag
|
java.lang.String |
replyToId
The reply to destination identifier. |
byte |
replyToType
true if the "reply to" destination is a queue. |
static int |
SIMPLE
A simple message carries an empty body. |
static int |
STREAM
A stream message carries a bytes stream. |
static int |
TEXT
A text message carries a String body. |
long |
timestamp
The message time stamp. |
java.lang.String |
toId
The message destination identifier. |
static byte |
TOPIC_TYPE
|
byte |
toType
The message destination type. |
int |
type
The client message type: SIMPLE, TEXT, OBJECT, MAP, STREAM, BYTES, ADMIN. |
Constructor Summary | |
---|---|
Message()
Constructs a bright new Message . |
Method Summary | |
---|---|
java.lang.Object |
clone()
Clones the message. |
AbstractAdminMessage |
getAdminMessage()
Returns the AbstractAdminMessage body of the message. |
java.io.Serializable |
getObject()
Returns the object body of the message. |
java.lang.Object |
getOptionalHeader(java.lang.String name)
Returns an optional header field value. |
java.lang.Object |
getProperty(java.lang.String name)
Returns a property as an object. |
java.lang.String |
getText()
Returns the text body of the message. |
void |
readFrom(java.io.InputStream is)
The object implements the readFrom method to restore its contents from the input stream. |
void |
readHeaderFrom(java.io.InputStream is)
|
static java.util.Vector |
readVectorFrom(java.io.InputStream is)
this method allows to read from the input stream a vector of messages. |
void |
setAdminMessage(AbstractAdminMessage adminMsg)
Sets an AbstractAdminMessage as the body of the message. |
void |
setDestination(java.lang.String id,
byte type)
Sets the message destination. |
void |
setObject(java.io.Serializable object)
Sets an object as the body of the message. |
void |
setOptionalHeader(java.lang.String name,
java.lang.Object value)
Sets an optional header field value. |
void |
setProperty(java.lang.String name,
java.lang.Object value)
Sets a property value. |
void |
setReplyTo(java.lang.String id,
byte type)
Sets the destination to which a reply should be sent. |
void |
setText(java.lang.String text)
Sets a String as the body of the message. |
java.util.Hashtable |
soapCode()
|
static Message |
soapDecode(java.util.Hashtable h)
|
java.lang.String |
toString()
|
void |
toString(java.lang.StringBuffer strbuf)
|
void |
writeHeaderTo(java.io.OutputStream os)
|
void |
writeTo(java.io.OutputStream os)
The object implements the writeTo method to write its contents to the output stream. |
static void |
writeVectorTo(java.util.Vector messages,
java.io.OutputStream os)
this method allows to write to the output stream a vector of message. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static org.objectweb.util.monolog.api.Logger logger
public transient Properties optionalHeader
public transient byte[] body
public transient Properties properties
public transient java.lang.String id
public transient boolean persistent
true
if the message must be persisted.
public static final int SIMPLE
public static final int TEXT
public static final int OBJECT
public static final int MAP
public static final int STREAM
public static final int BYTES
public static final int ADMIN
public transient int type
public transient int priority
public transient long expiration
public transient long timestamp
public transient boolean redelivered
true
if the message has been denied at least once by a
consumer.
public static final byte TOPIC_TYPE
public static final byte QUEUE_TYPE
public transient java.lang.String toId
public transient byte toType
public transient java.lang.String replyToId
public transient byte replyToType
true
if the "reply to" destination is a queue.
public transient java.lang.String correlationId
public transient int deliveryCount
public static int redeliveredFlag
public static int persistentFlag
Constructor Detail |
---|
public Message()
Message
.
Method Detail |
---|
public java.lang.Object getOptionalHeader(java.lang.String name)
name
- The header field name.public void setOptionalHeader(java.lang.String name, java.lang.Object value)
name
- The header field name.value
- The corresponding value.public java.lang.Object getProperty(java.lang.String name)
name
- The property name.public void setProperty(java.lang.String name, java.lang.Object value)
name
- The property name.value
- The property value.
java.lang.IllegalArgumentException
- If the key name is illegal (null or empty string).public final void setDestination(java.lang.String id, byte type)
id
- The destination identifier.type
- The type of the destination.public final void setReplyTo(java.lang.String id, byte type)
id
- The destination identifier.type
- The destination type.public void setText(java.lang.String text)
public java.lang.String getText()
public void setObject(java.io.Serializable object) throws java.io.IOException
java.io.IOException
- In case of an error while setting the object.public java.io.Serializable getObject() throws java.lang.Exception
java.lang.Exception
- In case of an error while getting the object.public void setAdminMessage(AbstractAdminMessage adminMsg) throws java.io.IOException
java.io.IOException
- In case of an error while setting the object.public AbstractAdminMessage getAdminMessage()
java.io.IOException
- In case of an error while getting the object.
java.lang.ClassNotFoundException
- If the object class is unknown.public final java.lang.String toString()
toString
in class java.lang.Object
public void toString(java.lang.StringBuffer strbuf)
public java.lang.Object clone()
clone
in class java.lang.Object
public java.util.Hashtable soapCode()
public static Message soapDecode(java.util.Hashtable h)
public void writeTo(java.io.OutputStream os) throws java.io.IOException
writeTo
in interface Streamable
os
- the stream to write the object to
java.io.IOException
public void writeHeaderTo(java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public void readFrom(java.io.InputStream is) throws java.io.IOException
readFrom
in interface Streamable
is
- the stream to read data from in order to restore the object
java.io.IOException
public void readHeaderFrom(java.io.InputStream is) throws java.io.IOException
java.io.IOException
public static void writeVectorTo(java.util.Vector messages, java.io.OutputStream os) throws java.io.IOException
messages
- the vector of messagesos
- the stream to write the vector to
java.io.IOException
public static java.util.Vector readVectorFrom(java.io.InputStream is) throws java.io.IOException
is
- the stream to read data from in order to restore the vector
java.io.IOException
|
Joram 5.3.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |