com.sun.grizzly.webserver
Class WebServer

java.lang.Object
  extended by com.sun.grizzly.standalone.StandaloneMainUtil
      extended by com.sun.grizzly.webserver.WebServer

public class WebServer
extends StandaloneMainUtil

Basic startup class used when Grizzly standalone is used

Author:
Jeanfrancois Arcand

Field Summary
 
Fields inherited from class com.sun.grizzly.standalone.StandaloneMainUtil
ADAPTER, SELECTOR_THREAD
 
Constructor Summary
WebServer()
           
 
Method Summary
 Adapter configureAdapter(SelectorThread st)
          Configure the SelectorThread.setAdapter(com.sun.grizzly.tcp.Adapter)
 SelectorThread createSelectorThread(String[] args)
          Create a single SelectorThread and configure it using the command line passed arguments.
static void main(String[] args)
           
 String parseApplicationLocation(String[] args)
          Parse the current command line, and return the location of the war/jar/static resource location file passed as argument.
 boolean parseOptions(String[] args)
          Validate the command line options.
 void printHelpAndExit()
          This method will be invoked when unexpected arguments are passed to the StandaloneMainUtil.createSelectorThread(java.lang.String[]).
 
Methods inherited from class com.sun.grizzly.standalone.StandaloneMainUtil
appendWarContentToClassPath, setPort, start, startSelectorThread, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebServer

public WebServer()
Method Detail

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception

createSelectorThread

public SelectorThread createSelectorThread(String[] args)
                                    throws Exception
Description copied from class: StandaloneMainUtil
Create a single SelectorThread and configure it using the command line passed arguments. This method will invoke StandaloneMainUtil.parseOptions(java.lang.String[]), then StandaloneMainUtil.parseApplicationLocation(java.lang.String[]), StandaloneMainUtil.appendWarContentToClassPath(java.lang.String) and finally StandaloneMainUtil.configureAdapter(com.sun.grizzly.http.SelectorThread)

Overrides:
createSelectorThread in class StandaloneMainUtil
Parameters:
args - The command line arguments.
Returns:
An instance of ready to start SelectorThread
Throws:
Exception

printHelpAndExit

public void printHelpAndExit()
Description copied from class: StandaloneMainUtil
This method will be invoked when unexpected arguments are passed to the StandaloneMainUtil.createSelectorThread(java.lang.String[]).

Specified by:
printHelpAndExit in class StandaloneMainUtil

parseOptions

public boolean parseOptions(String[] args)
Description copied from class: StandaloneMainUtil
Validate the command line options.

Specified by:
parseOptions in class StandaloneMainUtil
Parameters:
args - the command line arguments.
Returns:
true if the options are well formed.

configureAdapter

public Adapter configureAdapter(SelectorThread st)
Description copied from class: StandaloneMainUtil
Configure the SelectorThread.setAdapter(com.sun.grizzly.tcp.Adapter)

Specified by:
configureAdapter in class StandaloneMainUtil
Parameters:
st - #return an instance of an Adapter.

parseApplicationLocation

public String parseApplicationLocation(String[] args)
Description copied from class: StandaloneMainUtil
Parse the current command line, and return the location of the war/jar/static resource location file passed as argument.

Specified by:
parseApplicationLocation in class StandaloneMainUtil
Parameters:
args - the command line arguments.
Returns:
the application path, or null if not defined.


Copyright © 2012 Oracle Corporation. All Rights Reserved.