|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.management.NotificationBroadcasterSupport org.ow2.jonas.lib.reconfig.ReconfigEmitter org.ow2.jonas.lib.service.AbsServiceImpl org.ow2.jonas.dbm.internal.JOnASDataBaseManagerService
public class JOnASDataBaseManagerService
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 bound 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 String |
JDBC_RESOURCE_NAME
Our naming convention for JDBCResource ObjectName (value of the 'name' key property). |
Fields inherited from class org.ow2.jonas.lib.reconfig.ReconfigEmitter |
---|
RECONFIG_TYPE, SAVE_RECONFIG_TYPE |
Fields inherited from interface org.ow2.jonas.dbm.internal.DBMConstants |
---|
ADJUSTPERIOD, CLASSNAME, CONNCHECKLEVEL, CONNMAXAGE, CONNTESTSTMT, DEF_ADJUSTPERIOD, DEF_CLASSNAME, DEF_CONNCHECKLEVEL, DEF_CONNMAXAGE, DEF_CONNTESTSTMT, DEF_DESCRIPTION, DEF_ISOLATIONLEVEL, DEF_MAPPERNAME, DEF_MAXCONPOOL, DEF_MAXOPENTIME, DEF_MAXWAITERS, DEF_MAXWAITTIME, DEF_MINCONPOOL, DEF_PASSWORD, DEF_PSTMTMAX, DEF_SAMPLINGPERIOD, DEF_URL, DEF_USERNAME, DESCRIPTION, ISOLATIONLEVEL, MAPPERNAME, MAXCONPOOL, MAXOPENTIME, MAXWAITERS, MAXWAITTIME, MINCONPOOL, NAME, PASSWORD, PSTMTMAX, SAMPLINGPERIOD, URL, USERNAME |
Constructor Summary | |
---|---|
JOnASDataBaseManagerService()
|
Method Summary | |
---|---|
void |
createDataSource(String datasourceName,
Properties dsd)
Creates a ConnectionManager (implementation of DataSource ). |
void |
doStart()
Starting DataBase service Initialization of the service is already done. |
void |
doStop()
Stopping DataBase service. |
ConnectionManager |
getConnectionManager(String dsname)
get ConnectionManager for the datasource having this JNDI name. |
Integer |
getCurrentNumberOfDataSource()
MBean method. |
String |
getDatasourceName(String jndiName)
MBean method allowing to determine the datasource name from its jndi name. |
Properties |
getDataSourcePropertiesFile(String dsFile)
MBean method. |
List |
getDataSourcePropertiesFiles()
MBean method. |
Collection<ConnectionManager> |
getDSList()
return the list of the datasources. |
Integer |
getTotalCurrentNumberOfJDBCConnectionOpen()
MBean method. |
boolean |
isLoadedDataSource(String dsName)
MBean method. |
void |
loadDataSource(String name,
Properties prop,
Boolean loadFromFile)
MBean method. |
void |
setDatasources(String datasources)
|
void |
setJmxService(JmxService jmxService)
|
void |
setRegistryService(RegistryService registry)
|
void |
setTransactionService(TransactionService txService)
|
void |
unbindDataSources()
Unbind dataSource names from the registry, unregister MBeans. |
void |
unloadDataSource(String name)
MBean method. |
Methods inherited from class org.ow2.jonas.lib.service.AbsServiceImpl |
---|
convertToList, doInit, getDomainName, getJonasServerName, getName, getServerProperties, init, isStarted, setName, setServerProperties, start, stop, throwRequirementException, toString |
Methods inherited from class org.ow2.jonas.lib.reconfig.ReconfigEmitter |
---|
initLogger, sendReconfigNotification, sendSaveNotification |
Methods inherited from class javax.management.NotificationBroadcasterSupport |
---|
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.ow2.jonas.service.Service |
---|
getName, init, isStarted, setName, start, stop |
Field Detail |
---|
public static final String JDBC_RESOURCE_NAME
Constructor Detail |
---|
public JOnASDataBaseManagerService()
Method Detail |
---|
public void setDatasources(String datasources)
datasources
- datasources to deploy at startup.public void doStart() throws ServiceException
doStart
in class AbsServiceImpl
ServiceException
- exceptionpublic void doStop() throws ServiceException
doStop
in class AbsServiceImpl
ServiceException
- exceptionpublic void createDataSource(String datasourceName, Properties dsd) throws Exception
DataSource
).
createDataSource
in interface DataBaseService
datasourceName
- datasource namedsd
- a set of properties that describes a dataSource and the ConnectionPool
Exception
public void unbindDataSources() throws NamingException
unbindDataSources
in interface DataBaseService
NamingException
public ConnectionManager getConnectionManager(String dsname)
public Collection<ConnectionManager> getDSList()
public List getDataSourcePropertiesFiles() throws Exception
getDataSourcePropertiesFiles
in interface JOnASDataBaseManagerServiceMBean
Exception
public Integer getCurrentNumberOfDataSource()
getCurrentNumberOfDataSource
in interface JOnASDataBaseManagerServiceMBean
public Integer getTotalCurrentNumberOfJDBCConnectionOpen()
getTotalCurrentNumberOfJDBCConnectionOpen
in interface JOnASDataBaseManagerServiceMBean
public boolean isLoadedDataSource(String dsName)
isLoadedDataSource
in interface JOnASDataBaseManagerServiceMBean
dsName
- the name of the datasource to be checked if loaded
public void unloadDataSource(String name)
unloadDataSource
in interface JOnASDataBaseManagerServiceMBean
name
- of the data source to unloadpublic Properties getDataSourcePropertiesFile(String dsFile) throws Exception
getDataSourcePropertiesFile
in interface JOnASDataBaseManagerServiceMBean
dsFile
- file name
Exception
- could not read properties filepublic void loadDataSource(String name, Properties prop, Boolean loadFromFile) throws ServiceException
loadDataSource
in interface JOnASDataBaseManagerServiceMBean
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 String getDatasourceName(String jndiName)
getDatasourceName
in interface JOnASDataBaseManagerServiceMBean
jndiName
- The jndi name of a datasource
public void setTransactionService(TransactionService txService)
txService
- the TransactionService to setpublic void setJmxService(JmxService jmxService)
jmxService
- the jmxService to setpublic void setRegistryService(RegistryService registry)
registry
- the registry servic to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |