Joram 5.0.8

org.objectweb.joram.mom.messages
Class Message

java.lang.Object
  extended by org.objectweb.joram.mom.messages.Message
All Implemented Interfaces:
java.io.Serializable

public final class Message
extends java.lang.Object
implements java.io.Serializable

The Message class actually provides the transport facility for the data exchanged during MOM operations.

A message content is always wrapped as a bytes array, it is charaterized by properties and "header" fields.

See Also:
Serialized Form

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).
 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).
 Message msg
           
 long order
          Arrival position of this message on its queue or proxy.
 
Constructor Summary
Message(Message msg)
          Constructs a Message instance.
 
Method Summary
 void delete()
           
static void deleteAll(java.lang.String msgTxname)
          Deletes all persisted objects.
 java.lang.String getCorrelationId()
          Returns the message correlation identifier.
 long getExpiration()
          Returns the message expiration time.
 java.lang.String getIdentifier()
          Returns the message identifier.
 boolean getPersistent()
          Returns true if the message is persistent.
 int getPriority()
          Returns the message priority.
 long getTimestamp()
          Returns the message time stamp.
 java.lang.String getTxName()
           
 int getType()
          Returns the message type.
 boolean isValid(long currentTime)
          Returns true if the message is valid.
static Message load(java.lang.String txname)
           
static java.util.Vector loadAll(java.lang.String msgTxname)
          Loads all persisted messages.
 void save()
           
 void setCorrelationId(java.lang.String correlationId)
          Sets the message correlation identifier.
 void setExpiration(long expiration)
          Sets the message expiration.
 void setIdentifier(java.lang.String id)
          Sets the message identifier.
 void setObjectProperty(java.lang.String name, java.lang.Object value)
          Sets a property value.
 void setPersistent(boolean persistent)
          Sets the message persistence mode.
 void setPriority(int priority)
          Sets the message priority.
 void setTimestamp(long timestamp)
          Sets the message time stamp.
 void setTxName(java.lang.String txname)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

order

public transient long order
Arrival position of this message on its queue or proxy.


acksCounter

public transient 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). Be careful, this field is not saved but set to 0 during message loading then claculated during the proxy initialisation.


durableAcksCounter

public transient 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). Be careful, this field is not saved but set to 0 during message loading then claculated during the proxy initialisation.


msg

public transient Message msg
Constructor Detail

Message

public Message(Message msg)
Constructs a Message instance.

Method Detail

setIdentifier

public void setIdentifier(java.lang.String id)
Sets the message identifier.


setPersistent

public void setPersistent(boolean persistent)
Sets the message persistence mode.


setPriority

public void setPriority(int priority)
Sets the message priority.

Parameters:
priority - Priority value: 0 the lowest, 9 the highest, 4 normal.

setExpiration

public void setExpiration(long expiration)
Sets the message expiration.

Parameters:
expiration - The expiration time.

setTimestamp

public void setTimestamp(long timestamp)
Sets the message time stamp.


setCorrelationId

public void setCorrelationId(java.lang.String correlationId)
Sets the message correlation identifier.


getType

public int getType()
Returns the message type.


getIdentifier

public java.lang.String getIdentifier()
Returns the message identifier.


getPersistent

public boolean getPersistent()
Returns true if the message is persistent.


getPriority

public int getPriority()
Returns the message priority.


getExpiration

public long getExpiration()
Returns the message expiration time.


getTimestamp

public long getTimestamp()
Returns the message time stamp.


getCorrelationId

public final java.lang.String getCorrelationId()
Returns the message correlation identifier.


setObjectProperty

public void setObjectProperty(java.lang.String name,
                              java.lang.Object value)
                       throws MessageException
Sets a property value.

Parameters:
name - The property name.
value - The property value.
Throws:
MessageROException - If the message properties are read-only.
MessageValueException - If the value is not a Java primitive object.
java.lang.IllegalArgumentException - If the key name is illegal (null or empty string).
MessageException

isValid

public boolean isValid(long currentTime)
Returns true if the message is valid.

Parameters:
currentTime - The current time to verify the expiration time.

setTxName

public void setTxName(java.lang.String txname)

getTxName

public java.lang.String getTxName()

load

public static Message load(java.lang.String txname)
                    throws java.io.IOException,
                           java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

save

public void save()

delete

public void delete()

loadAll

public static java.util.Vector loadAll(java.lang.String msgTxname)
Loads all persisted messages.


deleteAll

public static void deleteAll(java.lang.String msgTxname)
Deletes all persisted objects.


Joram 5.0.8

Copyright © 2005 Scalagent - All rights reserved