Package org.eclipse.jetty.start
Class Main
- java.lang.Object
-
- org.eclipse.jetty.start.Main
-
public class Main extends java.lang.Object
Main start class.This class is intended to be the main class listed in the MANIFEST.MF of the start.jar archive. It allows the Jetty Application server to be started with the command "java -jar start.jar".
Argument processing steps:
- Directory Location: jetty.home=[directory] (the jetty.home location)
- Directory Location: jetty.base=[directory] (the jetty.base location)
- Start Logging behavior: --debug (debugging enabled)
- Start Logging behavior: --start-log-file=logs/start.log (output start logs to logs/start.log location)
- Module Resolution
- Properties Resolution
- Present Optional Informational Options
- Normal Startup
-
-
Field Summary
Fields Modifier and Type Field Description private BaseHome
baseHome
private static int
EXIT_USAGE
private StartArgs
jsvcStartArgs
-
Constructor Summary
Constructors Constructor Description Main()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
copyInThread(java.io.InputStream in, java.io.OutputStream out)
void
destroy()
private void
doStop(StartArgs args)
private void
dumpClasspathWithVersions(Classpath classpath)
BaseHome
getBaseHome()
private java.lang.String
getVersion(java.io.File element)
void
init(java.lang.String[] args)
void
invokeMain(java.lang.ClassLoader classloader, StartArgs args)
void
listConfig(StartArgs args)
void
listModules(StartArgs args)
static void
main(java.lang.String[] args)
private java.lang.String
normalizeURI(java.lang.String uri)
static boolean
printTextResource(java.lang.String resourceName)
StartArgs
processCommandLine(java.lang.String[] cmdLine)
StartArgs
processCommandLine(java.util.List<java.lang.String> cmdLine)
Convenience forprocessCommandLine(cmdLine.toArray(new String[cmdLine.size()]))
void
start()
void
start(StartArgs args)
void
stop()
void
stop(java.lang.String host, int port, java.lang.String key)
Stop a running jetty instance.void
stop(java.lang.String host, int port, java.lang.String key, int timeout)
void
usage(boolean exit)
(package private) static void
usageExit(int exit)
(package private) static void
usageExit(java.lang.Throwable t, int exit, boolean test)
-
-
-
Field Detail
-
EXIT_USAGE
private static final int EXIT_USAGE
- See Also:
- Constant Field Values
-
baseHome
private BaseHome baseHome
-
jsvcStartArgs
private StartArgs jsvcStartArgs
-
-
Method Detail
-
main
public static void main(java.lang.String[] args)
-
usageExit
static void usageExit(int exit)
-
usageExit
static void usageExit(java.lang.Throwable t, int exit, boolean test)
-
copyInThread
private void copyInThread(java.io.InputStream in, java.io.OutputStream out)
-
dumpClasspathWithVersions
private void dumpClasspathWithVersions(Classpath classpath)
-
getBaseHome
public BaseHome getBaseHome()
-
getVersion
private java.lang.String getVersion(java.io.File element)
-
invokeMain
public void invokeMain(java.lang.ClassLoader classloader, StartArgs args) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException, java.lang.ClassNotFoundException, java.io.IOException
- Throws:
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException
java.lang.ClassNotFoundException
java.io.IOException
-
listConfig
public void listConfig(StartArgs args)
-
listModules
public void listModules(StartArgs args)
-
processCommandLine
public StartArgs processCommandLine(java.util.List<java.lang.String> cmdLine) throws java.lang.Exception
Convenience forprocessCommandLine(cmdLine.toArray(new String[cmdLine.size()]))
- Parameters:
cmdLine
- the command line- Returns:
- the start args parsed from the command line
- Throws:
java.lang.Exception
- if unable to process the command line
-
processCommandLine
public StartArgs processCommandLine(java.lang.String[] cmdLine) throws java.lang.Exception
- Throws:
java.lang.Exception
-
normalizeURI
private java.lang.String normalizeURI(java.lang.String uri)
-
start
public void start(StartArgs args) throws java.io.IOException, java.lang.InterruptedException
- Throws:
java.io.IOException
java.lang.InterruptedException
-
doStop
private void doStop(StartArgs args)
-
stop
public void stop(java.lang.String host, int port, java.lang.String key)
Stop a running jetty instance.- Parameters:
host
- the hostport
- the portkey
- the key
-
stop
public void stop(java.lang.String host, int port, java.lang.String key, int timeout)
-
usage
public void usage(boolean exit)
-
printTextResource
public static boolean printTextResource(java.lang.String resourceName)
-
init
public void init(java.lang.String[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
start
public void start() throws java.lang.Exception
- Throws:
java.lang.Exception
-
stop
public void stop() throws java.lang.Exception
- Throws:
java.lang.Exception
-
destroy
public void destroy()
-
-