atg.service.jdbc
Class HSQLDBDataSource

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.service.jdbc.FakeXADataSource
              extended by atg.service.jdbc.InitializingDataSourceBase
                  extended by atg.service.jdbc.HSQLDBDataSource
All Implemented Interfaces:
atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, java.util.EventListener, javax.sql.CommonDataSource, javax.sql.XADataSource

public class HSQLDBDataSource
extends InitializingDataSourceBase

This datasource is used for testing. It starts up an HSQLDB in memory instance on localhost automatically. The database will be named "testdb" by default. If you need to name it something else set the "databaseName" property on this component. You may want to change the name if your test requires running two databases at the same time.

Version:
$Id:n HSQLDB //test/UnitTests/base/main/src/Java/atg/service/jdbc/HSQLDBDataSource .java#2 $
Author:
adamb

Field Summary
 boolean mShutdownHSQLDB
           
 
Fields inherited from class atg.service.jdbc.InitializingDataSourceBase
mDatabaseName
 
Fields inherited from class atg.service.jdbc.FakeXADataSource
CLASS_VERSION
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
HSQLDBDataSource()
           
 
Method Summary
 void doStartService()
          Starts this DataSource.
 void doStopService()
          Called when Nucleus is shutdown.
 boolean isShutdownHSQLDB()
          Returns true if the "SHUTDOWN" sql statment should be sent to HSQLDB when doStopService is called on this component.
 void setShutdownHSQLDB(boolean shouldShutdownHSQLDB)
          Sets the boolean which controls if HSQLDB should be shutdown when doStopService is called on this component.
 
Methods inherited from class atg.service.jdbc.InitializingDataSourceBase
getDatabaseName, setDatabaseName
 
Methods inherited from class atg.service.jdbc.FakeXADataSource
getAdditionalConnectionProperties, getCloseOrphanedConnections, getDatabase, getDataSource, getDataSourceJNDIEnvironment, getDataSourceJNDIName, getDriver, getLoginDecoder, getLoginTimeout, getLogWriter, getNeedsSeparateUserInfo, getPassword, getReadOnly, getServer, getURL, getUser, getXAConnection, getXAConnection, isCommitOnPrepare, setAdditionalConnectionProperties, setCloseOrphanedConnections, setCommitOnPrepare, setDatabase, setDataSource, setDataSourceJNDIEnvironment, setDataSourceJNDIName, setDriver, setLoginDecoder, setLoginTimeout, setLogWriter, setNeedsSeparateUserInfo, setPassword, setReadOnly, setServer, setURL, setUser
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mShutdownHSQLDB

public boolean mShutdownHSQLDB
Constructor Detail

HSQLDBDataSource

public HSQLDBDataSource()
Method Detail

isShutdownHSQLDB

public boolean isShutdownHSQLDB()
Returns true if the "SHUTDOWN" sql statment should be sent to HSQLDB when doStopService is called on this component.

Returns:

setShutdownHSQLDB

public void setShutdownHSQLDB(boolean shouldShutdownHSQLDB)
Sets the boolean which controls if HSQLDB should be shutdown when doStopService is called on this component.

Parameters:
shouldShutdownHSQLDB -

doStartService

public void doStartService()
                    throws atg.nucleus.ServiceException
Starts this DataSource. Since the datasource uses an in memory HSQL database, the database actually is started on the first call to getConnection().

Overrides:
doStartService in class atg.nucleus.GenericService
Throws:
atg.nucleus.ServiceException

doStopService

public void doStopService()
Called when Nucleus is shutdown. Issues the "SHUTDOWN" command to the HSQLDB database.

Overrides:
doStopService in class atg.nucleus.GenericService


Copyright © 2009. All Rights Reserved.