|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.exolab.jms.messagemgr.AbstractMessageHandle
Abstract implementation of the MessageHandle
interface.
Constructor Summary | |
AbstractMessageHandle(DestinationCache cache,
MessageRef reference,
MessageImpl message)
Construct a new AbstractMessageHandle . |
|
AbstractMessageHandle(java.lang.String messageId,
int priority,
long acceptedTime,
long sequenceNumber,
long expiryTime,
JmsDestination destination)
Construct a new AbstractMessageHandle . |
Method Summary | |
void |
destroy()
Destroy this handle. |
boolean |
equals(java.lang.Object object)
Indicates whether some other object is "equal to" this one. |
long |
getAcceptedTime()
Returns the time that the corresponding message was accepted, in milliseconds. |
long |
getConnectionId()
Returns the connection identity associated with this handle. |
long |
getConsumerId()
Returns the consumer identity associated with the message. |
java.lang.String |
getConsumerPersistentId()
Returns the persistent identity of the the consumer endpoint that owns this handle. |
boolean |
getDelivered()
Returns if an attempt has already been made to deliver the message. |
JmsDestination |
getDestination()
Returns the message destination. |
long |
getExpiryTime()
Returns the time that the message expires. |
MessageImpl |
getMessage()
Returns the message associated with this handle. |
java.lang.String |
getMessageId()
Returns the message identifier. |
MessageRef |
getMessageRef()
Returns the message reference. |
int |
getPriority()
Returns the priority of the message. |
long |
getSequenceNumber()
Returns the handle's sequence number. |
boolean |
hasExpired()
Determines if the message has expired. |
int |
hashCode()
Returns a hash code value for the object. |
boolean |
isPersistent()
Determines if the handle is persistent. |
void |
release()
Release the message handle back to the cache, to recover an unsent or unacknowledged message. |
protected void |
release(MessageHandle handle)
Release the message handle back to the cache, to recover an unsent or unacknowledged message. |
void |
setDelivered(boolean delivered)
Indicates if a message has been delivered to a MessageConsumer ,
but not acknowledged. |
protected void |
setDestinationCache(DestinationCache cache)
Sets the destination cache. |
protected void |
setMessageRef(MessageRef reference)
Sets the message reference. |
java.lang.String |
toString()
Return a stringified version of the handle. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.exolab.jms.messagemgr.MessageHandle |
add, update |
Constructor Detail |
public AbstractMessageHandle(DestinationCache cache, MessageRef reference, MessageImpl message) throws javax.jms.JMSException
AbstractMessageHandle
.cache
- the destination cache that owns thisreference
- the reference to the messagemessage
- the message for which the handle is createdjavax.jms.JMSException
- if the handle cannot be constructedpublic AbstractMessageHandle(java.lang.String messageId, int priority, long acceptedTime, long sequenceNumber, long expiryTime, JmsDestination destination)
AbstractMessageHandle
.messageId
- the message identifierpriority
- the message priorityacceptedTime
- the time the message was accepted by the serversequenceNumber
- the message sequence numberexpiryTime
- the time that the message will expireMethod Detail |
public java.lang.String getMessageId()
getMessageId
in interface MessageHandle
public MessageImpl getMessage() throws javax.jms.JMSException
getMessage
in interface MessageHandle
null
if the handle is no
longer validjavax.jms.JMSException
- for any errorpublic void setDelivered(boolean delivered)
MessageConsumer
,
but not acknowledged.setDelivered
in interface MessageHandle
delivered
- if true
indicates that an attempt has been
made to deliver the messagepublic boolean getDelivered()
getDelivered
in interface MessageHandle
true
if delivery has been attemptedpublic int getPriority()
getPriority
in interface MessageHandle
public long getAcceptedTime()
getAcceptedTime
in interface MessageHandle
public long getExpiryTime()
getExpiryTime
in interface MessageHandle
public boolean hasExpired()
hasExpired
in interface MessageHandle
true
if the message has expired, otherwise
false
public long getSequenceNumber()
getSequenceNumber
in interface MessageHandle
public JmsDestination getDestination()
getDestination
in interface MessageHandle
public long getConsumerId()
getConsumerId
in interface MessageHandle
-1
if the message isn't associated with a consumerpublic java.lang.String getConsumerPersistentId()
getConsumerPersistentId
in interface MessageHandle
null
public long getConnectionId()
getConnectionId
in interface MessageHandle
-1
if this isn't associated with a connectionpublic boolean isPersistent()
isPersistent
in interface MessageHandle
false
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- the reference object with which to compare.true
if object
is a MessageHandle, and
has the same #getMessageId()public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void destroy() throws javax.jms.JMSException
destroy
in interface MessageHandle
javax.jms.JMSException
- for any errorpublic void release() throws javax.jms.JMSException
release
in interface MessageHandle
javax.jms.JMSException
- for any errorpublic MessageRef getMessageRef()
getMessageRef
in interface MessageHandle
null
if none has been setprotected void setMessageRef(MessageRef reference)
reference
- the reference to the messageprotected void setDestinationCache(DestinationCache cache)
cache
- the destination cacheprotected void release(MessageHandle handle) throws javax.jms.JMSException
handle
- the handle to releasejavax.jms.JMSException
- for any error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |