org.apache.activemq.store
Class DefaultPersistenceAdapterFactory

java.lang.Object
  extended by org.apache.activemq.store.jdbc.DataSourceSupport
      extended by org.apache.activemq.store.DefaultPersistenceAdapterFactory
All Implemented Interfaces:
PersistenceAdapterFactory
Direct Known Subclasses:
PersistenceAdapterFactoryBean

public class DefaultPersistenceAdapterFactory
extends DataSourceSupport
implements PersistenceAdapterFactory

Factory class that can create PersistenceAdapter objects.

Version:
$Revision: 1.4 $

Constructor Summary
DefaultPersistenceAdapterFactory()
           
 
Method Summary
protected  void createJournal()
           
 PersistenceAdapter createPersistenceAdapter()
          Creates a persistence Adapter that can use a given directory to store it's data.
 JDBCAdapter getAdapter()
           
 JDBCPersistenceAdapter getJdbcAdapter()
           
 org.apache.activeio.journal.Journal getJournal()
           
 File getJournalArchiveDirectory()
           
 int getJournalLogFiles()
           
 int getJournalLogFileSize()
           
 int getJournalThreadPriority()
           
 Statements getStatements()
           
 TaskRunnerFactory getTaskRunnerFactory()
           
 boolean isCreateTablesOnStartup()
           
 boolean isUseDatabaseLock()
           
 boolean isUseJournal()
           
 boolean isUseQuickJournal()
           
 void setAdapter(JDBCAdapter adapter)
           
 void setCreateTablesOnStartup(boolean createTablesOnStartup)
          Sets whether or not tables are created on startup
 void setJdbcAdapter(JDBCPersistenceAdapter jdbcAdapter)
           
 void setJournal(org.apache.activeio.journal.Journal journal)
           
 void setJournalArchiveDirectory(File journalArchiveDirectory)
           
 void setJournalLogFiles(int journalLogFiles)
          Sets the number of journal log files to use
 void setJournalLogFileSize(int journalLogFileSize)
          Sets the size of the journal log files
 void setJournalThreadPriority(int journalThreadPriority)
          Sets the thread priority of the journal thread
 void setStatements(Statements statements)
           
 void setTaskRunnerFactory(TaskRunnerFactory taskRunnerFactory)
           
 void setUseDatabaseLock(boolean useDatabaseLock)
          Sets whether or not an exclusive database lock should be used to enable JDBC Master/Slave.
 void setUseJournal(boolean useJournal)
          Enables or disables the use of the journal.
 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.
 
Methods inherited from class org.apache.activemq.store.jdbc.DataSourceSupport
createDataSource, getDataDirectory, getDataDirectoryFile, getDataSource, setDataDirectory, setDataDirectoryFile, setDataSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPersistenceAdapterFactory

public DefaultPersistenceAdapterFactory()
Method Detail

createPersistenceAdapter

public PersistenceAdapter createPersistenceAdapter()
                                            throws IOException
Description copied from interface: PersistenceAdapterFactory
Creates a persistence Adapter that can use a given directory to store it's data.

Specified by:
createPersistenceAdapter in interface PersistenceAdapterFactory
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


getJdbcAdapter

public JDBCPersistenceAdapter getJdbcAdapter()

setJdbcAdapter

public void setJdbcAdapter(JDBCPersistenceAdapter jdbcAdapter)

isUseJournal

public boolean isUseJournal()

setUseJournal

public void setUseJournal(boolean useJournal)
Enables or disables the use of the journal. The default is to use the journal

Parameters:
useJournal -

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)

isUseDatabaseLock

public boolean isUseDatabaseLock()

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


Copyright © 2011 Apache Software Foundation. All Rights Reserved.