Package winstone
Class Launcher
- java.lang.Object
-
- winstone.Launcher
-
- All Implemented Interfaces:
Runnable
public class Launcher extends Object implements Runnable
Implements the main launcher daemon thread. This is the class that gets launched by the command line, and owns the server socket, etc.- Version:
- $Id: Launcher.java,v 1.29 2007/04/23 02:55:35 rickknowles Exp $
- Author:
- Rick Knowles
-
-
Field Summary
Fields Modifier and Type Field Description static byte
RELOAD_TYPE
static WinstoneResourceBundle
RESOURCES
org.eclipse.jetty.server.Server
server
static byte
SHUTDOWN_TYPE
static String
USAGE
Overridable usage screenstatic String
WINSTONE_PORT_FILE_NAME_PROPERTY
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static void
deployEmbeddedWarfile(Map<String,String> args)
static Map<String,String>
getArgsFromCommandLine(String[] argv)
protected void
handleControlRequest(Socket csAccepted)
static void
initLogger(Map<String,String> args)
boolean
isRunning()
static void
main(String[] argv)
Main method.protected static void
printUsage()
void
run()
The main run method.void
shutdown()
protected org.eclipse.jetty.server.Connector
spawnListener(String listenerClassName, List<org.eclipse.jetty.server.Connector> connectors)
Instantiates listeners.
-
-
-
Field Detail
-
SHUTDOWN_TYPE
public static final byte SHUTDOWN_TYPE
- See Also:
- Constant Field Values
-
RELOAD_TYPE
public static final byte RELOAD_TYPE
- See Also:
- Constant Field Values
-
WINSTONE_PORT_FILE_NAME_PROPERTY
public static final String WINSTONE_PORT_FILE_NAME_PROPERTY
- See Also:
- Constant Field Values
-
RESOURCES
public static final WinstoneResourceBundle RESOURCES
-
server
public final org.eclipse.jetty.server.Server server
-
USAGE
public static String USAGE
Overridable usage screen
-
-
Constructor Detail
-
Launcher
public Launcher(Map<String,String> args) throws IOException
Constructor - initialises the web app, object pools, control port and the available protocol listeners.- Throws:
IOException
-
-
Method Detail
-
spawnListener
protected org.eclipse.jetty.server.Connector spawnListener(String listenerClassName, List<org.eclipse.jetty.server.Connector> connectors) throws IOException
Instantiates listeners. Note that an exception thrown in the constructor is interpreted as the listener being disabled, so don't do anything too adventurous in the constructor, or if you do, catch and log any errors locally before rethrowing.- Throws:
IOException
-
run
public void run()
The main run method. This handles the normal thread processing.
-
handleControlRequest
protected void handleControlRequest(Socket csAccepted) throws IOException
- Throws:
IOException
-
shutdown
public void shutdown()
-
isRunning
public boolean isRunning()
-
main
public static void main(String[] argv) throws IOException
Main method. This basically just accepts a few args, then initialises the listener thread. For now, just shut it down with a control-C.- Throws:
IOException
-
getArgsFromCommandLine
public static Map<String,String> getArgsFromCommandLine(String[] argv) throws IOException
- Throws:
IOException
-
deployEmbeddedWarfile
protected static void deployEmbeddedWarfile(Map<String,String> args) throws IOException
- Throws:
IOException
-
initLogger
public static void initLogger(Map<String,String> args) throws IOException
- Throws:
IOException
-
printUsage
protected static void printUsage()
-
-