org.codehaus.activemq.store.bdb
Class BDbMessageStore

java.lang.Object
  extended byorg.codehaus.activemq.store.bdb.BDbMessageStore
All Implemented Interfaces:
org.codehaus.activemq.store.MessageStore, org.codehaus.activemq.service.Service
Direct Known Subclasses:
BDbTopicMessageStore

public class BDbMessageStore
extends Object
implements org.codehaus.activemq.store.MessageStore

Version:
$Revision: 1.3 $

Constructor Summary
BDbMessageStore(com.sleepycat.je.Database database, com.sleepycat.je.SecondaryDatabase secondaryDatabase, com.sleepycat.je.SecondaryConfig secondaryConfig, SequenceNumberCreator sequenceNumberCreator, org.codehaus.activemq.io.WireFormat wireFormat)
           
 
Method Summary
 org.codehaus.activemq.service.MessageIdentity addMessage(org.codehaus.activemq.message.ActiveMQMessage message)
           
protected  byte[] asBytes(org.codehaus.activemq.message.ActiveMQMessage message)
           
protected  byte[] asBytes(String messageID)
           
protected  void checkClosed()
           
protected  com.sleepycat.je.DatabaseEntry createKey(String messageID)
           
protected  org.codehaus.activemq.message.ActiveMQMessage extractMessage(com.sleepycat.je.DatabaseEntry value)
           
protected  String extractString(com.sleepycat.je.DatabaseEntry entry)
           
protected  com.sleepycat.je.DatabaseEntry findSequenceNumber(String messageID)
          Iterates through from the start of the collection until the given message ID is found
 org.codehaus.activemq.service.MessageContainer getContainer()
           
 com.sleepycat.je.CursorConfig getCursorConfig()
           
protected  com.sleepycat.je.Database getDatabase()
           
 org.codehaus.activemq.message.ActiveMQMessage getMessage(org.codehaus.activemq.service.MessageIdentity identity)
           
protected  com.sleepycat.je.SecondaryDatabase getSecondaryDatabase()
           
protected  com.sleepycat.je.DatabaseEntry getSequenceNumberKey(org.codehaus.activemq.service.MessageIdentity identity)
          Returns the sequence number key for the given message identity.
 void recover(org.codehaus.activemq.service.QueueMessageContainer container)
           
 void removeAllMessages()
           
 void removeMessage(org.codehaus.activemq.service.MessageIdentity identity, org.codehaus.activemq.message.MessageAck ack)
           
 void setMessageContainer(org.codehaus.activemq.service.MessageContainer container)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BDbMessageStore

public BDbMessageStore(com.sleepycat.je.Database database,
                       com.sleepycat.je.SecondaryDatabase secondaryDatabase,
                       com.sleepycat.je.SecondaryConfig secondaryConfig,
                       SequenceNumberCreator sequenceNumberCreator,
                       org.codehaus.activemq.io.WireFormat wireFormat)
Method Detail

setMessageContainer

public void setMessageContainer(org.codehaus.activemq.service.MessageContainer container)

addMessage

public org.codehaus.activemq.service.MessageIdentity addMessage(org.codehaus.activemq.message.ActiveMQMessage message)
                                                         throws JMSException
Specified by:
addMessage in interface org.codehaus.activemq.store.MessageStore
Throws:
JMSException

getMessage

public org.codehaus.activemq.message.ActiveMQMessage getMessage(org.codehaus.activemq.service.MessageIdentity identity)
                                                         throws JMSException
Specified by:
getMessage in interface org.codehaus.activemq.store.MessageStore
Throws:
JMSException

removeMessage

public void removeMessage(org.codehaus.activemq.service.MessageIdentity identity,
                          org.codehaus.activemq.message.MessageAck ack)
                   throws JMSException
Specified by:
removeMessage in interface org.codehaus.activemq.store.MessageStore
Throws:
JMSException

recover

public void recover(org.codehaus.activemq.service.QueueMessageContainer container)
             throws JMSException
Specified by:
recover in interface org.codehaus.activemq.store.MessageStore
Throws:
JMSException

start

public void start()
           throws JMSException
Specified by:
start in interface org.codehaus.activemq.service.Service
Throws:
JMSException

stop

public void stop()
          throws JMSException
Specified by:
stop in interface org.codehaus.activemq.service.Service
Throws:
JMSException

getSecondaryDatabase

protected com.sleepycat.je.SecondaryDatabase getSecondaryDatabase()

getDatabase

protected com.sleepycat.je.Database getDatabase()

getCursorConfig

public com.sleepycat.je.CursorConfig getCursorConfig()

getContainer

public org.codehaus.activemq.service.MessageContainer getContainer()

checkClosed

protected void checkClosed()
                    throws org.codehaus.activemq.AlreadyClosedException
Throws:
org.codehaus.activemq.AlreadyClosedException

getSequenceNumberKey

protected com.sleepycat.je.DatabaseEntry getSequenceNumberKey(org.codehaus.activemq.service.MessageIdentity identity)
                                                       throws com.sleepycat.je.DatabaseException
Returns the sequence number key for the given message identity. If the sequence number is not available it will be queried (which is slow & will generate a warning as it is not recommended) and then it'll be cached inside the MessageIdentity

Parameters:
identity -
Returns:
Throws:
com.sleepycat.je.DatabaseException

createKey

protected com.sleepycat.je.DatabaseEntry createKey(String messageID)

findSequenceNumber

protected com.sleepycat.je.DatabaseEntry findSequenceNumber(String messageID)
                                                     throws com.sleepycat.je.DatabaseException
Iterates through from the start of the collection until the given message ID is found

Parameters:
messageID -
Returns:
Throws:
com.sleepycat.je.DatabaseException

extractString

protected String extractString(com.sleepycat.je.DatabaseEntry entry)

extractMessage

protected org.codehaus.activemq.message.ActiveMQMessage extractMessage(com.sleepycat.je.DatabaseEntry value)
                                                                throws IOException
Throws:
IOException

asBytes

protected byte[] asBytes(org.codehaus.activemq.message.ActiveMQMessage message)
                  throws IOException,
                         JMSException
Throws:
IOException
JMSException

asBytes

protected byte[] asBytes(String messageID)

removeAllMessages

public void removeAllMessages()
                       throws JMSException
Specified by:
removeAllMessages in interface org.codehaus.activemq.store.MessageStore
Throws:
JMSException
See Also:
MessageStore.removeAllMessages()


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