Class JournalPersistenceAdapterFactory
- java.lang.Object
-
- org.apache.activemq.util.ServiceSupport
-
- org.apache.activemq.broker.LockableServiceSupport
-
- org.apache.activemq.store.jdbc.DataSourceServiceSupport
-
- org.apache.activemq.store.journal.JournalPersistenceAdapterFactory
-
- All Implemented Interfaces:
BrokerServiceAware,Lockable,Service,PersistenceAdapterFactory
- Direct Known Subclasses:
PersistenceAdapterFactoryBean
public class JournalPersistenceAdapterFactory extends DataSourceServiceSupport implements PersistenceAdapterFactory
Factory class that can create PersistenceAdapter objects.
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.broker.LockableServiceSupport
brokerService, clockDaemon
-
-
Constructor Summary
Constructors Constructor Description JournalPersistenceAdapterFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LockercreateDefaultLocker()Create a default lockerprotected voidcreateJournal()PersistenceAdaptercreatePersistenceAdapter()Creates a persistence Adapter that can use a given directory to store it's data.protected voiddoStart()protected voiddoStop(ServiceStopper stopper)JDBCAdaptergetAdapter()longgetCheckpointInterval()JDBCPersistenceAdaptergetJdbcAdapter()org.apache.activeio.journal.JournalgetJournal()FilegetJournalArchiveDirectory()intgetJournalLogFiles()intgetJournalLogFileSize()intgetJournalThreadPriority()StatementsgetStatements()TaskRunnerFactorygetTaskRunnerFactory()voidinit()Initialize resources before lockingbooleanisCreateTablesOnStartup()booleanisUseDedicatedTaskRunner()booleanisUseJournal()booleanisUseQuickJournal()voidsetAdapter(JDBCAdapter adapter)voidsetCheckpointInterval(long checkpointInterval)voidsetCreateTablesOnStartup(boolean createTablesOnStartup)Sets whether or not tables are created on startupvoidsetJdbcAdapter(JDBCPersistenceAdapter jdbcAdapter)voidsetJournal(org.apache.activeio.journal.Journal journal)voidsetJournalArchiveDirectory(File journalArchiveDirectory)voidsetJournalLogFiles(int journalLogFiles)Sets the number of journal log files to usevoidsetJournalLogFileSize(int journalLogFileSize)Sets the size of the journal log files When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be usedvoidsetJournalThreadPriority(int journalThreadPriority)Sets the thread priority of the journal threadvoidsetStatements(Statements statements)voidsetTaskRunnerFactory(TaskRunnerFactory taskRunnerFactory)voidsetUseDatabaseLock(boolean useDatabaseLock)Sets whether or not an exclusive database lock should be used to enable JDBC Master/Slave.voidsetUseDedicatedTaskRunner(boolean useDedicatedTaskRunner)voidsetUseJournal(boolean useJournal)Enables or disables the use of the journal.voidsetUseQuickJournal(boolean useQuickJournal)Enables or disables the use of quick journal, which keeps messages in the journal and just stores a reference to the messages in JDBC.-
Methods inherited from class org.apache.activemq.store.jdbc.DataSourceServiceSupport
closeDataSource, createDataSource, createDataSource, getDataDirectory, getDataDirectoryFile, getDataSource, setDataDirectory, setDataDirectoryFile, setDataSource, shutdownDefaultDataSource, toString
-
Methods inherited from class org.apache.activemq.broker.LockableServiceSupport
getBrokerService, getLocker, getLockKeepAlivePeriod, getScheduledThreadPoolExecutor, isStopOnError, isUseLock, keepLockAlive, postStop, preStart, setBrokerService, setLocker, setLockKeepAlivePeriod, setScheduledThreadPoolExecutor, setStopOnError, setUseLock, stopBroker
-
Methods inherited from class org.apache.activemq.util.ServiceSupport
addServiceListener, dispose, isStarted, isStopped, isStopping, removeServiceListener, start, stop
-
-
-
-
Method Detail
-
createPersistenceAdapter
public PersistenceAdapter createPersistenceAdapter() throws IOException
Description copied from interface:PersistenceAdapterFactoryCreates a persistence Adapter that can use a given directory to store it's data.- Specified by:
createPersistenceAdapterin interfacePersistenceAdapterFactory- Throws:
IOException
-
getJournalLogFiles
public int getJournalLogFiles()
-
setJournalLogFiles
public void setJournalLogFiles(int journalLogFiles)
Sets the number of journal log files to use
-
getJournalLogFileSize
public int getJournalLogFileSize()
-
setJournalLogFileSize
public void setJournalLogFileSize(int journalLogFileSize)
Sets the size of the journal log files When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
-
getJdbcAdapter
public JDBCPersistenceAdapter getJdbcAdapter()
-
setJdbcAdapter
public void setJdbcAdapter(JDBCPersistenceAdapter jdbcAdapter)
-
isUseJournal
public boolean isUseJournal()
-
getCheckpointInterval
public long getCheckpointInterval()
-
setCheckpointInterval
public void setCheckpointInterval(long checkpointInterval)
-
setUseJournal
public void setUseJournal(boolean useJournal)
Enables or disables the use of the journal. The default is to use the journal- Parameters:
useJournal-
-
isUseDedicatedTaskRunner
public boolean isUseDedicatedTaskRunner()
-
setUseDedicatedTaskRunner
public void setUseDedicatedTaskRunner(boolean useDedicatedTaskRunner)
-
getTaskRunnerFactory
public TaskRunnerFactory getTaskRunnerFactory()
-
setTaskRunnerFactory
public void setTaskRunnerFactory(TaskRunnerFactory taskRunnerFactory)
-
getJournal
public org.apache.activeio.journal.Journal getJournal() throws IOException- Throws:
IOException
-
setJournal
public void setJournal(org.apache.activeio.journal.Journal journal)
-
getJournalArchiveDirectory
public File getJournalArchiveDirectory()
-
setJournalArchiveDirectory
public void setJournalArchiveDirectory(File journalArchiveDirectory)
-
isUseQuickJournal
public boolean isUseQuickJournal()
-
setUseQuickJournal
public void setUseQuickJournal(boolean useQuickJournal)
Enables or disables the use of quick journal, which keeps messages in the journal and just stores a reference to the messages in JDBC. Defaults to false so that messages actually reside long term in the JDBC database.
-
getAdapter
public JDBCAdapter getAdapter() throws IOException
- Throws:
IOException
-
setAdapter
public void setAdapter(JDBCAdapter adapter)
-
getStatements
public Statements getStatements()
-
setStatements
public void setStatements(Statements statements)
-
setUseDatabaseLock
public void setUseDatabaseLock(boolean useDatabaseLock)
Sets whether or not an exclusive database lock should be used to enable JDBC Master/Slave. Enabled by default.
-
isCreateTablesOnStartup
public boolean isCreateTablesOnStartup()
-
setCreateTablesOnStartup
public void setCreateTablesOnStartup(boolean createTablesOnStartup)
Sets whether or not tables are created on startup
-
getJournalThreadPriority
public int getJournalThreadPriority()
-
setJournalThreadPriority
public void setJournalThreadPriority(int journalThreadPriority)
Sets the thread priority of the journal thread
-
createJournal
protected void createJournal() throws IOException- Throws:
IOException
-
createDefaultLocker
public Locker createDefaultLocker() throws IOException
Description copied from interface:LockableCreate a default locker- Specified by:
createDefaultLockerin interfaceLockable- Returns:
- default locker
- Throws:
IOException
-
init
public void init() throws ExceptionDescription copied from class:LockableServiceSupportInitialize resources before locking- Specified by:
initin classLockableServiceSupport- Throws:
Exception
-
doStop
protected void doStop(ServiceStopper stopper) throws Exception
- Specified by:
doStopin classServiceSupport- Throws:
Exception
-
doStart
protected void doStart() throws Exception- Specified by:
doStartin classServiceSupport- Throws:
Exception
-
-