org.objectweb.jonas.db
Class AbsDBServiceImpl

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.objectweb.jonas.management.ReconfigDispatcher
          extended by org.objectweb.jonas.service.AbsServiceImpl
              extended by org.objectweb.jonas.db.AbsDBServiceImpl
All Implemented Interfaces:
javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, ReconfigDispatcherMBean, Service
Direct Known Subclasses:
HsqlDBServiceImpl

public abstract class AbsDBServiceImpl
extends AbsServiceImpl

Abstract database service to be implemented by implementation of Java databases

Author:
Florent Benoit

Field Summary
 
Fields inherited from class org.objectweb.jonas.management.ReconfigDispatcher
RECONFIG_TYPE, SAVE_RECONFIG_TYPE
 
Constructor Summary
AbsDBServiceImpl()
           
 
Method Summary
protected  void doInit(javax.naming.Context ctx)
          Initialize the service.
protected  void doStart()
          Start the service.
protected  void doStop()
          Stop the service.
static org.objectweb.util.monolog.api.Logger getLogger()
           
protected abstract  void initServer(java.util.List users, java.lang.String databaseName, java.lang.String portNumber)
          Create a database with the specified arguments.
 
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
 

Constructor Detail

AbsDBServiceImpl

public AbsDBServiceImpl()
Method Detail

doInit

protected void doInit(javax.naming.Context ctx)
               throws ServiceException
Initialize the service.

Specified by:
doInit in class AbsServiceImpl
Parameters:
ctx - the configuration context of the service.
Throws:
ServiceException - if the initialization failed.

initServer

protected abstract void initServer(java.util.List users,
                                   java.lang.String databaseName,
                                   java.lang.String portNumber)
Create a database with the specified arguments. Need to be implemented by classes extending this one.

Parameters:
users - user/password (separated by a ":")
databaseName - name of the database
portNumber - port number of the database

doStart

protected void doStart()
                throws ServiceException
Start the service.

Specified by:
doStart in class AbsServiceImpl
Throws:
ServiceException - if the startup failed.

doStop

protected void doStop()
               throws ServiceException
Stop the service.

Specified by:
doStop in class AbsServiceImpl
Throws:
ServiceException - if the stop failed.

getLogger

public static org.objectweb.util.monolog.api.Logger getLogger()
Returns:
the logger.