org.exolab.jms.messagemgr
Class TransientMessageHandle

java.lang.Object
  |
  +--org.exolab.jms.messagemgr.TransientMessageHandle
All Implemented Interfaces:
java.io.Externalizable, MessageHandle, java.io.Serializable

public class TransientMessageHandle
extends java.lang.Object
implements MessageHandle

A message handle is used to indirectly reference a message in the message manager.

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

Constructor Summary
TransientMessageHandle()
          Default constructor required to support Serialization
 
Method Summary
 void clear()
          Clear the message handle
 void destroy()
          Destroy this handle
 boolean equals(java.lang.Object object)
           
 long getAcceptedTime()
          Return time that the corresponding message was accepted.
 long getClientId()
          Retrieve the client identity associated with this handle
 java.lang.String getConsumerName()
          Return the consumer namne
 boolean getDelivered()
          Check whether an attempt has already been made to deliver the message before.
 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 message id
 int getPriority()
          Return the priority of the underlying message
 long getSequenceNumber()
          Return message's sequence number
 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()
          Set the message, corresponding to this handle, has already been delivered once before
 void setDelivered(boolean value)
          Set the state of the delivered flag to the specified value
 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 message identity
 void setPriority(int priority)
          Set the message priority
 void setSequenceNumber(long seq)
          Set the message's sequence number
 java.lang.String toString()
          Return a stringified version of the handle
 void writeExternal(java.io.ObjectOutput stream)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransientMessageHandle

public TransientMessageHandle()
Default constructor required to support Serialization
Method Detail

getMessageId

public MessageId getMessageId()
Return the message id
Specified by:
getMessageId in interface MessageHandle
Returns:
MessgeId

setMessageId

public void setMessageId(MessageId id)
Set the message identity
Parameters:
id - - the message identity

setDelivered

public void setDelivered()
Set the message, corresponding to this handle, has already been delivered once before
Specified by:
setDelivered in interface MessageHandle

setDelivered

public void setDelivered(boolean value)
Set the state of the delivered flag to the specified value
Specified by:
setDelivered in interface MessageHandle
Parameters:
boolean - value

getDelivered

public boolean getDelivered()
Check whether an attempt has already been made to deliver the message before.
Specified by:
getDelivered in interface MessageHandle
Returns:
boolean - true implies redelivery attempted

setPriority

public void setPriority(int priority)
Set the message priority
Specified by:
setPriority in interface MessageHandle
Parameters:
int - - the message priority

getPriority

public int getPriority()
Return the priority of the underlying message
Specified by:
getPriority in interface MessageHandle
Returns:
int - message priority

setAcceptedTime

public void setAcceptedTime(long time)
Set the time that the message was accepted by the server
Specified by:
setAcceptedTime in interface MessageHandle
Parameters:
time - - accepted time

getAcceptedTime

public long getAcceptedTime()
Return time that the corresponding message was accepted.
Specified by:
getAcceptedTime in interface MessageHandle
Returns:
long - the accepted time.

setExpiryTime

public void setExpiryTime(long time)
Set the message expiry time
Specified by:
setExpiryTime in interface MessageHandle
Following copied from interface: org.exolab.jms.message.MessageHandle
Parameters:
time - - time that it was set in ms

getExpiryTime

public long getExpiryTime()
Return the message expiry time
Specified by:
getExpiryTime in interface MessageHandle
Returns:
long - time in ms since epoch

setSequenceNumber

public void setSequenceNumber(long seq)
Set the message's sequence number
Specified by:
setSequenceNumber in interface MessageHandle
Parameters:
seq - - sequence time

getSequenceNumber

public long getSequenceNumber()
Return message's sequence number
Specified by:
getSequenceNumber in interface MessageHandle
Returns:
long - the sequence number

setDestination

public void setDestination(JmsDestination destination)
Set the destination that owns this handle
Specified by:
setDestination in interface MessageHandle
Parameters:
destination - - the destination

getDestination

public JmsDestination getDestination()
Return the destination for this handle
Specified by:
getDestination in interface MessageHandle
Returns:
JmsDestination

setClientId

public void setClientId(long clientId)
Set the client id, that owns this handle
Specified by:
setClientId in interface MessageHandle
Parameters:
clientId - - client identity

getClientId

public long getClientId()
Retrieve the client identity associated with this handle
Specified by:
getClientId in interface MessageHandle
Returns:
long

setConsumerName

public void setConsumerName(java.lang.String name)
Description copied from interface: MessageHandle
Set the consumer endpoint that owns this handle. If it is set then a consumer owns it exclusively, otherwise the handle may be shared across a number of consumers.
Specified by:
setConsumerName in interface MessageHandle
Following copied from interface: org.exolab.jms.message.MessageHandle
Parameters:
name - - consumer name

getConsumerName

public java.lang.String getConsumerName()
Description copied from interface: MessageHandle
Return the consumer namne
Specified by:
getConsumerName in interface MessageHandle
Following copied from interface: org.exolab.jms.message.MessageHandle
Returns:
String

getMessage

public MessageImpl getMessage()
Return the associated message or null if it is invalid
Specified by:
getMessage in interface MessageHandle
Returns:
MessageImpl

toString

public java.lang.String toString()
Return a stringified version of the handle
Overrides:
toString in class java.lang.Object
Returns:
String

clear

public void clear()
Clear the message handle
Specified by:
clear in interface MessageHandle

isPersistent

public boolean isPersistent()
Description copied from interface: MessageHandle
Check whether the the DeliveryMode of the underlying message is PERSISTENT
Specified by:
isPersistent in interface MessageHandle

destroy

public void destroy()
Destroy this handle
Specified by:
destroy in interface MessageHandle

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

writeExternal

public void writeExternal(java.io.ObjectOutput stream)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable

readExternal

public void readExternal(java.io.ObjectInput stream)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable


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