org.exolab.jms.messagemgr
Interface MessageRef


public interface MessageRef

A MessageRef is used to indirectly reference a message by MessageHandle instances. When there are no MessageHandles referencing the message, the message can be destroyed

Version:
$Revision: 1.2 $ $Date: 2005/08/30 07:26:49 $
Author:
Tim Anderson

Method Summary
 void dereference()
          Decrement the reference.
 void destroy()
          Destroy the message, irrespective of the number of current references.
 MessageImpl getMessage()
          Returns the message associated with this reference.
 java.lang.String getMessageId()
          Returns the message identifier.
 boolean isPersistent()
          Determines if the underlying message is persistent.
 void reference()
          Increment the reference.
 

Method Detail

getMessageId

public java.lang.String getMessageId()
Returns the message identifier.
Returns:
the message identifier

getMessage

public MessageImpl getMessage()
                       throws javax.jms.JMSException
Returns the message associated with this reference.
Returns:
the associated message, or null if the reference is no longer valide
Throws:
javax.jms.JMSException - for any error

isPersistent

public boolean isPersistent()
Determines if the underlying message is persistent.
Returns:
true if the message is persistent; otherwise false

reference

public void reference()
               throws javax.jms.JMSException
Increment the reference.
Throws:
javax.jms.JMSException - if the handle has been destroyed

dereference

public void dereference()
                 throws javax.jms.JMSException
Decrement the reference. If there are no references to the message, it will be destroyed.
Throws:
javax.jms.JMSException - for any error

destroy

public void destroy()
             throws javax.jms.JMSException
Destroy the message, irrespective of the number of current references.
Throws:
javax.jms.JMSException - for any error


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