net.sf.emarket.utils
Class ServerBean

java.lang.Object
  extended by net.sf.emarket.utils.ServerBean

public class ServerBean
extends java.lang.Object

Bean that will start an instance of an HSQL database. This class is primarily intended to be used in demo applications. It allows for a self contained distribution including a database instance. The DataSource reference is necessary for proper shutdown.

This is an example of a bean configuration:

     <bean id="dataBase" class="org.springmodules.db.hsqldb.ServerBean" singleton="true" lazy-init="false">
         <property name="dataSource"><ref local="dataSource"/></property>
         <property name="serverProperties">
             <props>
                 <prop key="server.port">9101</prop>
                 <prop key="server.database.0">webapps/myapp/db/test</prop>
                 <prop key="server.dbname.0">test</prop>
             </props>
         </property>
     </bean>
 

Author:
Thomas Risberg
See Also:
Server

Constructor Summary
ServerBean()
           
 
Method Summary
 javax.sql.DataSource getDataSource()
           
 java.util.Properties getServerProperties()
           
 void initialize()
           
static void main(java.lang.String[] args)
           
static void printClasspath()
           
 void setDataSource(javax.sql.DataSource dataSource)
           
 void setServerProperties(java.util.Properties serverProperties)
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerBean

public ServerBean()
Method Detail

getServerProperties

public java.util.Properties getServerProperties()

setServerProperties

public void setServerProperties(java.util.Properties serverProperties)

getDataSource

public javax.sql.DataSource getDataSource()

setDataSource

public void setDataSource(javax.sql.DataSource dataSource)

initialize

public void initialize()
                throws java.lang.Exception
Throws:
java.lang.Exception

shutdown

public void shutdown()

printClasspath

public static void printClasspath()

main

public static void main(java.lang.String[] args)


Copyright © 2009. All Rights Reserved.