org.codehaus.cargo.container.internal
Interface RunnableContainer

All Known Subinterfaces:
EmbeddedLocalContainer, InstalledLocalContainer, LocalContainer
All Known Implementing Classes:
AbstractEmbeddedLocalContainer, AbstractInstalledLocalContainer, AbstractLocalContainer

public interface RunnableContainer

All methods that a container that can be started/stopped must implement.

Version:
$Id: RunnableContainer.java 1165 2006-07-31 22:13:35Z vmassol $

Method Summary
 java.lang.String getOutput()
           
 long getTimeout()
           
 boolean isAppend()
           
 void setAppend(boolean shouldAppend)
          Sets whether output of the container should be appended to an existing file, or the existing file should be truncated.
 void setOutput(java.lang.String output)
           
 void setTimeout(long timeout)
           
 void start()
          Starts the container.
 void stop()
          Stops the container.
 

Method Detail

start

public void start()
Starts the container. It blocks until the container is fully started unless it doesn't start before the timeout period in which case an exception will be thrown.


stop

public void stop()
Stops the container. It blocks until the container is fully stopped unless it doesn't stop before the timeout period in which case an exception will be thrown.


setOutput

public void setOutput(java.lang.String output)
Parameters:
output - 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.

getOutput

public java.lang.String getOutput()
Returns:
the file to which the container's output will be logged to. Note that we're returning a String instead of a File because we want to leave the possibility of using URIs for specifying the home location.

setTimeout

public void setTimeout(long timeout)
Parameters:
timeout - the timeout (in ms) after which we consider the container cannot be started or stopped.

getTimeout

public long getTimeout()
Returns:
the timeout (in ms) after which we consider the container cannot be started or or stopped.

setAppend

public void setAppend(boolean shouldAppend)
Sets whether output of the container should be appended to an existing file, or the existing file should be truncated.

Parameters:
shouldAppend - Whether output should be appended to or not

isAppend

public boolean isAppend()
Returns:
true if the output of the container should be appended to the output file or false otherwise


Copyright © 2004-2007 Codehaus. All Rights Reserved.