Package org.apache.activemq.store.jdbc
Class DataSourceServiceSupport
- java.lang.Object
-
- org.apache.activemq.util.ServiceSupport
-
- org.apache.activemq.broker.LockableServiceSupport
-
- org.apache.activemq.store.jdbc.DataSourceServiceSupport
-
- All Implemented Interfaces:
BrokerServiceAware
,Lockable
,Service
- Direct Known Subclasses:
JDBCPersistenceAdapter
,JournalPersistenceAdapterFactory
public abstract class DataSourceServiceSupport extends LockableServiceSupport
A helper class which provides a factory method to create a default {@link DataSource) if one is not provided.
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.broker.LockableServiceSupport
brokerService, clockDaemon
-
-
Constructor Summary
Constructors Constructor Description DataSourceServiceSupport()
DataSourceServiceSupport(DataSource dataSource)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeDataSource(DataSource dataSource)
static DataSource
createDataSource(String homeDir)
static DataSource
createDataSource(String homeDir, String dbName)
String
getDataDirectory()
File
getDataDirectoryFile()
DataSource
getDataSource()
void
setDataDirectory(String dataDirectory)
void
setDataDirectoryFile(File dataDirectory)
void
setDataSource(DataSource dataSource)
static void
shutdownDefaultDataSource(DataSource dataSource)
String
toString()
-
Methods inherited from class org.apache.activemq.broker.LockableServiceSupport
getBrokerService, getLocker, getLockKeepAlivePeriod, getScheduledThreadPoolExecutor, init, isStopOnError, isUseLock, keepLockAlive, postStop, preStart, setBrokerService, setLocker, setLockKeepAlivePeriod, setScheduledThreadPoolExecutor, setStopOnError, setUseLock, stopBroker
-
Methods inherited from class org.apache.activemq.util.ServiceSupport
addServiceListener, dispose, doStart, doStop, isStarted, isStopped, isStopping, removeServiceListener, start, stop
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.broker.Lockable
createDefaultLocker
-
-
-
-
Constructor Detail
-
DataSourceServiceSupport
public DataSourceServiceSupport()
-
DataSourceServiceSupport
public DataSourceServiceSupport(DataSource dataSource)
-
-
Method Detail
-
getDataDirectoryFile
public File getDataDirectoryFile()
-
setDataDirectoryFile
public void setDataDirectoryFile(File dataDirectory)
-
getDataDirectory
public String getDataDirectory()
-
setDataDirectory
public void setDataDirectory(String dataDirectory)
-
getDataSource
public DataSource getDataSource() throws IOException
- Throws:
IOException
-
closeDataSource
public void closeDataSource(DataSource dataSource)
-
setDataSource
public void setDataSource(DataSource dataSource)
-
createDataSource
public static DataSource createDataSource(String homeDir) throws IOException
- Throws:
IOException
-
createDataSource
public static DataSource createDataSource(String homeDir, String dbName) throws IOException
- Throws:
IOException
-
shutdownDefaultDataSource
public static void shutdownDefaultDataSource(DataSource dataSource)
-
-