org.wamblee.support.persistence
Class AbstractDatabase
java.lang.Object
org.wamblee.support.persistence.AbstractDatabase
- All Implemented Interfaces:
- Database
- Direct Known Subclasses:
- DerbyDatabase, ExternalDatabase
public abstract class AbstractDatabase
- extends java.lang.Object
- implements Database
|
Method Summary |
protected void |
createDataSource()
This method must be called from the start method. |
protected abstract void |
doStart()
|
protected abstract void |
doStop()
|
int |
getActiveConnections()
Gets the number of active connections from the pool. |
protected java.lang.String |
getProperty(java.lang.String aName)
|
javax.sql.DataSource |
start()
Starts a database. |
void |
stop()
Stops a database. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractDatabase
protected AbstractDatabase()
doStart
protected abstract void doStart()
doStop
protected abstract void doStop()
createDataSource
protected final void createDataSource()
- This method must be called from the start method.
getActiveConnections
public int getActiveConnections()
- Description copied from interface:
Database
- Gets the number of active connections from the pool. This is useful for
determining resource leaks.
- Specified by:
getActiveConnections in interface Database
- Returns:
- Active connections.
start
public final javax.sql.DataSource start()
- Description copied from interface:
Database
- Starts a database. This call should not block and return as soon as the
database has been started.
- Specified by:
start in interface Database
stop
public final void stop()
- Description copied from interface:
Database
- Stops a database.
- Specified by:
stop in interface Database
getProperty
protected java.lang.String getProperty(java.lang.String aName)
Copyright © 2010. All Rights Reserved.