public abstract class AbstractDataSourceService extends AbstractService
Modifier and Type | Class and Description |
---|---|
static interface |
AbstractDataSourceService.DataSourceMap |
static class |
AbstractDataSourceService.DataSourceObjectFactory
DataSourceObjectFactory
ObjectFactory for references to DataSources bound in JNDI.
|
Modifier and Type | Field and Description |
---|---|
protected java.util.Map |
dsMap
Map of jndiNames to DataSource objects.
|
_jndi, _name, _started
Constructor and Description |
---|
AbstractDataSourceService()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
javax.sql.DataSource |
addConnectionPoolDataSource(java.lang.String jndiName,
javax.sql.ConnectionPoolDataSource cpds)
Add a JDBC2/3 compliant source of poolable connections.
|
void |
addDataSource(java.lang.String jndiName,
javax.sql.DataSource ds)
Add a DataSource implementation to JettyPlus.
|
abstract javax.sql.DataSource |
createPooledDataSource(java.lang.String jndiName,
javax.sql.ConnectionPoolDataSource cpds)
Implement this method to create your pool implementation.
|
javax.sql.DataSource |
getDataSource(java.lang.String jndiName)
Get a DataSource implementation from the list of registered DataSources.
|
protected javax.naming.Reference |
getDataSourceReference(java.lang.String jndiName,
javax.sql.DataSource ds)
Create a Reference for a DataSource.
|
void |
start()
Start the Service.
|
public javax.sql.DataSource addConnectionPoolDataSource(java.lang.String jndiName, javax.sql.ConnectionPoolDataSource cpds) throws java.lang.Exception
jndiName
- cpds
- java.lang.Exception
public abstract javax.sql.DataSource createPooledDataSource(java.lang.String jndiName, javax.sql.ConnectionPoolDataSource cpds) throws java.lang.Exception
jndiName
- cpds
- java.lang.Exception
public void addDataSource(java.lang.String jndiName, javax.sql.DataSource ds) throws java.lang.Exception
jndiName
- then name the client uses to lookup the DataSource relative to java:comp/envds
- the javax.sql.DataSource implementationjava.lang.Exception
public javax.sql.DataSource getDataSource(java.lang.String jndiName)
jndiName
- the name of the DataSource from addDataSource()public void start() throws java.lang.Exception
protected javax.naming.Reference getDataSourceReference(java.lang.String jndiName, javax.sql.DataSource ds)
jndiName
- ds
- Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.