org.activemq.store.jdbc
Class JDBCMessageStore

java.lang.Object
  extended by org.activemq.store.jdbc.JDBCMessageStore
All Implemented Interfaces:
Service, MessageStore
Direct Known Subclasses:
JDBCTopicMessageStore

public class JDBCMessageStore
extends Object
implements MessageStore

Version:
$Revision: 1.1 $

Field Summary
protected  JDBCAdapter adapter
           
protected  String destinationName
           
protected  JDBCPersistenceAdapter persistenceAdapter
           
protected  LongSequenceGenerator sequenceGenerator
           
protected  WireFormat wireFormat
           
 
Constructor Summary
JDBCMessageStore(JDBCPersistenceAdapter persistenceAdapter, JDBCAdapter adapter, WireFormat wireFormat, String destinationName)
           
 
Method Summary
 void addMessage(ActiveMQMessage message)
          Adds a message to the message store
 ActiveMQMessage getMessage(MessageIdentity identity)
          Looks up a message using either the String messageID or the messageNumber.
protected  long getMessageSequenceId(MessageIdentity identity)
           
 void recover(RecoveryListener listener)
          Recover any messages to be delivered.
 void removeAllMessages()
          Removes all the messages from the message store.
 void removeMessage(MessageAck ack)
          Removes a message from the message store.
 void start()
          Called to start the service
 void stop()
          Called to shutdown the service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wireFormat

protected final WireFormat wireFormat

destinationName

protected final String destinationName

sequenceGenerator

protected final LongSequenceGenerator sequenceGenerator

adapter

protected final JDBCAdapter adapter

persistenceAdapter

protected final JDBCPersistenceAdapter persistenceAdapter
Constructor Detail

JDBCMessageStore

public JDBCMessageStore(JDBCPersistenceAdapter persistenceAdapter,
                        JDBCAdapter adapter,
                        WireFormat wireFormat,
                        String destinationName)
Method Detail

addMessage

public void addMessage(ActiveMQMessage message)
                throws JMSException
Description copied from interface: MessageStore
Adds a message to the message store

Specified by:
addMessage in interface MessageStore
Throws:
JMSException

getMessage

public ActiveMQMessage getMessage(MessageIdentity identity)
                           throws JMSException
Description copied from interface: MessageStore
Looks up a message using either the String messageID or the messageNumber. Implementations are encouraged to fill in the missing key if its easy to do so.

Specified by:
getMessage in interface MessageStore
Parameters:
identity - which contains either the messageID or the messageNumber
Returns:
the message or null if it does not exist
Throws:
JMSException

getMessageSequenceId

protected long getMessageSequenceId(MessageIdentity identity)
                             throws JMSException
Parameters:
identity -
Returns:
Throws:
JMSException

removeMessage

public void removeMessage(MessageAck ack)
                   throws JMSException
Description copied from interface: MessageStore
Removes a message from the message store.

Specified by:
removeMessage in interface MessageStore
Parameters:
ack - the ack request that cause the message to be removed. It conatins the identity which contains the messageID of the message that needs to be removed.
Throws:
JMSException

recover

public void recover(RecoveryListener listener)
             throws JMSException
Description copied from interface: MessageStore
Recover any messages to be delivered.

Specified by:
recover in interface MessageStore
Throws:
JMSException

start

public void start()
           throws JMSException
Description copied from interface: Service
Called to start the service

Specified by:
start in interface Service
Throws:
JMSException

stop

public void stop()
          throws JMSException
Description copied from interface: Service
Called to shutdown the service

Specified by:
stop in interface Service
Throws:
JMSException

removeAllMessages

public void removeAllMessages()
                       throws JMSException
Description copied from interface: MessageStore
Removes all the messages from the message store.

Specified by:
removeAllMessages in interface MessageStore
Throws:
JMSException
See Also:
MessageStore.removeAllMessages()


Copyright © 2004-2009 Protique, Ltd.. All Rights Reserved.