org.exolab.jms.persistence
Class PersistentMessage

java.lang.Object
  |
  +--org.exolab.core.foundation.PersistentObject
        |
        +--org.exolab.jms.persistence.PersistentMessage
All Implemented Interfaces:
java.lang.Cloneable, java.io.Externalizable, org.exolab.core.foundation.PersistentCapableIfc, java.io.Serializable

public class PersistentMessage
extends org.exolab.core.foundation.PersistentObject

A wrapper to the Message Object to assist in persistency.

Version:
$Revision: 1.9 $ $Date: 2003/08/17 01:32:25 $
Author:
Jim Mourikis
See Also:
Serialized Form

Constructor Summary
PersistentMessage()
          Default constructor.
PersistentMessage(MessageImpl message)
          Store the message to be persisted.
 
Method Summary
 java.lang.String getDestination()
          Get the message destination
 long getExpiryTime()
          Retrieve the message expiry time
 long getJMSTimeStamp()
          Get the time the message was received by the MessageMgr
 MessageImpl getMessage()
          return the held message from the persistent object.
 byte[] getMessageBlob()
          Get the message as a serialized blob.
 java.lang.String getMessageId()
          Get the message id
 java.lang.String getMessageType()
          Get the message type
 int getPriority()
          Get the message priority
 boolean getProcessed()
          Return the state of the processed flag
 void readExternal(java.io.ObjectInput stream)
           
 void setDestination(java.lang.String destination)
          Set the message destination
 void setExpiryTime(long time)
          Set the message expiry time.
 void setJMSTimeStamp(long time)
          Set the time the message was received by the MessageMgr
 void setMessage(MessageImpl message)
          Set the message held by this persistent object
 void setMessageBlob(byte[] blob)
          Set the message from a serialized blob
 void setMessageId(java.lang.String id)
          Set the message id
 void setMessageType(java.lang.String messageType)
          Set the message type
 void setPriority(int priority)
          Set the message priority
 void setProcessed(boolean value)
          Set the state of the processed flag
 void writeExternal(java.io.ObjectOutput stream)
           
 
Methods inherited from class org.exolab.core.foundation.PersistentObject
clone, equals, getId, getMinimumObjectSize, getObjectId, getObjectVersion, getVersion, setId, setMinimumObjectSize, setObjectId, setObjectVersion, setVersion
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistentMessage

public PersistentMessage()
Default constructor.
Parameters:
MessageImpl - the message to persist

PersistentMessage

public PersistentMessage(MessageImpl message)
                  throws javax.jms.JMSException
Store the message to be persisted. And extract any required column details.
Parameters:
MessageImpl - the message to persist
Method Detail

setMessage

public void setMessage(MessageImpl message)
Set the message held by this persistent object
Parameters:
message - - the message held

getMessage

public MessageImpl getMessage()
return the held message from the persistent object.
Returns:
MessageImpl the held message.

getMessageBlob

public byte[] getMessageBlob()
Get the message as a serialized blob.
Returns:
String The serialized message.

setMessageBlob

public void setMessageBlob(byte[] blob)
Set the message from a serialized blob
Parameters:
blob - The serialized message.

getDestination

public java.lang.String getDestination()
Get the message destination
Returns:
String The destination of the message

setDestination

public void setDestination(java.lang.String destination)
Set the message destination
Parameters:
destination - The destination of the message

getMessageId

public java.lang.String getMessageId()
Get the message id
Returns:
the message id

setMessageId

public void setMessageId(java.lang.String id)
Set the message id
Parameters:
id - The message id

getMessageType

public java.lang.String getMessageType()
Get the message type
Returns:
String The message type

setMessageType

public void setMessageType(java.lang.String messageType)
Set the message type
Parameters:
messageType - The message type

getPriority

public int getPriority()
Get the message priority
Returns:
int The priority

setPriority

public void setPriority(int priority)
Set the message priority
Parameters:
priority - The message priority to set

getJMSTimeStamp

public long getJMSTimeStamp()
Get the time the message was received by the MessageMgr
Returns:
long The message creation time in secs since epoc

setJMSTimeStamp

public void setJMSTimeStamp(long time)
Set the time the message was received by the MessageMgr
Parameters:
timeStamp - The message creation time in secs since epoc

getExpiryTime

public long getExpiryTime()
Retrieve the message expiry time
Returns:
long - the time that the underlying message expires

setExpiryTime

public void setExpiryTime(long time)
Set the message expiry time.
Parameters:
time - - message expiry time in milliseconds

setProcessed

public void setProcessed(boolean value)
Set the state of the processed flag
Parameters:
value - - true if message has been processed

getProcessed

public boolean getProcessed()
Return the state of the processed flag
Returns:
boolean - true if the message has been processed

writeExternal

public void writeExternal(java.io.ObjectOutput stream)
                   throws java.io.IOException
Overrides:
writeExternal in class org.exolab.core.foundation.PersistentObject

readExternal

public void readExternal(java.io.ObjectInput stream)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Overrides:
readExternal in class org.exolab.core.foundation.PersistentObject


Copyright © 1999-2004 The OpenJMS Group. All Rights Reserved.