|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.cargo.util.log.LoggedObject
org.codehaus.cargo.container.spi.AbstractContainer
org.codehaus.cargo.container.spi.AbstractLocalContainer
public abstract class AbstractLocalContainer
Default container implementation that all local container implementations must extend.
| Constructor Summary | |
|---|---|
AbstractLocalContainer(LocalConfiguration configuration)
Default constructor. |
|
| Method Summary | |
|---|---|
LocalConfiguration |
getConfiguration()
|
java.lang.String |
getOutput()
|
State |
getState()
|
long |
getTimeout()
|
boolean |
isAppend()
|
void |
setAppend(boolean isAppend)
Sets whether output of the container should be appended to an existing file, or the existing file should be truncated. |
void |
setConfiguration(LocalConfiguration configuration)
|
void |
setOutput(java.lang.String output)
|
protected void |
setState(State state)
|
void |
setTimeout(long timeout)
|
void |
start()
Starts the container. |
protected abstract void |
startInternal()
Installed and Embedded containers do not have the same signature for their doStart method. |
void |
stop()
Stops the container. |
protected abstract void |
stopInternal()
Installed and Embedded containers do not have the same signature for their doStop method. |
protected void |
verify()
Verify required properties have been set before executing any action. |
protected void |
waitForCompletion(boolean waitForStarting)
Ping the WAR CPC to verify if the container is started or stopped. |
| Methods inherited from class org.codehaus.cargo.util.log.LoggedObject |
|---|
getLogger, setLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.codehaus.cargo.container.Container |
|---|
getCapability, getId, getName, getType |
| Methods inherited from interface org.codehaus.cargo.util.log.Loggable |
|---|
getLogger, setLogger |
| Constructor Detail |
|---|
public AbstractLocalContainer(LocalConfiguration configuration)
configuration - the configuration to associate to this container. It can be changed
later on by calling setConfiguration(LocalConfiguration)| Method Detail |
|---|
public final void setOutput(java.lang.String output)
setOutput in interface RunnableContaineroutput - the file to which the container's output will be logged to. Note that we're
passing a String instead of a File because we want to leave the possibility of using
URIs for specifying the home location.RunnableContainer.setOutput(String)public final void setAppend(boolean isAppend)
setAppend in interface RunnableContainerisAppend - Whether output should be appended to or notRunnableContainer.setAppend(boolean)public final java.lang.String getOutput()
getOutput in interface RunnableContainerRunnableContainer.getOutput()public final boolean isAppend()
isAppend in interface RunnableContainerRunnableContainer.isAppend()protected void verify()
protected abstract void startInternal()
throws java.lang.Exception
doStart method. Thus we need to abstract it.
java.lang.Exception - if any error is raised during the container start
protected abstract void stopInternal()
throws java.lang.Exception
doStop method. Thus we need to abstract it.
java.lang.Exception - if any error is raised during the container stoppublic final void start()
start in interface RunnableContainerRunnableContainer.start()public final void stop()
stop in interface RunnableContainerRunnableContainer.stop()
protected void waitForCompletion(boolean waitForStarting)
throws java.lang.InterruptedException
waitForStarting - if true then wait for container start, if false wait for container
stop
java.lang.InterruptedException - if the thread sleep is interruptedpublic void setConfiguration(LocalConfiguration configuration)
setConfiguration in interface LocalContainerconfiguration - the local configuration implementation to useLocalContainer.setConfiguration(LocalConfiguration)public LocalConfiguration getConfiguration()
getConfiguration in interface LocalContainerLocalContainer.getConfiguration()public void setTimeout(long timeout)
setTimeout in interface RunnableContainertimeout - the timeout (in ms) after which we consider the container cannot be started
or stopped.RunnableContainer.setTimeout(long)public long getTimeout()
getTimeout in interface RunnableContainerRunnableContainer.getTimeout()public State getState()
getState in interface ContainerContainer.getState()protected void setState(State state)
state - the container current state
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||