Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.activemq.store.bdb
Class BDbTopicMessageStore

    java.lang.Object
      org.codehaus.activemq.store.bdb.BDbMessageStore
          org.codehaus.activemq.store.bdb.BDbTopicMessageStore

All Implemented Interfaces:
  MessageStore, Service, TopicMessageStore

public class BDbTopicMessageStore
extends BDbMessageStore
implements TopicMessageStore

Version:
  $Revision: 1.1 $

Constructor Summary
`BDbTopicMessageStore(com.sleepycat.je.Database database, com.sleepycat.je.SecondaryDatabase secondaryDatabase, com.sleepycat.je.SecondaryConfig secondaryConfig, SequenceNumberCreator sequenceNumberCreator, WireFormat wireFormat, com.sleepycat.je.Database subscriptionDatabase)`

Method Summary
`void` | `decrementMessageCountAndMaybeDelete(MessageIdentity messageIdentity, MessageAck ack)` Decrement the reference count of this message ID and if there are no more references then delete the message from persistent store (or maybe archive it off somewhere)
`protected com.sleepycat.je.DatabaseEntry` | `doSetLastAcknowledgedMessageIdentity(Subscription subscription, MessageIdentity messageIdentity)`
`protected com.sleepycat.je.DatabaseEntry` | `getLastAcknowledgedMessageID(Subscription subscription, MessageIdentity lastDispatchedMessage)`
`MessageIdentity` | `getLastestMessageIdentity()` Returns the last message identity that was delivered on this container which can then be used as a checkpoint so that when new durable consumers start, we know where to checkpoint their subscriptions.
`SubscriberEntry` | `getSubscriberEntry(ConsumerInfo info)` Finds the subscriber entry for the given consumer info
`void` | `incrementMessageCount(MessageIdentity messageId)` Increments the reference count of the message ID as its been dispatched to another subscriber.
`void` | `recoverSubscription(Subscription subscription, MessageIdentity lastDispatchedMessage)` For the new subcription find the last acknowledged message ID and then find any new messages since then and dispatch them to the subscription.
`void` | `setLastAcknowledgedMessageIdentity(Subscription subscription, MessageIdentity messageIdentity)` Stores the last acknowledged messgeID for the given subscription so that we can recover and commence dispatching messages from the last checkpoint
`void` | `setSubscriberEntry(ConsumerInfo info, SubscriberEntry subscriberEntry)` Inserts or updates the subscriber info due to a subscription change
`void` | `stop()` Called to shutdown the service

Methods inherited from class org.codehaus.activemq.store.bdb.BDbMessageStore
`addMessage, asBytes, asBytes, checkClosed, createKey, extractMessage, extractString, findSequenceNumber, getContainer, getCursorConfig, getDatabase, getMessage, getSecondaryDatabase, getSequenceNumberKey, recover, removeMessage, setMessageContainer, start`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.codehaus.activemq.store.TopicMessageStore
`setMessageContainer`

Methods inherited from interface org.codehaus.activemq.store.MessageStore
`addMessage, getMessage, recover, removeMessage`

Methods inherited from interface org.codehaus.activemq.service.Service
`start`

Constructor Detail

### BDbTopicMessageStore

    public BDbTopicMessageStore(com.sleepycat.je.Database database,
                                com.sleepycat.je.SecondaryDatabase secondaryDatabase,
                                com.sleepycat.je.SecondaryConfig secondaryConfig,
                                SequenceNumberCreator sequenceNumberCreator,
                                WireFormat wireFormat,
                                com.sleepycat.je.Database subscriptionDatabase)

Method Detail

### incrementMessageCount

    public void incrementMessageCount(MessageIdentity messageId)

  Description copied from interface: `TopicMessageStore`
  Increments the reference count of the message ID as its been dispatched to another subscriber.

  Specified by:
    `incrementMessageCount` in interface `TopicMessageStore`
  Parameters:
    `messageId` -

