winstone
Class Launcher

java.lang.Object
  extended by winstone.Launcher
All Implemented Interfaces:
java.lang.Runnable

public class Launcher
extends java.lang.Object
implements java.lang.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
static byte RELOAD_TYPE
           
static WinstoneResourceBundle RESOURCES
           
static byte SHUTDOWN_TYPE
           
static java.lang.String USAGE
          Overridable usage screen
 
Constructor Summary
Launcher(java.util.Map args)
          Constructor - initialises the web app, object pools, control port and the available protocol listeners.
 
Method Summary
protected static void deployEmbeddedWarfile(java.util.Map args)
           
static java.util.Map getArgsFromCommandLine(java.lang.String[] argv)
           
protected  void handleControlRequest(java.net.Socket csAccepted)
           
static void initLogger(java.util.Map args)
           
 boolean isRunning()
           
static void main(java.lang.String[] argv)
          Main method.
protected static void printUsage()
           
 void run()
          The main run method.
 void shutdown()
           
protected  void spawnListener(java.lang.String listenerClassName)
          Instantiates listeners.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

RESOURCES

public static final WinstoneResourceBundle RESOURCES

USAGE

public static java.lang.String USAGE
Overridable usage screen

Constructor Detail

Launcher

public Launcher(java.util.Map args)
         throws java.io.IOException
Constructor - initialises the web app, object pools, control port and the available protocol listeners.

Throws:
java.io.IOException
Method Detail

spawnListener

protected void spawnListener(java.lang.String listenerClassName)
                      throws java.io.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:
java.io.IOException

run

public void run()
The main run method. This handles the normal thread processing.

Specified by:
run in interface java.lang.Runnable

handleControlRequest

protected void handleControlRequest(java.net.Socket csAccepted)
                             throws java.io.IOException
Throws:
java.io.IOException

shutdown

public void shutdown()

isRunning

public boolean isRunning()

main

public static void main(java.lang.String[] argv)
                 throws java.io.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:
java.io.IOException

getArgsFromCommandLine

public static java.util.Map getArgsFromCommandLine(java.lang.String[] argv)
                                            throws java.io.IOException
Throws:
java.io.IOException

deployEmbeddedWarfile

protected static void deployEmbeddedWarfile(java.util.Map args)
                                     throws java.io.IOException
Throws:
java.io.IOException

initLogger

public static void initLogger(java.util.Map args)
                       throws java.io.IOException
Throws:
java.io.IOException

printUsage

protected static void printUsage()


Copyright © 2013. All Rights Reserved.