org.objectweb.easybeans.component.hsqldb
Class HSQLDBComponent

java.lang.Object
  extended by org.objectweb.easybeans.component.hsqldb.HSQLDBComponent
All Implemented Interfaces:
EZBComponent, EmbeddedDBComponent

public class HSQLDBComponent
extends java.lang.Object
implements EmbeddedDBComponent

Allows to start an embedded HSQLDB server.

Author:
Florent Benoit

Field Summary
private  java.lang.String databaseName
          Name of database.
private static java.lang.String DEFAULT_PORT
          Default port number.
private static JLog logger
          Logger.
private static int MAX_RETRY_NB
          Max retry number.
private  java.lang.String portNumber
          port number used.
private  org.hsqldb.Server server
          HsqlDB server.
private static int SLEEP_VALUE
          Sleep value.
private  java.util.List<User> users
          List of users.
 
Constructor Summary
HSQLDBComponent()
          Default constructor.
Use default port number.
 
Method Summary
 java.util.List<User> getUsers()
          Gets the list of users.
 void init()
          Init method.
This method is called before the start method.
 void setDatabaseName(java.lang.String databaseName)
          Sets the database name.
 void setPortNumber(java.lang.String portNumber)
          Sets the port number.
 void setUsers(java.util.List<User> users)
          Set the list of users.
 void start()
          Start method.
This method is called after the init method.
 void stop()
          Stop method.
This method is called when component needs to be stopped.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static JLog logger
Logger.


users

private java.util.List<User> users
List of users.


databaseName

private java.lang.String databaseName
Name of database.


DEFAULT_PORT

private static final java.lang.String DEFAULT_PORT
Default port number.

See Also:
Constant Field Values

SLEEP_VALUE

private static final int SLEEP_VALUE
Sleep value.

See Also:
Constant Field Values

MAX_RETRY_NB

private static final int MAX_RETRY_NB
Max retry number.

See Also:
Constant Field Values

portNumber

private java.lang.String portNumber
port number used.


server

private org.hsqldb.Server server
HsqlDB server.

Constructor Detail

HSQLDBComponent

public HSQLDBComponent()
Default constructor.
Use default port number.

Method Detail

init

public void init()
          throws EZBComponentException
Init method.
This method is called before the start method.

Specified by:
init in interface EZBComponent
Throws:
EZBComponentException - if the initialization has failed.

start

public void start()
           throws EZBComponentException
Start method.
This method is called after the init method.

Specified by:
start in interface EZBComponent
Throws:
EZBComponentException - if the start has failed.

getUsers

public java.util.List<User> getUsers()
Gets the list of users.

Returns:
the list of users.

setUsers

public void setUsers(java.util.List<User> users)
Set the list of users.

Parameters:
users - the list of users.

stop

public void stop()
          throws EZBComponentException
Stop method.
This method is called when component needs to be stopped.

Specified by:
stop in interface EZBComponent
Throws:
EZBComponentException - if the stop is failing.

setPortNumber

public void setPortNumber(java.lang.String portNumber)
Sets the port number.

Specified by:
setPortNumber in interface EmbeddedDBComponent
Parameters:
portNumber - the port number to use.

setDatabaseName

public void setDatabaseName(java.lang.String databaseName)
Sets the database name.

Parameters:
databaseName - the name of the database.