org.objectweb.jonas.dbm.DataBaseServiceImpl Class Reference

Inherits org.objectweb.jonas.dbm.DataBaseService, and org.objectweb.jonas.dbm.DataBaseServiceImplMBean.

Inheritance diagram for org.objectweb.jonas.dbm.DataBaseServiceImpl:

Inheritance graph
[legend]
Collaboration diagram for org.objectweb.jonas.dbm.DataBaseServiceImpl:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void doInit (Context ctx) throws ServiceException
void doStart () throws ServiceException
void doStop () throws ServiceException
void createDataSource (String datasourceName, Properties dsd) throws Exception
void unbindDataSources () throws NamingException
ConnectionManager getConnectionManager (String dsname)
List getDataSourcePropertiesFiles () throws Exception
Integer getCurrentNumberOfDataSource ()
Integer getTotalCurrentNumberOfJDBCConnectionOpen ()
boolean isLoadedDataSource (String dsName)
void unloadDataSource (String name)
Properties getDataSourcePropertiesFile (String dsFile) throws Exception
void loadDataSource (String name, Properties prop, Boolean loadFromFile) throws ServiceException
String getDatasourceName (String jndiName)

Static Public Attributes

final String JDBCResourceName = "JDBCResource"

Detailed Description

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

Author:
Philippe Durieux
Contributor(s):

00/18/04 Jun Inamori (j-office@osa.att.ne.jp) New implementation of unbindDataSources for closing correctly all connections at server shutdown.

03/01/14 Adriana Danes

Highlight Configuration properties Change createDataSource() signature : take additional argument, the datasource name Manage binded datasources (mapping of jndi name to datasource name) Use datasource name for naming MBeans (instead of jndi name) Modify MBean methods to take into account the previous points.

03/05/25 Introduce pool size configuration 04/09/20 Create JSR77 MBeans JDBCResource, JDBCDataSource JDBCDriver

Definition at line 85 of file DataBaseServiceImpl.java.


Member Function Documentation

void org.objectweb.jonas.dbm.DataBaseServiceImpl.createDataSource String  datasourceName,
Properties  dsd
throws Exception
 

Creates a ConnectionManager (implementation of sql.dataSource).

Parameters:
datasourceName - datasource name
dsd - a set of properties that describes a dataSource and the ConnectionPool

Implements org.objectweb.jonas.dbm.DataBaseService.

Definition at line 316 of file DataBaseServiceImpl.java.

References org.objectweb.jonas.dbm.JDBCResource.addJdbcDataSource(), org.objectweb.jonas.dbm.ConnectionManager.poolConfigure(), org.objectweb.jonas.dbm.JDBCDriver.setClassName(), org.objectweb.jonas.dbm.ConnectionManager.setClassName(), org.objectweb.jonas.dbm.ConnectionManager.setDataSourceDescription(), org.objectweb.jonas.dbm.ConnectionManager.setDatasourceName(), org.objectweb.jonas.dbm.ConnectionManager.setDSName(), org.objectweb.jonas.dbm.JDBCDataSource.setJdbcDriver(), org.objectweb.jonas.dbm.ConnectionManager.setMapperName(), org.objectweb.jonas.dbm.ConnectionManager.setPassword(), org.objectweb.jonas.dbm.ConnectionManager.setTransactionIsolation(), org.objectweb.jonas.dbm.ConnectionManager.setUrl(), and org.objectweb.jonas.dbm.ConnectionManager.setUserName().

Referenced by org.objectweb.jonas.dbm.DataBaseServiceImpl.doStart(), and org.objectweb.jonas.dbm.DataBaseServiceImpl.loadDataSource().

Here is the call graph for this function:

void org.objectweb.jonas.dbm.DataBaseServiceImpl.doInit Context  ctx  )  throws ServiceException
 

Initialization of the DataBase service. Configuration information is passed thru a Context object.

Definition at line 171 of file DataBaseServiceImpl.java.

void org.objectweb.jonas.dbm.DataBaseServiceImpl.doStart  )  throws ServiceException
 

Starting DataBase service Initialization of the service is already done.

Definition at line 225 of file DataBaseServiceImpl.java.

References org.objectweb.jonas.dbm.DataBaseServiceImpl.createDataSource(), org.objectweb.jonas.common.JProp.getConfigFileEnv(), and org.objectweb.jonas.dbm.DataBaseServiceImpl.JDBCResourceName.

Here is the call graph for this function:

void org.objectweb.jonas.dbm.DataBaseServiceImpl.doStop  )  throws ServiceException
 

Stopping DataBase service Unbind Datasource

Definition at line 281 of file DataBaseServiceImpl.java.

References org.objectweb.jonas.dbm.JDBCResource.JDBCResource(), org.objectweb.jonas.dbm.DataBaseServiceImpl.JDBCResourceName, and org.objectweb.jonas.dbm.DataBaseServiceImpl.unbindDataSources().

Here is the call graph for this function:

ConnectionManager org.objectweb.jonas.dbm.DataBaseServiceImpl.getConnectionManager String  dsname  ) 
 

get ConnectionManager for the datasource having this JNDI name.

Definition at line 482 of file DataBaseServiceImpl.java.

References org.objectweb.jonas.dbm.ConnectionManager.getDSName().

Here is the call graph for this function:

Integer org.objectweb.jonas.dbm.DataBaseServiceImpl.getCurrentNumberOfDataSource  ) 
 

