|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.management.NotificationBroadcasterSupport org.objectweb.jonas.management.ReconfigDispatcher org.objectweb.jonas.service.AbsServiceImpl org.objectweb.jonas.dbm.DataBaseServiceImpl
public class DataBaseServiceImpl
DatabaseService acts as a factory for the DataSource objects. Its goal is to create such objects and to register them in JNDI
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
Field Summary | |
---|---|
static java.lang.String |
CONNCHECKLEVEL
|
static java.lang.String |
CONNMAXAGE
|
static java.lang.String |
CONNTESTSTMT
|
static java.lang.String |
JDBCResourceName
Our naming convention for JDBCResource ObjectName (value of the 'name' key property) |
static java.lang.String |
MAXOPENTIME
|
static java.lang.String |
PSTMTMAX
|
Fields inherited from class org.objectweb.jonas.management.ReconfigDispatcher |
---|
RECONFIG_TYPE, SAVE_RECONFIG_TYPE |
Constructor Summary | |
---|---|
DataBaseServiceImpl()
|
Method Summary | |
---|---|
void |
createDataSource(java.lang.String datasourceName,
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 Datasource |
ConnectionManager |
getConnectionManager(java.lang.String dsname)
get ConnectionManager for the datasource having this JNDI name. |
java.lang.Integer |
getCurrentNumberOfDataSource()
MBean method: |
java.lang.String |
getDatasourceName(java.lang.String jndiName)
MBean method allowing to determine the datasource name from its jndi name |
java.util.Properties |
getDataSourcePropertiesFile(java.lang.String dsFile)
MBean method: |
java.util.List |
getDataSourcePropertiesFiles()
MBean method: |
java.util.Collection |
getDSList()
return the list of the datasources |
java.lang.Integer |
getTotalCurrentNumberOfJDBCConnectionOpen()
MBean method: |
boolean |
isLoadedDataSource(java.lang.String dsName)
MBean method: |
void |
loadDataSource(java.lang.String name,
java.util.Properties prop,
java.lang.Boolean loadFromFile)
MBean method: load a new datasource |
void |
unbindDataSources()
Unbind dataSource names from the registry, unregister MBeans |
void |
unloadDataSource(java.lang.String name)
MBean method: |
Methods inherited from class org.objectweb.jonas.service.AbsServiceImpl |
---|
getDomainName, getJonasServerName, getName, init, isStarted, setName, start, stop |
Methods inherited from class org.objectweb.jonas.management.ReconfigDispatcher |
---|
addNotificationListener, getFilter, getHandback, getListener, getNotificationInfo, initLogger, removeNotificationListener, sendReconfigNotification, sendSaveNotification |
Methods inherited from class javax.management.NotificationBroadcasterSupport |
---|
handleNotification, removeNotificationListener, sendNotification |
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 |
Field Detail |
---|
public static final java.lang.String CONNCHECKLEVEL
public static final java.lang.String CONNMAXAGE
public static final java.lang.String MAXOPENTIME
public static final java.lang.String CONNTESTSTMT
public static final java.lang.String PSTMTMAX
public static final java.lang.String JDBCResourceName
Constructor Detail |
---|
public DataBaseServiceImpl()
Method Detail |
---|
public void doInit(javax.naming.Context ctx) throws ServiceException
doInit
in class AbsServiceImpl
ctx
- configuration of the service
ServiceException
- service initialization failedpublic void doStart() throws ServiceException
doStart
in class AbsServiceImpl
ServiceException
- service start-up failedpublic void doStop() throws ServiceException
doStop
in class AbsServiceImpl
ServiceException
- service stopping failedpublic void createDataSource(java.lang.String datasourceName, java.util.Properties dsd) throws java.lang.Exception
createDataSource
in interface DataBaseService
datasourceName
- - datasource namedsd
- - a set of properties that describes a dataSource and the ConnectionPool
java.lang.Exception
public void unbindDataSources() throws javax.naming.NamingException
unbindDataSources
in interface DataBaseService
javax.naming.NamingException
public ConnectionManager getConnectionManager(java.lang.String dsname)
public java.util.Collection getDSList()
public java.util.List getDataSourcePropertiesFiles() throws java.lang.Exception
getDataSourcePropertiesFiles
in interface DataBaseServiceImplMBean
java.lang.Exception
public java.lang.Integer getCurrentNumberOfDataSource()
getCurrentNumberOfDataSource
in interface DataBaseServiceImplMBean
public java.lang.Integer getTotalCurrentNumberOfJDBCConnectionOpen()
getTotalCurrentNumberOfJDBCConnectionOpen
in interface DataBaseServiceImplMBean
public boolean isLoadedDataSource(java.lang.String dsName)
isLoadedDataSource
in interface DataBaseServiceImplMBean
dsName
- the name of the datasource to be checked if loaded
public void unloadDataSource(java.lang.String name)
unloadDataSource
in interface DataBaseServiceImplMBean
name
- of the data source to unloadpublic java.util.Properties getDataSourcePropertiesFile(java.lang.String dsFile) throws java.lang.Exception
getDataSourcePropertiesFile
in interface DataBaseServiceImplMBean
java.lang.Exception
public void loadDataSource(java.lang.String name, java.util.Properties prop, java.lang.Boolean loadFromFile) throws ServiceException
loadDataSource
in interface DataBaseServiceImplMBean
name
- datasource nameprop
- datasource propertiesloadFromFile
- if false the datasource creation was dynamicaly invoked by a management
operation providing the properties in the prop object.
ServiceException
- datasource could not be createdpublic java.lang.String getDatasourceName(java.lang.String jndiName)
getDatasourceName
in interface DataBaseServiceImplMBean
jndiName
- The jndi name of a datasource
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |