This thread listens on the host/port specified by the STOP.HOST/STOP.PORT system parameter (defaults to 127.0.0.1/-1 for not listening) for request authenticated with the key given by the STOP.KEY system parameter for admin requests.
If the stop port is set to zero, then a random port is assigned and the port number is printed to stdout.
Commands "stop" and "status" are currently supported.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private class | ShutdownMonitor.
Thread for listening to STOP.PORT for command to stop Jetty. |
| Modifier and Type | Field and Description |
|---|---|
| private final Set | |
| private final AutoLock. | |
| private boolean | |
| private boolean | |
| private boolean | |
| private final String | |
| private String | |
| private int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | |
| private boolean | |
| private void | |
| private void | |
| public static void | |
| public static ShutdownMonitor | |
| public String | |
| public int | |
| protected boolean | |
| public boolean | |
| public static boolean | |
| private ServerSocket | |
| public static void | |
| private void | |
| protected static void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| private void | |
| public String |
| _lifeCycles | back to summary |
|---|---|
| private final Set<LifeCycle> _lifeCycles | |
| _lock | back to summary |
|---|---|
| private final AutoLock. | |
| alive | back to summary |
|---|---|
| private boolean alive | |
| debug | back to summary |
|---|---|
| private boolean debug | |
| exitVm | back to summary |
|---|---|
| private boolean exitVm | |
| host | back to summary |
|---|---|
| private final String host | |
| key | back to summary |
|---|---|
| private String key | |
| port | back to summary |
|---|---|
| private int port | |
| ShutdownMonitor | back to summary |
|---|---|
| private ShutdownMonitor() Creates a ShutdownMonitor using configuration from the System properties.
Note server socket will only listen on localhost, and a successful stop will issue a System.exit() call. | |
| addLifeCycles | back to summary |
|---|---|
| private void addLifeCycles(LifeCycle... lifeCycles) | |
| await | back to summary |
|---|---|
| public void await() throws InterruptedException | |
| containsLifeCycle | back to summary |
|---|---|
| private boolean containsLifeCycle(LifeCycle lifeCycle) | |
| debug | back to summary |
|---|---|
| private void debug(String format, Object... args) | |
| debug | back to summary |
|---|---|
| private void debug(Throwable t) | |
| deregister | back to summary |
|---|---|
| public static void deregister(LifeCycle lifeCycle) | |
| getInstance | back to summary |
|---|---|
| public static ShutdownMonitor getInstance() | |
| getKey | back to summary |
|---|---|
| public String getKey() | |
| getPort | back to summary |
|---|---|
| public int getPort() | |
| isAlive | back to summary |
|---|---|
| protected boolean isAlive() | |
| isExitVm | back to summary |
|---|---|
| public boolean isExitVm() | |
| isRegistered | back to summary |
|---|---|
| public static boolean isRegistered(LifeCycle lifeCycle) | |
| listen | back to summary |
|---|---|
| private ServerSocket listen() | |
| register | back to summary |
|---|---|
| public static void register(LifeCycle... lifeCycles) | |
| removeLifeCycle | back to summary |
|---|---|
| private void removeLifeCycle(LifeCycle lifeCycle) | |
| reset | back to summary |
|---|---|
| protected static void reset() | |
| setDebug | back to summary |
|---|---|
| public void setDebug(boolean flag) | |
| setExitVm | back to summary |
|---|---|
| public void setExitVm(boolean exitVm) Set true to exit the VM on shutdown.
| |
| setKey | back to summary |
|---|---|
| public void setKey(String key) | |
| setPort | back to summary |
|---|---|
| public void setPort(int port) | |
| start | back to summary |
|---|---|
| public void start() throws Exception | |
| stop | back to summary |
|---|---|
| private void stop() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static ShutdownMonitor |
| Access | Constructor and Description |
|---|---|
| private |
| instance | back to summary |
|---|---|
| pack-priv static ShutdownMonitor instance | |
| Holder | back to summary |
|---|---|
| private Holder() | |
| Modifier and Type | Field and Description |
|---|---|
| private final ServerSocket |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | |
| private void |
| serverSocket | back to summary |
|---|---|
| private final ServerSocket serverSocket | |
| ShutdownMonitorRunnable | back to summary |
|---|---|
| private ShutdownMonitorRunnable(ServerSocket serverSocket) | |
| informClient | back to summary |
|---|---|
| private void informClient(OutputStream out, String message) throws IOException | |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |
| stopLifeCycles | back to summary |
|---|---|
| private void stopLifeCycles(Predicate<LifeCycle> predicate, boolean destroy) | |