Class ResinRun
- java.lang.Object
-
- java.lang.Thread
-
- org.codehaus.cargo.container.resin.internal.ResinRun
-
- All Implemented Interfaces:
Runnable
public class ResinRun extends Thread
Starts/stop Resin by setting up a listener socket. Supports Resin 3.x onwards.
When this application is first called to start the server, a listener socket is set up. Then, when it is later called to stop the server, we connect to the listener socket and tell the server to stop.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_KEEPALIVE_SOCKET_PORT
Default keepalive socket port for Resin.-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doRun()
Parse and process the command line to start/stop the server.protected void
doStartServer(String[] args)
Start the Resin server.protected void
doStopServer(String[] args)
Stops the Resin server by closing the keepalive socket.static void
main(String[] args)
Entry point to start/stop the Resin server.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
-
-
-
-
Field Detail
-
DEFAULT_KEEPALIVE_SOCKET_PORT
public static final int DEFAULT_KEEPALIVE_SOCKET_PORT
Default keepalive socket port for Resin. We create a server socket on this port that acts as a keepalive for Resin. When this socket closes Resin stops. This is a Resin feature.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ResinRun
public ResinRun(String[] args)
- Parameters:
args
- the command line arguments
-
-
Method Detail
-
main
public static void main(String[] args)
Entry point to start/stop the Resin server.- Parameters:
args
- the command line arguments
-
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.
-
doStartServer
protected void doStartServer(String[] args)
Start the Resin server. We use reflection so that the Resin jars do not need to be in the classpath to compile this class.- Parameters:
args
- the command line arguments
-
doStopServer
protected void doStopServer(String[] args)
Stops the Resin server by closing the keepalive socket.- Parameters:
args
- the command line arguments
-
-