Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.objectweb.joram.shared.messages.Message
public class Message
extends java.lang.Object
implements Cloneable, Serializable
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 |
|
boolean |
|
int |
|
boolean |
|
int |
|
boolean |
|
boolean |
|
long |
|
boolean |
|
Constructor Summary | |
|
Method Summary | |
void |
|
void |
|
Object |
|
boolean |
|
byte |
|
byte[] |
|
String |
|
String |
|
double |
|
long |
|
float |
|
String |
|
int |
|
long |
|
Map |
|
Object |
|
Object |
|
Object |
|
boolean |
|
int |
|
Enumeration |
|
String |
|
short |
|
byte[] |
|
String |
|
String |
|
long |
|
int |
|
boolean |
|
boolean |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
Hashtable |
|
static Message |
|
boolean |
|
String |
|
public 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).
public boolean deletedDest
true
if the message target destination is deleted.
public int deliveryCount
The number of delivery attempts for this message.
public boolean denied
true
if the message has been denied at least once by a consumer.
public 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).
public boolean expired
true
if the message expired.
public boolean notWriteable
true
if the message could not be written on the dest.
public long order
Arrival position of this message on its queue or proxy.
public boolean undeliverable
true
if the message is considered as undeliverable.
public void clearBody()
Method clearing the message body.
public void clearProperties()
Empties the properties table.
public Object clone()
Clones the message.
public boolean getBooleanProperty(String name) throws MessageValueException
Returns a property as a boolean value.
- Throws:
MessageValueException
- If the property type is invalid.
public byte getByteProperty(String name) throws MessageValueException
- Throws:
MessageValueException
- If the property type is invalid.
public byte[] getBytes()
Returns the array of bytes body of the message.
public String getCorrelationId()
Returns the message correlation identifier.
public String getDestinationId()
Returns the message destination identifier.
public double getDoubleProperty(String name) throws MessageValueException
Returns a property as a double value.
- Parameters:
name
- The property name.
- Throws:
MessageValueException
- If the property type is invalid.
public long getExpiration()
Returns the message expiration time.
public float getFloatProperty(String name) throws MessageValueException
Returns a property as a float value.
- Parameters:
name
- The property name.
- Throws:
MessageValueException
- If the property type is invalid.
public String getIdentifier()
Returns the message identifier.
public int getIntProperty(String name) throws MessageValueException
Returns a property as a int value.
- Parameters:
name
- The property name.
- Throws:
MessageValueException
- If the property type is invalid.
public long getLongProperty(String name) throws MessageValueException
Returns a property as a long value.
- Parameters:
name
- The property name.
- Throws:
MessageValueException
- If the property type is invalid.
public Map getMap()
Returns the map body of the message.
public Object getObject() throws Exception
Returns the object body of the message.
public Object getObjectProperty(String name)
Returns a property as an object.
- Parameters:
name
- The property name.
public Object getOptionalHeader(String name)
Returns an optional header field value.
- Parameters:
name
- The header field name.
public boolean getPersistent()
Returnstrue
if the message is persistent.
public int getPriority()
Returns the message priority.
public Enumeration getPropertyNames()
Returns an enumeration of the properties names.
public String getReplyToId()
Returns the destination id the reply should be sent to.
public short getShortProperty(String name) throws MessageValueException
Returns a property as a short value.
- Parameters:
name
- The property name.
- Throws:
MessageValueException
- If the property type is invalid.
public byte[] getStream()
Returns the stream of bytes body of the message.
public String getStringProperty(String name)
Returns a property as a String.
- Parameters:
name
- The property name.
public String getText()
Gets the String body of the message.
public long getTimestamp()
Returns the message time stamp.
public int getType()
Returns the message type.
public boolean isValid()
Returnstrue
if the message is valid.
public boolean propertyExists(String name)
Returnstrue
if a given property exists.
- Parameters:
name
- The name of the property to check.
public boolean replyToQueue()
Returnstrue
if the reply to destination is a queue.
public void setBooleanProperty(String name, boolean value) throws MessageROException
Sets a property as a boolean value.
- Parameters:
name
- The property name.value
- The property value.
- Throws:
MessageROException
- If the message properties are read-only.
public void setByteProperty(String name, byte value) throws MessageROException
Sets a property as a byte value.
- Parameters:
name
- The property name.value
- The property value.
- Throws:
MessageROException
- If the message properties are read-only.
public void setBytes(byte[] bytes) throws MessageROException
Sets the message body as an array of bytes.
- Throws:
MessageROException
- If the message body is read-only.
public void setCorrelationId(String correlationId)
Sets the message correlation identifier.
public void setDestination(String id, boolean queue)
Sets the message destination.
- Parameters:
id
- The destination identifier.queue
-true
if the destination is a queue.
public void setDoubleProperty(String name, double value) throws MessageROException
Sets a property as a double value.
- Parameters:
name
- The property name.value
- The property value.
- Throws:
MessageROException
- If the message properties are read-only.
public void setExpiration(long expiration)
Sets the message expiration.
public void setFloatProperty(String name, float value) throws MessageROException
Sets a property as a float value.
- Parameters:
name
- The property name.value
- The property value.
- Throws:
MessageROException
- If the message properties are read-only.
public void setIdentifier(String id)
Sets the message identifier.
public void setIntProperty(String name, int value) throws MessageROException
Sets a property as an int value.
- Parameters:
name
- The property name.value
- The property value.
- Throws:
MessageROException
- If the message properties are read-only.
public void setLongProperty(String name, long value) throws MessageROException
Sets a property as a long value.
- Parameters:
name
- The property name.value
- The property value.
- Throws:
MessageROException
- If the message properties are read-only.
public void setMap(HashMap map) throws Exception
Sets a map as the body of the message.
public void setObject(Object object) throws IOException, MessageROException
Sets an object as the body of the message.
- Throws:
MessageROException
- If the message body is read-only.
public void setObjectProperty(String name, Object value) throws MessageException
Sets a property value.
- Parameters:
name
- The property name.value
- The property value.
public void setOptionalHeader(String name, Object value)
Sets an optional header field value.
- Parameters:
name
- The header field name.value
- The corresponding value.
public void setPersistent(boolean persistent)
Sets the message persistence mode.
public void setPriority(int priority)
Sets the message priority.
- Parameters:
priority
- Priority value: 0 the lowest, 9 the highest, 4 normal.
public void setReplyTo(String id, boolean queue)
Sets the destination to which a reply should be sent.
- Parameters:
id
- The destination identifier.queue
-true
if the destination is a queue.
public void setShortProperty(String name, short value) throws MessageROException
Sets a property as a short value.
- Parameters:
name
- The property name.value
- The property value.
- Throws:
MessageROException
- If the message properties are read-only.
public void setStream(byte[] bytes) throws MessageROException
Sets the message body as a stream of bytes.
- Throws:
MessageROException
- If the message body is read-only.
public void setStringProperty(String name, String value) throws MessageROException
Sets a property as a String.
- Parameters:
name
- The property name.value
- The property value.
- Throws:
MessageROException
- If the message properties are read-only.
public void setText(String text) throws MessageROException
Sets a String as the body of the message.
- Throws:
MessageROException
- If the message body is read-only.
public void setTimestamp(long timestamp)
Sets the message time stamp.
public Hashtable soapCode()
Transforms this message into a table of primitive values that can be vehiculated through the SOAP protocol.
public static Message soapDecode(Hashtable h)
Transforms a table of primitive values into aMessage
instance.
public boolean toQueue()
Returnstrue
if the destination is a queue.
public String toString()