### decrementMessageCountAndMaybeDelete

    public void decrementMessageCountAndMaybeDelete(MessageIdentity messageIdentity,
                                                    MessageAck ack)

  Description copied from interface: `TopicMessageStore`
  Decrement the reference count of this message ID and if there are no more references then delete the message from persistent store (or maybe archive it off somewhere)

  Specified by:
    `decrementMessageCountAndMaybeDelete` in interface `TopicMessageStore`
  Parameters:
    `messageIdentity` -
    `ack` -

### setLastAcknowledgedMessageIdentity

    public void setLastAcknowledgedMessageIdentity(Subscription subscription,
                                                   MessageIdentity messageIdentity)
                                            throws JMSException

  Description copied from interface: `TopicMessageStore`
  Stores the last acknowledged messgeID for the given subscription so that we can recover and commence dispatching messages from the last checkpoint

  Specified by:
    `setLastAcknowledgedMessageIdentity` in interface `TopicMessageStore`
  Parameters:
    `subscription` -
    `messageIdentity` -
  Throws:
    `JMSException`

### recoverSubscription

    public void recoverSubscription(Subscription subscription,
                                    MessageIdentity lastDispatchedMessage)
                             throws JMSException

  Description copied from interface: `TopicMessageStore`
  For the new subcription find the last acknowledged message ID and then find any new messages since then and dispatch them to the subscription.

  If this is a new subscription then the lastDispatchMessage should be written to the acknowledgement table to write a checkpoint so that when we recover we will start from the correct point.

  e.g. if we dispatched some messages to a new durable topic subscriber, then went down before acknowledging any messages, we need to know the correct point from which to recover from.

  Specified by:
    `recoverSubscription` in interface `TopicMessageStore`
  Parameters:
    `subscription` -
    `lastDispatchedMessage` -
  Throws:
    `JMSException`

### getLastestMessageIdentity

    public MessageIdentity getLastestMessageIdentity()
                                              throws JMSException

  Description copied from interface: `TopicMessageStore`
  Returns the last message identity that was delivered on this container which can then be used as a checkpoint so that when new durable consumers start, we know where to checkpoint their subscriptions.

  Note that this method does not need to return a valid messageID, purely the sequence number.

  Specified by:
    `getLastestMessageIdentity` in interface `TopicMessageStore`
  Returns:
    the last message identity which was persisted in the durable store or null if the store is empty.
  Throws:
    `JMSException`

### getSubscriberEntry

    public SubscriberEntry getSubscriberEntry(ConsumerInfo info)
                                       throws JMSException

  Description copied from interface: `TopicMessageStore`
  Finds the subscriber entry for the given consumer info

  Specified by:
    `getSubscriberEntry` in interface `TopicMessageStore`
  Parameters:
    `info` -
  Returns:
  Throws:
    `JMSException`

### setSubscriberEntry

    public void setSubscriberEntry(ConsumerInfo info,
                                   SubscriberEntry subscriberEntry)
                            throws JMSException

  Description copied from interface: `TopicMessageStore`
  Inserts or updates the subscriber info due to a subscription change

  Specified by:
    `setSubscriberEntry` in interface `TopicMessageStore`
  Parameters:
    `info` -
    `subscriberEntry` -
  Throws:
    `JMSException`

### stop

    public void stop()
              throws JMSException

  Description copied from interface: `Service`
  Called to shutdown the service

  Specified by:
    `stop` in interface `Service`
  Overrides:
    `stop` in class `BDbMessageStore`
  Throws:
    `JMSException`

### getLastAcknowledgedMessageID

    protected com.sleepycat.je.DatabaseEntry getLastAcknowledgedMessageID(Subscription subscription,
                                                                          MessageIdentity lastDispatchedMessage)
                                                                   throws com.sleepycat.je.DatabaseException

  Throws:
    `com.sleepycat.je.DatabaseException`

### doSetLastAcknowledgedMessageIdentity

    protected com.sleepycat.je.DatabaseEntry doSetLastAcknowledgedMessageIdentity(Subscription subscription,
                                                                                  MessageIdentity messageIdentity)
                                                                           throws com.sleepycat.je.DatabaseException

  Throws:
    `com.sleepycat.je.DatabaseException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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