|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.objectweb.cjdbc.scenario.tools.components.ComponentManager
This class defines a ComponentManager
| Field Summary | |
protected java.util.Hashtable |
processes
|
| Constructor Summary | |
ComponentManager()
|
|
| Method Summary | |
abstract java.lang.String |
getDefaultConfigurationFile()
The default configuration file to use with this component manager. |
ComponentInterface |
instanciateProcess(java.lang.String port)
Instaciate a process managed by this component manager on the given port This used the default configuration file returned by the getDefaultConfigurationFile method |
abstract ComponentInterface |
instanciateProcess(java.lang.String port,
java.lang.String configurationFile)
Instaciate a process managed by this component manager on the given port |
boolean |
isStarted(java.lang.String port)
Check if can open a connection on localhost on the given port |
void |
loaddatabase(java.lang.String port)
fill the database with raidb1 default configuration |
void |
loaddatabase(java.lang.String port,
java.lang.String templateName)
Load the database with a given input file |
void |
loaddatabase(java.lang.String port,
java.lang.String templateName,
java.lang.String target)
Load the database with a given input file |
void |
release()
release files locked by manager |
void |
simulateFailure(int port,
long wait,
boolean rand)
Simulate a failure of the component by stopping it after the given time. |
void |
simulateFailure(java.lang.String port,
long wait,
boolean rand)
Simulate a failure of the component by stopping it after the given time. |
ComponentInterface |
start(java.lang.String port)
Starts database component on the given port with the default database |
ComponentInterface |
start(java.lang.String port,
java.lang.String database)
Starts database component on the given port with the given database |
ComponentInterface |
startComponent(java.lang.String port)
Starts component on the given port |
ComponentInterface |
startComponent(java.lang.String port,
java.lang.String database)
Starts component on the given port with the given database |
void |
stop(ComponentInterface process)
Stop Hsql. |
void |
stop(int port)
Same as stop(String) |
void |
stop(java.lang.String componentOnPort)
Stop a component from its unique port number |
void |
stopAll()
Stops all process contained in this manager |
void |
waitForStarted(java.lang.String port)
Check if can open a connection on localhost on the given port |
void |
waitForStopped(java.lang.String port)
Wait for the component to stop |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.Hashtable processes
| Constructor Detail |
public ComponentManager()
| Method Detail |
public ComponentInterface instanciateProcess(java.lang.String port)
throws java.lang.Exception
getDefaultConfigurationFile method
instanciateProcess in interface ComponentManagerInterfaceport - port to start the process on
java.lang.Exception - if fails
public abstract ComponentInterface instanciateProcess(java.lang.String port,
java.lang.String configurationFile)
throws java.lang.Exception
instanciateProcess in interface ComponentManagerInterfaceport - port to start the process onconfigurationFile - used to instanciate the process
java.lang.Exception - if failspublic abstract java.lang.String getDefaultConfigurationFile()
getDefaultConfigurationFile in interface ComponentManagerInterface
public ComponentInterface startComponent(java.lang.String port,
java.lang.String database)
throws java.lang.Exception
startComponent in interface ComponentManagerInterfaceport - to run hsql ondatabase - to load component with
java.lang.Exception - if fails to create process
public ComponentInterface startComponent(java.lang.String port)
throws java.lang.Exception
startComponent in interface ComponentManagerInterfaceport - to run component on
java.lang.Exception - if fails to create process
public void waitForStarted(java.lang.String port)
throws java.lang.Exception
waitForStarted in interface ComponentManagerInterfaceport - to open a socket for check
java.lang.Exception - if fails
public void waitForStopped(java.lang.String port)
throws java.lang.Exception
waitForStopped in interface ComponentManagerInterfaceport - to check the connection on
java.lang.Exception - if failspublic boolean isStarted(java.lang.String port)
isStarted in interface ComponentManagerInterfaceport - to open a socket for check
public void loaddatabase(java.lang.String port)
throws java.lang.Exception
loaddatabase in interface ComponentManagerInterfaceport - of the database
java.lang.Exception - if fails
public void loaddatabase(java.lang.String port,
java.lang.String templateName)
throws java.lang.Exception
loaddatabase in interface ComponentManagerInterfaceport - of the database to loadtemplateName - name of the file to load(NO PATH!)
java.lang.Exception - if fails
public void loaddatabase(java.lang.String port,
java.lang.String templateName,
java.lang.String target)
throws java.lang.Exception
port - of the database to loadtemplateName - name of the file to load(NO PATH!)target - the target database to load
java.lang.Exception - if failspublic void stop(ComponentInterface process)
stop in interface ComponentManagerInterfaceprocess - to stoppublic void stop(java.lang.String componentOnPort)
stop in interface ComponentManagerInterfacecomponentOnPort - port number of the component to stoppublic void stop(int port)
stop in interface ComponentManagerInterfaceport - port numberpublic void stopAll()
stopAll in interface ComponentManagerInterface
public ComponentInterface start(java.lang.String port,
java.lang.String database)
throws java.lang.Exception
start in interface ComponentManagerInterfaceport - to run component ondatabase - to load component with
java.lang.Exception - if fails to create process
public ComponentInterface start(java.lang.String port)
throws java.lang.Exception
start in interface ComponentManagerInterfaceport - to run component on
java.lang.Exception - if fails to create processpublic void release()
release in interface ComponentManagerInterface
public void simulateFailure(int port,
long wait,
boolean rand)
ComponentManagerInterface
simulateFailure in interface ComponentManagerInterfaceport - the port of the component to stopwait - the wait time before stopping itrand - should we use a random time, if so, the previous argument is
used as a rangeComponentManagerInterface.simulateFailure(int, long, boolean)
public void simulateFailure(java.lang.String port,
long wait,
boolean rand)
ComponentManagerInterface
simulateFailure in interface ComponentManagerInterfaceport - the port of the component to stopwait - the wait time before stopping itrand - should we use a random time, if so, the previous argument is
used as a rangeComponentManagerInterface.simulateFailure(java.lang.String, long, boolean)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||