Class LocalTopic
- java.lang.Object
-
- net.timewalker.ffmq4.local.destination.AbstractLocalDestination
-
- net.timewalker.ffmq4.local.destination.LocalTopic
-
- All Implemented Interfaces:
javax.jms.Destination,javax.jms.Topic,LocalDestinationMBean,LocalTopicMBean,DestinationDescriptorMBean,Committable
public final class LocalTopic extends AbstractLocalDestination implements javax.jms.Topic, LocalTopicMBean
Implementation for a local JMS
Topic
-
-
Field Summary
-
Fields inherited from class net.timewalker.ffmq4.local.destination.AbstractLocalDestination
closed, closeLock, consumersLock, destinationDef, localConsumers, transactionLock
-
-
Constructor Summary
Constructors Constructor Description LocalTopic(TopicDefinition topicDef)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Release destination resourcesvoidcloseTransaction()Unlock the destination for transactional updatevoidcommitChanges(SynchronizationBarrier barrier)Commit all changes (make sure they are really applied) (ASYNCHRONOUS)StringgetConsumersSummary()TopicDefinitiongetDefinition()Get the queue definitionlonggetDispatchedFromTopicCount()Get the number of messages dispatched from this topic (since startup or last reset)intgetIndexedSubscriptionsCount()Get the number of indexed subscriptions on this topiclonggetSentToTopicCount()Get the number of messages sent to this topic (since startup or last reset)intgetSize()Get the destination size (number of contained messages)intgetSubscriptionsCount()Get the number of active subscriptions on this topicStringgetTopicName()protected booleanhasPendingChanges()Test if this destinations still has some uncommitted changesbooleanputLocked(AbstractMessage srcMessage, LocalSession session, MessageLockSet locks)Put a new message in the destination.voidregisterConsumer(LocalMessageConsumer consumer)Register a message consumer on this queueprotected booleanrequiresTransactionalUpdate()Test if this destination requires transactional semantics to be updatedvoidresetStats()Reset statistics on this destinationStringtoString()voidunregisterConsumer(LocalMessageConsumer consumer)Unregister a message listenervoidunsubscribe(String clientID, String subscriptionName)Unsubscribe all durable consumers for a given client ID and subscription name-
Methods inherited from class net.timewalker.ffmq4.local.destination.AbstractLocalDestination
checkNotClosed, checkTransactionLock, commitChanges, getAutoExtendAmount, getAverageCommitTime, getBlockSize, getInitialBlockCount, getJournalOutputBuffer, getMaxBlockCount, getMaxCommitTime, getMaxJournalSize, getMaxNonPersistentMessages, getMaxUncommittedStoreSize, getMaxUnflushedJournalSize, getMaxWriteBatchSize, getMinCommitTime, getName, getRegisteredConsumersCount, getStorageSyncMethod, isClosed, isConsumerRegistered, isPreAllocateFiles, isTemporary, isUseJournal, lookupConsumer, notifyCommitTime, openTransaction
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.timewalker.ffmq4.management.destination.DestinationDescriptorMBean
getAutoExtendAmount, getBlockSize, getInitialBlockCount, getJournalOutputBuffer, getMaxBlockCount, getMaxJournalSize, getMaxNonPersistentMessages, getMaxUncommittedStoreSize, getMaxUnflushedJournalSize, getMaxWriteBatchSize, getName, getStorageSyncMethod, isPreAllocateFiles, isTemporary, isUseJournal
-
Methods inherited from interface net.timewalker.ffmq4.local.destination.LocalDestinationMBean
getAverageCommitTime, getMaxCommitTime, getMinCommitTime, getRegisteredConsumersCount
-
-
-
-
Constructor Detail
-
LocalTopic
public LocalTopic(TopicDefinition topicDef)
Constructor
-
-
Method Detail
-
getDefinition
public TopicDefinition getDefinition()
Get the queue definition
-
getTopicName
public String getTopicName()
- Specified by:
getTopicNamein interfacejavax.jms.Topic
-
registerConsumer
public void registerConsumer(LocalMessageConsumer consumer)
Description copied from class:AbstractLocalDestinationRegister a message consumer on this queue- Overrides:
registerConsumerin classAbstractLocalDestination
-
unregisterConsumer
public void unregisterConsumer(LocalMessageConsumer consumer)
Description copied from class:AbstractLocalDestinationUnregister a message listener- Overrides:
unregisterConsumerin classAbstractLocalDestination
-
unsubscribe
public void unsubscribe(String clientID, String subscriptionName) throws javax.jms.JMSException
Unsubscribe all durable consumers for a given client ID and subscription name- Throws:
javax.jms.JMSException
-
putLocked
public boolean putLocked(AbstractMessage srcMessage, LocalSession session, MessageLockSet locks) throws javax.jms.JMSException
Description copied from class:AbstractLocalDestinationPut a new message in the destination. The message is locked and the lock registered in the provided lock set- Specified by:
putLockedin classAbstractLocalDestination- Returns:
- true if a commit is required to ensure data safety
- Throws:
javax.jms.JMSException
-
getSize
public int getSize()
Description copied from interface:LocalDestinationMBeanGet the destination size (number of contained messages)- Specified by:
getSizein interfaceLocalDestinationMBean
-
resetStats
public void resetStats()
Description copied from interface:LocalDestinationMBeanReset statistics on this destination- Specified by:
resetStatsin interfaceLocalDestinationMBean- Overrides:
resetStatsin classAbstractLocalDestination
-
getSentToTopicCount
public long getSentToTopicCount()
Description copied from interface:LocalTopicMBeanGet the number of messages sent to this topic (since startup or last reset)- Specified by:
getSentToTopicCountin interfaceLocalTopicMBean
-
getDispatchedFromTopicCount
public long getDispatchedFromTopicCount()
Description copied from interface:LocalTopicMBeanGet the number of messages dispatched from this topic (since startup or last reset)- Specified by:
getDispatchedFromTopicCountin interfaceLocalTopicMBean
-
getSubscriptionsCount
public int getSubscriptionsCount()
Description copied from interface:LocalTopicMBeanGet the number of active subscriptions on this topic- Specified by:
getSubscriptionsCountin interfaceLocalTopicMBean
-
getIndexedSubscriptionsCount
public int getIndexedSubscriptionsCount()
Description copied from interface:LocalTopicMBeanGet the number of indexed subscriptions on this topic- Specified by:
getIndexedSubscriptionsCountin interfaceLocalTopicMBean
-
toString
public String toString()
-
getConsumersSummary
public String getConsumersSummary()
-
requiresTransactionalUpdate
protected boolean requiresTransactionalUpdate()
Description copied from class:AbstractLocalDestinationTest if this destination requires transactional semantics to be updated- Specified by:
requiresTransactionalUpdatein classAbstractLocalDestination- Returns:
- true if a transaction is required
-
hasPendingChanges
protected boolean hasPendingChanges()
Description copied from class:AbstractLocalDestinationTest if this destinations still has some uncommitted changes- Specified by:
hasPendingChangesin classAbstractLocalDestination- Returns:
- true if this destinations still has some uncommitted changes
-
close
public final void close() throws javax.jms.JMSExceptionDescription copied from class:AbstractLocalDestinationRelease destination resources- Specified by:
closein classAbstractLocalDestination- Throws:
javax.jms.JMSException
-
commitChanges
public void commitChanges(SynchronizationBarrier barrier) throws javax.jms.JMSException
Description copied from interface:CommittableCommit all changes (make sure they are really applied) (ASYNCHRONOUS)- Specified by:
commitChangesin interfaceCommittable- Parameters:
barrier- a synchronization barrier- Throws:
javax.jms.JMSException
-
closeTransaction
public void closeTransaction()
Description copied from interface:CommittableUnlock the destination for transactional update- Specified by:
closeTransactionin interfaceCommittable- Overrides:
closeTransactionin classAbstractLocalDestination
-
-