org.ow2.jonas.db.base
Class AbsDBServiceImpl

java.lang.Object
  extended by javax.management.NotificationBroadcasterSupport
      extended by org.ow2.jonas.lib.reconfig.ReconfigEmitter
          extended by org.ow2.jonas.lib.service.AbsServiceImpl
              extended by org.ow2.jonas.db.base.AbsDBServiceImpl
All Implemented Interfaces:
NotificationBroadcaster, NotificationEmitter, 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.ow2.jonas.lib.reconfig.ReconfigEmitter
RECONFIG_TYPE, SAVE_RECONFIG_TYPE
 
Constructor Summary
AbsDBServiceImpl()
          Constructor initialization.
 
Method Summary
protected  void doStart()
          Start the service.
protected  void doStop()
          Stop the service.
static org.objectweb.util.monolog.api.Logger getLogger()
           
protected abstract  void initServer(List<User> users, String databaseName, String portNumber)
          Create a database with the specified arguments.
 void setDbname(String db)
           
 void setPort(String port)
           
 void setUsers(String users)
          Transform the pair user:pass into User instances.
 
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
 

Constructor Detail

AbsDBServiceImpl

public AbsDBServiceImpl()
Constructor initialization.

Method Detail

setUsers

public void setUsers(String users)
Transform the pair user:pass into User instances.

Parameters:
users - String of user/password (separated by a ":")

setPort

public void setPort(String port)
Parameters:
port - Database port

setDbname

public void setDbname(String db)
Parameters:
db - Database name

initServer

protected abstract void initServer(List<User> users,
                                   String databaseName,
                                   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.


Copyright © 2010 OW2 Consortium. All Rights Reserved.