MBean method:

Returns:
Integer Total Number of Datasource available in JOnAS

Implements org.objectweb.jonas.dbm.DataBaseServiceImplMBean.

Definition at line 509 of file DataBaseServiceImpl.java.

String org.objectweb.jonas.dbm.DataBaseServiceImpl.getDatasourceName String  jndiName  ) 
 

MBean method allowing to determine the datasource name from its jndi name

Parameters:
jndiName The jndi name of a datasource
Returns:
The datasource name

Implements org.objectweb.jonas.dbm.DataBaseServiceImplMBean.

Definition at line 641 of file DataBaseServiceImpl.java.

Referenced by org.objectweb.jonas.container.EJB.getAllDataSourceName().

Properties org.objectweb.jonas.dbm.DataBaseServiceImpl.getDataSourcePropertiesFile String  dsFile  )  throws Exception
 

MBean method:

Returns:
datasource properties from a local file

Implements org.objectweb.jonas.dbm.DataBaseServiceImplMBean.

Definition at line 586 of file DataBaseServiceImpl.java.

List org.objectweb.jonas.dbm.DataBaseServiceImpl.getDataSourcePropertiesFiles  )  throws Exception
 

MBean method:

Returns:
the list of properties files describing datasources found in JONAS_BASE/conf

Implements org.objectweb.jonas.dbm.DataBaseServiceImplMBean.

Definition at line 501 of file DataBaseServiceImpl.java.

Integer org.objectweb.jonas.dbm.DataBaseServiceImpl.getTotalCurrentNumberOfJDBCConnectionOpen  ) 
 

MBean method:

Returns:
Integer Total Number of JDBC connection open

Implements org.objectweb.jonas.dbm.DataBaseServiceImplMBean.

Definition at line 517 of file DataBaseServiceImpl.java.

References org.objectweb.jonas.dbm.ConnectionManager.getCurrentOpened().

Here is the call graph for this function:

boolean org.objectweb.jonas.dbm.DataBaseServiceImpl.isLoadedDataSource String  dsName  ) 
 

MBean method:

Returns:
true if the datasource having thid jndi name is loadd

Implements org.objectweb.jonas.dbm.DataBaseServiceImplMBean.

Definition at line 532 of file DataBaseServiceImpl.java.

References org.objectweb.jonas.dbm.ConnectionManager.getDatasourceName().

Referenced by org.objectweb.jonas.dbm.DataBaseServiceImpl.loadDataSource().

Here is the call graph for this function:

void org.objectweb.jonas.dbm.DataBaseServiceImpl.loadDataSource String  name,
Properties  prop,
Boolean  loadFromFile
throws ServiceException
 

MBean method: load a new datasource

Parameters:
name datasource name
prop datasource properties

Implements org.objectweb.jonas.dbm.DataBaseServiceImplMBean.

Definition at line 606 of file DataBaseServiceImpl.java.

References org.objectweb.jonas.dbm.DataBaseServiceImpl.createDataSource(), org.objectweb.jonas.dbm.DataBaseServiceImpl.isLoadedDataSource(), and org.objectweb.jonas.dbm.DataBaseServiceImpl.unloadDataSource().

Here is the call graph for this function:

void org.objectweb.jonas.dbm.DataBaseServiceImpl.unbindDataSources  )  throws NamingException
 

Unbind dataSource names from the registry, unregister MBeans

Implements org.objectweb.jonas.dbm.DataBaseService.

Definition at line 423 of file DataBaseServiceImpl.java.

References org.objectweb.jonas.dbm.ConnectionManager.closeAllConnection(), org.objectweb.jonas.dbm.ConnectionManager.getDSName(), org.objectweb.jonas.dbm.JDBCResource.getJdbcDataSources(), and org.objectweb.jonas.dbm.JDBCResource.removeJdbcDataSource().

Referenced by org.objectweb.jonas.dbm.DataBaseServiceImpl.doStop().

Here is the call graph for this function:

void org.objectweb.jonas.dbm.DataBaseServiceImpl.unloadDataSource String  name  ) 
 

MBean method:

Parameters:
name of the data source to unload

Implements org.objectweb.jonas.dbm.DataBaseServiceImplMBean.

Definition at line 548 of file DataBaseServiceImpl.java.

References org.objectweb.jonas.dbm.ConnectionManager.closeAllConnection(), org.objectweb.jonas.dbm.ConnectionManager.getDatasourceName(), org.objectweb.jonas.dbm.ConnectionManager.getDSName(), and org.objectweb.jonas.dbm.JDBCResource.removeJdbcDataSource().

Referenced by org.objectweb.jonas.dbm.DataBaseServiceImpl.loadDataSource().

Here is the call graph for this function:


Member Data Documentation

final String org.objectweb.jonas.dbm.DataBaseServiceImpl.JDBCResourceName = "JDBCResource" [static]
 

Our naming convention for JDBCResource ObjectName (value of the 'name' key property)

Definition at line 150 of file DataBaseServiceImpl.java.

Referenced by org.objectweb.jonas.dbm.DataBaseServiceImpl.doStart(), and org.objectweb.jonas.dbm.DataBaseServiceImpl.doStop().


The documentation for this class was generated from the following file:
Generated on Tue Feb 15 15:06:40 2005 for JOnAS by  doxygen 1.3.9.1