org.codehaus.cargo.container.spi.util
Class DefaultServerRun
java.lang.Object
java.lang.Thread
org.codehaus.cargo.container.spi.util.DefaultServerRun
- All Implemented Interfaces:
- Runnable
- Direct Known Subclasses:
- ResinRun
public class DefaultServerRun
- extends Thread
Helper class to start/stop a container. When this application is first called to start the
server, a listener socket is set up. Then, we it is later called to stop the server, we connect
to the listener socket and tell the server to stop.
- Version:
- $Id: DefaultServerRun.java 1705 2008-09-02 13:14:55Z adriana $
Method Summary |
protected void |
doRun()
Parse and process the command line to start/stop the server. |
protected void |
doStartServer(String[] theArgs)
Starts the server (in a blocking mode) and set up a socket listener. |
protected void |
doStopServer(String[] theArgs)
Stops the server by connecting to the socket set up when the server
was started. |
void |
run()
Sets up a listener socket and wait until we receive a request on it to
stop the running server. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
DefaultServerRun
public DefaultServerRun(String[] theArgs)
- Parameters:
theArgs
- the command line arguments
doStartServer
protected void doStartServer(String[] theArgs)
throws Exception
- Starts the server (in a blocking mode) and set up a socket listener.
- Parameters:
theArgs
- the command line arguments
- Throws:
Exception
- if any error happens when starting the server
doStopServer
protected void doStopServer(String[] theArgs)
throws Exception
- Stops the server by connecting to the socket set up when the server
was started.
- Parameters:
theArgs
- the command line arguments
- Throws:
Exception
- if any error happens when stopping the server
doRun
protected final void doRun()
- Parse and process the command line to start/stop the server.
run
public void run()
- Sets up a listener socket and wait until we receive a request on it to
stop the running server.
- Specified by:
run
in interface Runnable
- Overrides:
run
in class Thread
Copyright © 2004-2012 Codehaus. All Rights Reserved.