|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.joram.shared.messages.Message
The Message
class actually provides the transport facility
for the data exchanged during MOM operations.
A message may either carry a String, or a serializable object, or an hashtable, or bytes, even nothing. It is charaterized by properties and "header" fields.
Field Summary | |
int |
acksCounter
The number of acknowledgements a message still expects from its subscribers before having been fully consumed by them (field used by JMS proxies). |
boolean |
deletedDest
true if the message target destination is deleted. |
int |
deliveryCount
The number of delivery attempts for this message. |
boolean |
denied
true if the message has been denied at least once by a
consumer. |
int |
durableAcksCounter
The number of acknowledgements a message still expects from its durable subscribers before having been fully consumed by them (field used by JMS proxies). |
boolean |
expired
true if the message expired. |
boolean |
notWriteable
true if the message could not be written on the dest. |
long |
order
Arrival position of this message on its queue or proxy. |
boolean |
undeliverable
true if the message is considered as undeliverable. |
Constructor Summary | |
Message()
Constructs a Message instance. |
Method Summary | |
void |
clearBody()
Method clearing the message body. |
void |
clearProperties()
Empties the properties table. |
java.lang.Object |
clone()
Clones the message. |
boolean |
getBooleanProperty(java.lang.String name)
Returns a property as a boolean value. |
byte |
getByteProperty(java.lang.String name)
|
byte[] |
getBytes()
Returns the array of bytes body of the message. |
java.lang.String |
getCorrelationId()
Returns the message correlation identifier. |
java.lang.String |
getDestinationId()
Returns the message destination identifier. |
double |
getDoubleProperty(java.lang.String name)
Returns a property as a double value. |
long |
getExpiration()
Returns the message expiration time. |
float |
getFloatProperty(java.lang.String name)
Returns a property as a float value. |
java.lang.String |
getIdentifier()
Returns the message identifier. |
int |
getIntProperty(java.lang.String name)
Returns a property as a int value. |
long |
getLongProperty(java.lang.String name)
Returns a property as a long value. |
java.util.Map |
getMap()
Returns the map body of the message. |
java.lang.Object |
getObject()
Returns the object body of the message. |
java.lang.Object |
getObjectProperty(java.lang.String name)
Returns a property as an object. |
java.lang.Object |
getOptionalHeader(java.lang.String name)
Returns an optional header field value. |
boolean |
getPersistent()
Returns true if the message is persistent. |
int |
getPriority()
Returns the message priority. |
java.util.Enumeration |
getPropertyNames()
Returns an enumeration of the properties names. |
java.lang.String |
getReplyToId()
Returns the destination id the reply should be sent to. |
short |
getShortProperty(java.lang.String name)
Returns a property as a short value. |
byte[] |
getStream()
Returns the stream of bytes body of the message. |
java.lang.String |
getStringProperty(java.lang.String name)
Returns a property as a String. |
java.lang.String |
getText()
Gets the String body of the message. |
long |
getTimestamp()
Returns the message time stamp. |
int |
getType()
Returns the message type. |
boolean |
isValid()
Returns true if the message is valid. |
boolean |
propertyExists(java.lang.String name)
Returns true if a given property exists. |
boolean |
replyToQueue()
Returns true if the reply to destination is a queue. |
void |
setBooleanProperty(java.lang.String name,
boolean value)
Sets a property as a boolean value. |
void |
setByteProperty(java.lang.String name,
byte value)
Sets a property as a byte value. |
void |
setBytes(byte[] bytes)
Sets the message body as an array of bytes. |
void |
setCorrelationId(java.lang.String correlationId)
Sets the message correlation identifier. |
void |
setDestination(java.lang.String id,
boolean queue)
Sets the message destination. |
void |
setDoubleProperty(java.lang.String name,
double value)
Sets a property as a double value. |
void |
setExpiration(long expiration)
Sets the message expiration. |
void |
setFloatProperty(java.lang.String name,
float value)
Sets a property as a float value. |
void |
setIdentifier(java.lang.String id)
Sets the message identifier. |
void |
setIntProperty(java.lang.String name,
int value)
Sets a property as an int value. |
void |
setLongProperty(java.lang.String name,
long value)
Sets a property as a long value. |
void |
setMap(java.util.HashMap map)
Sets a map as the body of the message. |
void |
setObject(java.lang.Object object)
Sets an object as the body of the message. |
void |
setObjectProperty(java.lang.String name,
java.lang.Object value)
Sets a property value. |
void |
setOptionalHeader(java.lang.String name,
java.lang.Object value)
Sets an optional header field value. |
void |
setPersistent(boolean persistent)
Sets the message persistence mode. |
void |
setPriority(int priority)
Sets the message priority. |
void |
setReplyTo(java.lang.String id,
boolean queue)
Sets the destination to which a reply should be sent. |
void |
setShortProperty(java.lang.String name,
short value)
Sets a property as a short value. |
void |
setStream(byte[] bytes)
Sets the message body as a stream of bytes. |
void |
setStringProperty(java.lang.String name,
java.lang.String value)
Sets a property as a String. |
void |
setText(java.lang.String text)
Sets a String as the body of the message. |
void |
setTimestamp(long timestamp)
Sets the message time stamp. |
java.util.Hashtable |
soapCode()
Transforms this message into a table of primitive values that can be vehiculated through the SOAP protocol. |
static Message |
soapDecode(java.util.Hashtable h)
Transforms a table of primitive values into a Message
instance. |
boolean |
toQueue()
Returns true if the destination is a queue. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public long order
public int deliveryCount
public boolean denied
true
if the message has been denied at least once by a
consumer.
public boolean deletedDest
true
if the message target destination is deleted.
public boolean expired
true
if the message expired.
public boolean notWriteable
true
if the message could not be written on the dest.
public boolean undeliverable
true
if the message is considered as undeliverable.
public transient int acksCounter
public transient int durableAcksCounter
Constructor Detail |
public Message()
Message
instance.
Method Detail |
public void setIdentifier(java.lang.String id)
public void setPersistent(boolean persistent)
public void setPriority(int priority)
priority
- Priority value: 0 the lowest, 9 the highest, 4 normal.public void setExpiration(long expiration)
public void setTimestamp(long timestamp)
public void setDestination(java.lang.String id, boolean queue)
id
- The destination identifier.queue
- true
if the destination is a queue.public void setCorrelationId(java.lang.String correlationId)
public void setReplyTo(java.lang.String id, boolean queue)
id
- The destination identifier.queue
- true
if the destination is a queue.public void setOptionalHeader(java.lang.String name, java.lang.Object value)
name
- The header field name.value
- The corresponding value.public int getType()
public java.lang.String getIdentifier()
public boolean getPersistent()
true
if the message is persistent.
public int getPriority()
public long getExpiration()
public long getTimestamp()
public java.lang.String getDestinationId()
public boolean toQueue()
true
if the destination is a queue.
public java.lang.String getCorrelationId()
public java.lang.String getReplyToId()
public boolean replyToQueue()
true
if the reply to destination is a queue.
public java.lang.Object getOptionalHeader(java.lang.String name)
name
- The header field name.public void setBooleanProperty(java.lang.String name, boolean value) throws MessageROException
name
- The property name.value
- The property value.
MessageROException
- If the message properties are read-only.public void setByteProperty(java.lang.String name, byte value) throws MessageROException
name
- The property name.value
- The property value.
MessageROException
- If the message properties are read-only.public void setDoubleProperty(java.lang.String name, double value) throws MessageROException
name
- The property name.value
- The property value.
MessageROException
- If the message properties are read-only.public void setFloatProperty(java.lang.String name, float value) throws MessageROException
name
- The property name.value
- The property value.
MessageROException
- If the message properties are read-only.public void setIntProperty(java.lang.String name, int value) throws MessageROException
name
- The property name.value
- The property value.
MessageROException
- If the message properties are read-only.public void setLongProperty(java.lang.String name, long value) throws MessageROException
name
- The property name.value
- The property value.
MessageROException
- If the message properties are read-only.public void setObjectProperty(java.lang.String name, java.lang.Object value) throws MessageException
name
- The property name.value
- The property value.
MessageROException
- If the message properties are read-only.
MessageValueException
- If the value is not a Java primitive
object.
MessageException
public void setShortProperty(java.lang.String name, short value) throws MessageROException
name
- The property name.value
- The property value.
MessageROException
- If the message properties are read-only.public void setStringProperty(java.lang.String name, java.lang.String value) throws MessageROException
name
- The property name.value
- The property value.
MessageROException
- If the message properties are read-only.public boolean getBooleanProperty(java.lang.String name) throws MessageValueException
MessageValueException
- If the property type is invalid.public byte getByteProperty(java.lang.String name) throws MessageValueException
MessageValueException
- If the property type is invalid.public double getDoubleProperty(java.lang.String name) throws MessageValueException
name
- The property name.
MessageValueException
- If the property type is invalid.public float getFloatProperty(java.lang.String name) throws MessageValueException
name
- The property name.
MessageValueException
- If the property type is invalid.public int getIntProperty(java.lang.String name) throws MessageValueException
name
- The property name.
MessageValueException
- If the property type is invalid.public long getLongProperty(java.lang.String name) throws MessageValueException
name
- The property name.
MessageValueException
- If the property type is invalid.public java.lang.Object getObjectProperty(java.lang.String name)
name
- The property name.public short getShortProperty(java.lang.String name) throws MessageValueException
name
- The property name.
MessageValueException
- If the property type is invalid.public java.lang.String getStringProperty(java.lang.String name)
name
- The property name.public boolean propertyExists(java.lang.String name)
true
if a given property exists.
name
- The name of the property to check.public java.util.Enumeration getPropertyNames()
public void clearProperties()
public void setObject(java.lang.Object object) throws java.io.IOException, MessageROException
java.io.IOException
- In case of an error while setting the object.
MessageROException
- If the message body is read-only.public void setMap(java.util.HashMap map) throws java.lang.Exception
java.io.IOException
- In case of an error while setting the map.
MessageROException
- If the message body is read-only.
java.lang.Exception
public void setText(java.lang.String text) throws MessageROException
MessageROException
- If the message body is read-only.public void setStream(byte[] bytes) throws MessageROException
MessageROException
- If the message body is read-only.public void setBytes(byte[] bytes) throws MessageROException
MessageROException
- If the message body is read-only.public java.lang.Object getObject() throws java.lang.Exception
java.io.IOException
- In case of an error while getting the object.
java.lang.ClassNotFoundException
- If the object class is unknown.
java.lang.Exception
public java.util.Map getMap()
public java.lang.String getText()
public byte[] getStream()
public byte[] getBytes()
public void clearBody()
public boolean isValid()
true
if the message is valid.
public java.lang.Object clone()
public java.util.Hashtable soapCode()
public static Message soapDecode(java.util.Hashtable h)
Message
instance.
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |