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

MessageId getMessageId()
Return the message id

Returns:
MessgeId

setDelivered

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


setDelivered

void setDelivered(boolean value)
Set the state of the delivered flag to the specified value

Parameters:
boolean - value

getDelivered

boolean getDelivered()
Check whether an attempt has already been made to deliver the message before.

Returns:
boolean - true implies redelivery attempted

setPriority

void setPriority(int priority)
Set the priority of the message handle

Parameters:
priority -

getPriority

int getPriority()
Return the priority of the underlying message


setAcceptedTime

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

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


setExpiryTime

void setExpiryTime(long time)
Set the time that the message will expire

Parameters:
time - - time that it was set in ms

getExpiryTime

long getExpiryTime()
Return time that the message expires.


setSequenceNumber

void setSequenceNumber(long seq)
Set the sequence nmber for the handle. This is set by the message manager.

Parameters:
seq - - the sequence number

getSequenceNumber

long getSequenceNumber()
Retrieve the handle's sequence number

Returns:
long

setDestination

void setDestination(JmsDestination dest)
Set the destination for this handle

Parameters:
dest - - the message destination

getDestination

JmsDestination getDestination()
Retrieve the destination for this handle

Returns:
JmsDestination

setClientId

void setClientId(long clientId)
Set the client id, that owns this handle

Parameters:
clientId - - client identity

getClientId

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

Returns:
long

setConsumerName

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

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


getConsumerName

java.lang.String getConsumerName()
Return the consumer namne

Returns:
String

getMessage

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

Returns:
MessageImpl

destroy

void destroy()
Destory this handle


clear

void clear()
Clear the message handle



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