org.exolab.jms.message
Interface MessageHandle

All Superinterfaces:
java.io.Externalizable, java.io.Serializable
All Known Implementing Classes:
PersistentMessageHandle, TransientMessageHandle

public interface MessageHandle
extends java.io.Externalizable

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

Version:
$Revision: 1.9 $ $Date: 2003/08/17 01:32:24 $
Author:
Jim Alateras
See Also:
MessageMgr, TransientMessageHandle, PersistentMessageHandle

Method Summary
 void clear()
          Clear the message handle
 void destroy()
          Destory this handle
 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()
          Retrieve the destination for this handle
 long getExpiryTime()
          Return time that the message expires.
 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()
          Retrieve the handle's sequence number
 boolean isPersistent()
          Check whether the the DeliveryMode of the underlying message is PERSISTENT
 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 dest)
          Set the destination for this handle
 void setExpiryTime(long time)
          Set the time that the message will expire
 void setPriority(int priority)
          Set the priority of the message handle
 void setSequenceNumber(long seq)
          Set the sequence nmber for the handle.
 
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
 

Method Detail

getMessageId

public MessageId getMessageId()
Return the message id
Returns:
MessgeId

setDelivered

public void setDelivered()
Set the message, corresponding to this handle, has already been delivered once before

setDelivered

public void setDelivered(boolean value)
Set the state of the delivered flag to the specified value
Parameters:
boolean - value

getDelivered

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

setPriority

public void setPriority(int priority)
Set the priority of the message handle
Parameters:
priority -  

getPriority

public int getPriority()
Return the priority of the underlying message

setAcceptedTime

public void setAcceptedTime(long time)
Set the time that the message was accepted by the server
Parameters:
time - - time that it was set in ms

getAcceptedTime

public long getAcceptedTime()
Return time that the corresponding message was accepted.

setExpiryTime

public void setExpiryTime(long time)
Set the time that the message will expire
Parameters:
time - - time that it was set in ms

getExpiryTime

public long getExpiryTime()
Return time that the message expires.

setSequenceNumber

public void setSequenceNumber(long seq)
Set the sequence nmber for the handle. This is set by the message manager.
Parameters:
seq - - the sequence number

getSequenceNumber

public long getSequenceNumber()
Retrieve the handle's sequence number
Returns:
long

setDestination

public void setDestination(JmsDestination dest)
Set the destination for this handle
Parameters:
dest - - the message destination

getDestination

public JmsDestination getDestination()
Retrieve the destination for this handle
Returns:
JmsDestination

setClientId

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

getClientId

public long getClientId()
Retrieve the client identity associated with this handle
Returns:
long

setConsumerName

public void setConsumerName(java.lang.String name)
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.
Parameters:
name - - consumer name

isPersistent

public boolean isPersistent()
Check whether the the DeliveryMode of the underlying message is PERSISTENT

getConsumerName

public java.lang.String getConsumerName()
Return the consumer namne
Returns:
String

getMessage

public MessageImpl getMessage()
Return the associated message or null if it is invalid
Returns:
MessageImpl

destroy

public void destroy()
Destory this handle

clear

public void clear()
Clear the message handle


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