public abstract class AbstractLocalDestination extends Object implements javax.jms.Destination, LocalDestinationMBean, Committable
Base implementation for a local JMS destination
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
closed |
protected Object |
closeLock |
protected ReentrantReadWriteLock |
consumersLock |
protected AbstractDestinationDefinition |
destinationDef |
protected List<LocalMessageConsumer> |
localConsumers |
protected ReentrantLock |
transactionLock |
| Constructor and Description |
|---|
AbstractLocalDestination(AbstractDestinationDefinition destinationDef)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkNotClosed() |
protected void |
checkTransactionLock() |
abstract void |
close()
Release destination resources
|
void |
closeTransaction()
Unlock the destination for transactional update
|
void |
commitChanges()
Commit all changes (make sure they are really applied)
|
int |
getAutoExtendAmount() |
double |
getAverageCommitTime()
Get the average commit time for this queue (milliseconds)
|
int |
getBlockSize() |
int |
getInitialBlockCount() |
int |
getJournalOutputBuffer() |
int |
getMaxBlockCount() |
long |
getMaxCommitTime()
Get the maximum commit time for this queue (milliseconds)
|
long |
getMaxJournalSize() |
int |
getMaxNonPersistentMessages() |
int |
getMaxUncommittedStoreSize() |
int |
getMaxUnflushedJournalSize() |
int |
getMaxWriteBatchSize() |
long |
getMinCommitTime()
Get the minimum commit time for this queue (milliseconds)
|
String |
getName()
Get the destination name
|
int |
getRegisteredConsumersCount()
Get the number of currently registered consumers on this destination
|
int |
getStorageSyncMethod() |
protected abstract boolean |
hasPendingChanges()
Test if this destinations still has some uncommitted changes
|
boolean |
isClosed() |
protected boolean |
isConsumerRegistered(String consumerID) |
boolean |
isPreAllocateFiles() |
boolean |
isTemporary() |
boolean |
isUseJournal() |
protected LocalMessageConsumer |
lookupConsumer(String consumerID) |
protected void |
notifyCommitTime(long duration) |
void |
openTransaction()
Lock the destination for transactional update
|
abstract boolean |
putLocked(AbstractMessage message,
LocalSession session,
MessageLockSet locks)
Put a new message in the destination.
|
void |
registerConsumer(LocalMessageConsumer consumer)
Register a message consumer on this queue
|
protected abstract boolean |
requiresTransactionalUpdate()
Test if this destination requires transactional semantics to be updated
|
void |
resetStats()
Reset statistics on this destination
|
void |
unregisterConsumer(LocalMessageConsumer consumer)
Unregister a message listener
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSizecommitChangesprotected AbstractDestinationDefinition destinationDef
protected List<LocalMessageConsumer> localConsumers
protected ReentrantReadWriteLock consumersLock
protected ReentrantLock transactionLock
protected boolean closed
protected Object closeLock
public AbstractLocalDestination(AbstractDestinationDefinition destinationDef)
public final String getName()
DestinationDescriptorMBeangetName in interface DestinationDescriptorMBeangetName in interface Committablepublic void registerConsumer(LocalMessageConsumer consumer)
public void unregisterConsumer(LocalMessageConsumer consumer)
public final boolean isClosed()
protected final void checkNotClosed()
throws javax.jms.JMSException
javax.jms.JMSExceptionprotected final void checkTransactionLock()
throws javax.jms.JMSException
javax.jms.JMSExceptionpublic final int getRegisteredConsumersCount()
LocalDestinationMBeangetRegisteredConsumersCount in interface LocalDestinationMBeanpublic final boolean isTemporary()
isTemporary in interface DestinationDescriptorMBeanpublic int getStorageSyncMethod()
getStorageSyncMethod in interface DestinationDescriptorMBeanpublic final int getInitialBlockCount()
getInitialBlockCount in interface DestinationDescriptorMBeanpublic int getMaxBlockCount()
getMaxBlockCount in interface DestinationDescriptorMBeanpublic boolean isUseJournal()
isUseJournal in interface DestinationDescriptorMBeanpublic final int getBlockSize()
getBlockSize in interface DestinationDescriptorMBeanpublic final int getMaxNonPersistentMessages()
getMaxNonPersistentMessages in interface DestinationDescriptorMBeanpublic int getAutoExtendAmount()
getAutoExtendAmount in interface DestinationDescriptorMBeanpublic int getJournalOutputBuffer()
getJournalOutputBuffer in interface DestinationDescriptorMBeanpublic long getMaxJournalSize()
getMaxJournalSize in interface DestinationDescriptorMBeanpublic int getMaxUnflushedJournalSize()
getMaxUnflushedJournalSize in interface DestinationDescriptorMBeanpublic int getMaxUncommittedStoreSize()
getMaxUncommittedStoreSize in interface DestinationDescriptorMBeanpublic int getMaxWriteBatchSize()
getMaxWriteBatchSize in interface DestinationDescriptorMBeanpublic boolean isPreAllocateFiles()
isPreAllocateFiles in interface DestinationDescriptorMBeanprotected final LocalMessageConsumer lookupConsumer(String consumerID)
protected final boolean isConsumerRegistered(String consumerID)
public final long getMinCommitTime()
LocalDestinationMBeangetMinCommitTime in interface LocalDestinationMBeanpublic final long getMaxCommitTime()
LocalDestinationMBeangetMaxCommitTime in interface LocalDestinationMBeanpublic final double getAverageCommitTime()
LocalDestinationMBeangetAverageCommitTime in interface LocalDestinationMBeanprotected final void notifyCommitTime(long duration)
public void resetStats()
LocalDestinationMBeanresetStats in interface LocalDestinationMBeanpublic abstract void close()
throws javax.jms.JMSException
javax.jms.JMSExceptionprotected abstract boolean requiresTransactionalUpdate()
protected abstract boolean hasPendingChanges()
public final void openTransaction()
CommittableopenTransaction in interface Committablepublic void closeTransaction()
CommittablecloseTransaction in interface Committablepublic void commitChanges()
throws javax.jms.JMSException
CommittablecommitChanges in interface Committablejavax.jms.JMSExceptionpublic abstract boolean putLocked(AbstractMessage message, LocalSession session, MessageLockSet locks) throws javax.jms.JMSException
javax.jms.JMSExceptionCopyright © 2019. All rights reserved.