|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.joram.mom.messages.Message
public final class Message
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 characterized 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). |
private java.lang.ref.SoftReference |
bodySoftRef
SoftReference to the body of the MOM message. |
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). |
private static boolean |
globalUseSoftRef
Defines if the swapping mechanism is globally activated for messages in this server. |
static org.objectweb.util.monolog.api.Logger |
logger
logger |
private Message |
msg
Reference to the MOM message. |
long |
order
Arrival position of this message on its queue or proxy. |
private static long |
serialVersionUID
define serialVersionUID for interoperability |
private boolean |
soft
true if soft reference is used for the message. |
(package private) java.lang.String |
txname
Name used to store the message |
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. |
int |
getDeliveryCount()
Returns the message delivery count. |
long |
getExpiration()
Returns the message expiration time. |
Message |
getFullMessage()
Returns the contained message with body. |
Message |
getHeaderMessage()
Returns the contained message eventually without the body. |
java.lang.String |
getId()
|
java.lang.String |
getIdentifier()
Returns the message identifier. |
int |
getPriority()
Returns the message priority. |
java.util.Map |
getProperties()
|
java.lang.String |
getText()
|
long |
getTimestamp()
Returns the message time stamp. |
java.lang.String |
getTxName()
|
int |
getType()
Returns the message type. |
void |
incDeliveryCount()
Increments the message delivery count. |
boolean |
isPersistent()
Returns true if the message is persistent. |
boolean |
isRedelivered()
|
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. |
private void |
readObject(java.io.ObjectInputStream in)
|
void |
releaseFullMessage()
Creates a soft reference instead of a hard one linking to the body of the contained message. |
void |
save()
|
void |
saveHeader()
|
void |
setCorrelationId(java.lang.String correlationId)
Sets the message correlation identifier. |
void |
setDeliveryCount(int deliveryCount)
Sets the message delivery count. |
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 |
setRedelivered()
Sets the message redelivered flag. |
void |
setTimestamp(long timestamp)
Sets the message time stamp. |
void |
setTxName(java.lang.String txname)
|
private void |
writeObject(java.io.ObjectOutputStream out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
public static org.objectweb.util.monolog.api.Logger logger
public transient long order
public transient int acksCounter
public transient int durableAcksCounter
private transient Message msg
private transient java.lang.ref.SoftReference bodySoftRef
private transient boolean soft
true
if soft reference is used for the message.
private static final boolean globalUseSoftRef
Default value is false.
Note: the message swapping can be finely configured using the
JMS_JORAM_SWAPALLOWED
property of the JMS message.
Theses properties can be fixed either from java
launching
command, or in a3servers.xml
configuration file.
transient java.lang.String txname
Constructor Detail |
---|
public Message(Message msg)
Message
instance.
Method Detail |
---|
public Message getHeaderMessage()
public Message getFullMessage()
public void releaseFullMessage()
public int getType()
getType
in interface MessageView
public java.lang.String getIdentifier()
public void setIdentifier(java.lang.String id)
public boolean isPersistent()
true
if the message is persistent.
isPersistent
in interface MessageView
public void setPersistent(boolean persistent)
public int getPriority()
getPriority
in interface MessageView
public void setPriority(int priority)
priority
- Priority value: 0 the lowest, 9 the highest, 4 normal.public long getExpiration()
getExpiration
in interface MessageView
public void setExpiration(long expiration)
expiration
- The expiration time.public long getTimestamp()
getTimestamp
in interface MessageView
public void setTimestamp(long timestamp)
public final java.lang.String getCorrelationId()
public void setCorrelationId(java.lang.String correlationId)
public int getDeliveryCount()
getDeliveryCount
in interface MessageView
public void setDeliveryCount(int deliveryCount)
public void incDeliveryCount()
public void setRedelivered()
public void setObjectProperty(java.lang.String name, java.lang.Object value) throws MessageException
name
- The property name.value
- The property value.
MessageException
- Specified by the JMS API.
java.lang.IllegalArgumentException
- If the key name is illegal (null or empty string).public boolean isValid(long currentTime)
true
if the message is valid. The message is valid if
not expired.
currentTime
- The current time to verify the expiration time.public void setTxName(java.lang.String txname)
public java.lang.String getTxName()
public static Message load(java.lang.String txname) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException
public void save()
public void saveHeader()
public void delete()
public static java.util.Vector loadAll(java.lang.String msgTxname)
public static void deleteAll(java.lang.String msgTxname)
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
java.io.IOException
public java.lang.String getId()
getId
in interface MessageView
public java.lang.String getText()
getText
in interface MessageView
public boolean isRedelivered()
isRedelivered
in interface MessageView
public java.util.Map getProperties()
getProperties
in interface MessageView
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |