|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.core.foundation.PersistentObject | +--org.exolab.jms.messagemgr.PersistentMessageHandle
A persistent message handle extends MessageHandle
and references a
persistent message. These messages can be discarded from the cache and later
faulted in through the 'resolve' method.
Constructor Summary | |
PersistentMessageHandle()
Default constructor |
|
PersistentMessageHandle(MessageImpl message)
Create a persistent handle from a message |
Method Summary | |
void |
clear()
Override the behaviour of the base class. |
java.lang.Object |
clone()
Clone the persistent message handle object |
void |
destroy()
Destroy this handle |
boolean |
equals(java.lang.Object object)
|
long |
getAcceptedTime()
Return the time that the message was accepted by the server |
long |
getClientId()
Retrieve the client identity associated with this handle |
java.lang.String |
getConsumerName()
Return the consumer namne |
boolean |
getDelivered()
Return the delivered state of the message |
JmsDestination |
getDestination()
Return the destination for this handle |
long |
getExpiryTime()
Return the message expiry time |
MessageImpl |
getMessage()
Return the associated message or null if it is invalid |
MessageId |
getMessageId()
Return the identity of the underlying message |
int |
getPriority()
Return the priority of the corresponding message |
long |
getSequenceNumber()
Return message's sequence number |
boolean |
hasExpired()
Determines if the message has expired |
int |
hashCode()
|
boolean |
isPersistent()
Check whether the the DeliveryMode of the underlying message
is PERSISTENT |
void |
readExternal(java.io.ObjectInput stream)
|
void |
setAcceptedTime(long time)
Set the time that the message was accepted by the server |
void |
setClientId(long clientId)
Set the client id, that owns this handle |
void |
setConsumerName(java.lang.String name)
Set the consumer endpoint that owns this handle. |
void |
setDelivered()
This is used to set the message as delivered. |
void |
setDelivered(boolean value)
Set the delivered flag for the underlying message. |
void |
setDestination(JmsDestination destination)
Set the destination that owns this handle |
void |
setExpiryTime(long time)
Set the message expiry time |
void |
setMessageId(MessageId id)
Set the identity of the underlying message |
void |
setPriority(int priority)
Set the messagee priority |
void |
setSequenceNumber(long seq)
Set the message's sequence number |
java.lang.String |
toString()
|
void |
writeExternal(java.io.ObjectOutput stream)
|
Methods inherited from class org.exolab.core.foundation.PersistentObject |
getId, getMinimumObjectSize, getObjectId, getObjectVersion, getVersion, setId, setMinimumObjectSize, setObjectId, setObjectVersion, setVersion |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public PersistentMessageHandle()
public PersistentMessageHandle(MessageImpl message) throws javax.jms.JMSException
message
- - persistent messagejavax.jms.JMSException
- - if the object cannot be constructedMethod Detail |
public void setMessageId(MessageId id)
id
- - the message idpublic MessageId getMessageId()
getMessageId
in interface MessageHandle
public MessageImpl getMessage()
getMessage
in interface MessageHandle
public void setPriority(int priority)
setPriority
in interface MessageHandle
id
- the persistent idpublic int getPriority()
getPriority
in interface MessageHandle
public void setDelivered(boolean value)
setDelivered
in interface MessageHandle
value
- - true if deliveredpublic boolean getDelivered()
getDelivered
in interface MessageHandle
public void setAcceptedTime(long time)
setAcceptedTime
in interface MessageHandle
long
- - time since epochpublic long getAcceptedTime()
getAcceptedTime
in interface MessageHandle
public void setSequenceNumber(long seq)
setSequenceNumber
in interface MessageHandle
seq
- - sequence timepublic long getSequenceNumber()
getSequenceNumber
in interface MessageHandle
public void setExpiryTime(long time)
setExpiryTime
in interface MessageHandle
org.exolab.jms.message.MessageHandle
time
- - time that it was set in mspublic long getExpiryTime()
getExpiryTime
in interface MessageHandle
public boolean hasExpired()
true
if the message has expired, otherwise
false
public void setConsumerName(java.lang.String name)
MessageHandle
setConsumerName
in interface MessageHandle
org.exolab.jms.message.MessageHandle
name
- - consumer namepublic java.lang.String getConsumerName()
MessageHandle
getConsumerName
in interface MessageHandle
org.exolab.jms.message.MessageHandle
public boolean isPersistent()
MessageHandle
DeliveryMode
of the underlying message
is PERSISTENTisPersistent
in interface MessageHandle
public void setDestination(JmsDestination destination)
setDestination
in interface MessageHandle
destination
- - the destinationpublic JmsDestination getDestination()
getDestination
in interface MessageHandle
public void setClientId(long clientId)
setClientId
in interface MessageHandle
clientId
- - client identitypublic long getClientId()
getClientId
in interface MessageHandle
public void clear()
clear
in interface MessageHandle
public void destroy()
destroy
in interface MessageHandle
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class org.exolab.core.foundation.PersistentObject
java.lang.CloneNotSupportedException
- public boolean equals(java.lang.Object object)
equals
in class org.exolab.core.foundation.PersistentObject
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void setDelivered()
We do not really throw an exception here....and it seems that this is a very fine grained approach to dealing with this...basically translates to a transaction for every message.
setDelivered
in interface MessageHandle
public void writeExternal(java.io.ObjectOutput stream) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
writeExternal
in class org.exolab.core.foundation.PersistentObject
public void readExternal(java.io.ObjectInput stream) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
readExternal
in class org.exolab.core.foundation.PersistentObject
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |