org.exolab.jms.messagemgr
Interface MessageCache


public interface MessageCache

MessageCache is responsible for managing a collection of messages. Messages in the cache are referenced via MessageRef instances

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

Method Summary
 void addMessage(MessageRef reference, MessageImpl message)
          Add a reference and its corresponding message to the cache
 void addMessageRef(MessageRef reference)
          Adds a message reference to the cache
 void destroy(MessageRef reference)
          Destroys the message corresponding to the reference
 MessageImpl getMessage(MessageRef reference)
          Returns the message corresponding to the specified reference
 MessageRef getMessageRef(java.lang.String messageId)
          Returns a message reference, given its identifier
 

Method Detail

addMessage

public void addMessage(MessageRef reference,
                       MessageImpl message)
Add a reference and its corresponding message to the cache
Parameters:
reference - the reference to the message
message - the message

addMessageRef

public void addMessageRef(MessageRef reference)
Adds a message reference to the cache
Parameters:
reference - the message reference to add

getMessageRef

public MessageRef getMessageRef(java.lang.String messageId)
Returns a message reference, given its identifier
Parameters:
messageId - the message identifier
Returns:
the message reference associated with messageId, or null if none exists

getMessage

public MessageImpl getMessage(MessageRef reference)
                       throws javax.jms.JMSException
Returns the message corresponding to the specified reference
Parameters:
reference - the message reference
Returns:
the associated message, or null if none exists
Throws:
javax.jms.JMSException - for any error

destroy

public void destroy(MessageRef reference)
             throws javax.jms.JMSException
Destroys the message corresponding to the reference
Throws:
javax.jms.JMSException - for any error


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