|
eXo Kernel :: Component :: Common Service 2.5.0-Alpha2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exoplatform.services.jdbc.impl.DataSourceProviderImpl
public class DataSourceProviderImpl
The default implementation of DataSourceProvider. It allows you
to define a data source as managed thanks to the configuration of this
component. When the data source is declared as managed, the DataSource
object will be wrap into a ManagedDataSource.
| Field Summary | |
|---|---|
protected boolean |
alwaysManaged
Indicates that all the data sources are managed |
protected boolean |
checkIfTxActive
Indicates if the data source needs to check if a tx is active to decide if the provided connection needs to be managed or not. |
protected Set<String> |
managedDS
A set of all the data sources that are managed |
protected static String |
PARAM_ALWAYS_MANAGED
The name of the parameter to know if the data sources are always managed. |
protected static String |
PARAM_CHECK_TX
The name of the parameter to know if the tx has to be checked or not. |
protected static String |
PARAM_MANAGED_DS
The name of the parameter of all the managed data sources. |
protected TransactionManager |
tm
The transaction manager |
| Constructor Summary | |
|---|---|
DataSourceProviderImpl(InitParams params)
The default constructor |
|
DataSourceProviderImpl(InitParams params,
TransactionService tService)
The default constructor |
|
| Method Summary | |
|---|---|
DataSource |
getDataSource(String dataSourceName)
Try to get the data source from a lookup, if it can't a NamingException
will be thrown |
boolean |
isManaged(String dataSourceName)
Indicates whether or not the given data source is managed |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String PARAM_CHECK_TX
protected static final String PARAM_ALWAYS_MANAGED
protected static final String PARAM_MANAGED_DS
protected final TransactionManager tm
protected boolean checkIfTxActive
protected boolean alwaysManaged
protected final Set<String> managedDS
| Constructor Detail |
|---|
public DataSourceProviderImpl(InitParams params)
public DataSourceProviderImpl(InitParams params,
TransactionService tService)
| Method Detail |
|---|
public DataSource getDataSource(String dataSourceName)
throws NamingException
DataSourceProviderNamingException
will be thrown
getDataSource in interface DataSourceProviderdataSourceName - the name of the data source to lookup
DataSource found thanks to the lookup. The original
object could be wrap to another DataSource in order to support
managed data source.
NamingExceptionDataSourceProvider.getDataSource(java.lang.String)public boolean isManaged(String dataSourceName)
DataSourceProvider
isManaged in interface DataSourceProviderdataSourceName - the data source to check
true if the data source is managed,
false otherwiseDataSourceProvider.isManaged(java.lang.String)
|
eXo Kernel :: Component :: Common Service 2.5.0-Alpha2 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||