org.objectweb.jonas.dbm
Class DataBaseServiceImpl

java.lang.Object
  |
  +--org.objectweb.jonas.service.AbsServiceImpl
        |
        +--org.objectweb.jonas.dbm.DataBaseServiceImpl
All Implemented Interfaces:
DataBaseService, DataBaseServiceImplMBean, Service

public class DataBaseServiceImpl
extends AbsServiceImpl
implements DataBaseService, DataBaseServiceImplMBean

DatabaseService acts as a factory for the DataSource objects. Its goal is to create such objects and to register them in JNDI


Constructor Summary
DataBaseServiceImpl()
           
 
Method Summary
 void createDataSource(java.util.Properties dsd)
          Creates a ConnectionManager (implementation of sql.dataSource).
 void doInit(javax.naming.Context ctx)
          Initialization of the DataBase service.
 void doStart()
          Starting DataBase service Initialization of the service is already done.
 void doStop()
          Stopping DataBase service Unbind DataSources
 java.lang.Integer getCurrentNumberOfDataSource()
          MBean method:
 java.util.Properties getDataSourcePropertiesFile(java.lang.String dsFile)
          MBean method:
 java.lang.Integer getTotalCurrentNumberOfJDBCConnectionOpen()
          MBean method:
static JonasXAPoolDataSource getXAPoolDataSource(java.lang.String dsname)
          get the XAPoolDataSource matching the DataSource name
 boolean isLoadedDataSource(java.lang.String dsName)
          MBean method:
 void loadDataSource(java.util.Properties prop)
          MBean method: load new datasource with this parametters
 void traceJdbc()
          Propagation of the new configuration of the trace functionnalities in the driver
 void unbindDataSources()
          Unbind dataSource names from the Naming
 void unloadDataSource(java.lang.String dsName)
          MBean method:
 
Methods inherited from class org.objectweb.jonas.service.AbsServiceImpl
getName, init, isStarted, setName, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.jonas.service.Service
getName, init, isStarted, setName, start, stop
 

Constructor Detail

DataBaseServiceImpl

public DataBaseServiceImpl()
Method Detail

doInit

public void doInit(javax.naming.Context ctx)
            throws ServiceException
Initialization of the DataBase service. Configuration information is passed thru a Context object.
Overrides:
doInit in class AbsServiceImpl

doStart

public void doStart()
             throws ServiceException
Starting DataBase service Initialization of the service is already done.
Overrides:
doStart in class AbsServiceImpl

doStop

public void doStop()
            throws ServiceException
Stopping DataBase service Unbind DataSources
Overrides:
doStop in class AbsServiceImpl

createDataSource

public void createDataSource(java.util.Properties dsd)
                      throws java.lang.Exception
Creates a ConnectionManager (implementation of sql.dataSource).
Specified by:
createDataSource in interface DataBaseService
Parameters:
dsd - - a set of properties that describes a dataSource and the ConnectionPool

If datasource.factory is set, we create a JonasXAPoolDataSource. If not set, we create an old fashioned ConnectionManager


traceJdbc

public void traceJdbc()
Propagation of the new configuration of the trace functionnalities in the driver

unbindDataSources

public void unbindDataSources()
                       throws javax.naming.NamingException
Description copied from interface: DataBaseService
Unbind dataSource names from the Naming
Specified by:
unbindDataSources in interface DataBaseService

getXAPoolDataSource

public static JonasXAPoolDataSource getXAPoolDataSource(java.lang.String dsname)
get the XAPoolDataSource matching the DataSource name

getCurrentNumberOfDataSource

public java.lang.Integer getCurrentNumberOfDataSource()
MBean method:
Specified by:
getCurrentNumberOfDataSource in interface DataBaseServiceImplMBean
Returns:
Integer Total Number of Datasource available in JOnAS

getTotalCurrentNumberOfJDBCConnectionOpen

public java.lang.Integer getTotalCurrentNumberOfJDBCConnectionOpen()
MBean method:
Specified by:
getTotalCurrentNumberOfJDBCConnectionOpen in interface DataBaseServiceImplMBean
Returns:
Integer Total Number of JDBC connection open

isLoadedDataSource

public boolean isLoadedDataSource(java.lang.String dsName)
MBean method:
Returns:
true if the datasource is loaded

unloadDataSource

public void unloadDataSource(java.lang.String dsName)
MBean method:
Specified by:
unloadDataSource in interface DataBaseServiceImplMBean
Parameters:
fname - of the data source to unload

getDataSourcePropertiesFile

public java.util.Properties getDataSourcePropertiesFile(java.lang.String dsFile)
MBean method:
Specified by:
getDataSourcePropertiesFile in interface DataBaseServiceImplMBean
Returns:
datasource properties from a local file

loadDataSource

public void loadDataSource(java.util.Properties prop)
                    throws java.rmi.RemoteException
MBean method: load new datasource with this parametters
Specified by:
loadDataSource in interface DataBaseServiceImplMBean
Following copied from interface: org.objectweb.jonas.dbm.DataBaseServiceImplMBean
Returns:
load new datasource with this parametters