Class ShutdownMonitor
java.lang.Object
org.eclipse.jetty.server.ShutdownService
org.eclipse.jetty.server.ShutdownMonitor
Deprecated, for removal: This API element is subject to removal in a future version.
Shutdown Monitor.
This is a singleton that is only valid when the following System Properties are defined.
STOP.HOST- IP to listen on, defaults to
127.0.0.1 STOP.PORT- Port to listen on, defaults to
-1(or disabled).
(0 will use a port number that is automatically allocated) STOP.KEY- The Key that must be provided to initiate a Shutdown.
Limited toUS_ASCIIcharset.
If one is not provided, a generated Key will be created. STOP.EXIT- Boolean to indicate if a
System.exit(0)should occur on successful shutdown, defaults totrue
This starts a ServerSocket that listens on the host/port specified by
the configuration, and starts a thread to accept incoming requests.
See ShutdownService for details about commands that can be sent to
this server.
-
Field Summary
Fields inherited from class ShutdownService
components, lock -
Method Summary
Modifier and TypeMethodDescriptionvoidawait()Deprecated, for removal: This API element is subject to removal in a future version.No replacement.protected booleanDeprecated, for removal: This API element is subject to removal in a future version.No replacement.protected voidbound(ServerSocket serverSocket) Deprecated, for removal: This API element is subject to removal in a future version.Event triggered with the ServerSocket is bound.static voidderegister(LifeCycle lifeCycle) Deprecated, for removal: This API element is subject to removal in a future version.protected static ShutdownMonitorDeprecated, for removal: This API element is subject to removal in a future version.Get configuredShutdownMonitorinstance.static ShutdownMonitorDeprecated, for removal: This API element is subject to removal in a future version.No direct replacement, seeShutdownService, which is not a singleton.getKey()Deprecated, for removal: This API element is subject to removal in a future version.intgetPort()Deprecated, for removal: This API element is subject to removal in a future version.Get the configured port.protected booleanisAlive()Deprecated, for removal: This API element is subject to removal in a future version.booleanDeprecated, for removal: This API element is subject to removal in a future version.booleanisExitVm()Deprecated, for removal: This API element is subject to removal in a future version.static booleanisRegistered(LifeCycle lifeCycle) Deprecated, for removal: This API element is subject to removal in a future version.No replacement.static voidDeprecated, for removal: This API element is subject to removal in a future version.protected static voidreset()Deprecated, for removal: This API element is subject to removal in a future version.No replacement.voidsetDebug(boolean flag) Deprecated, for removal: This API element is subject to removal in a future version.No replacement, use SLF4J Logger at nameShutdownServicevoidsetExitVm(boolean exitVm) Deprecated, for removal: This API element is subject to removal in a future version.No replacement.voidDeprecated, for removal: This API element is subject to removal in a future version.No replacement.voidsetPort(int port) Deprecated, for removal: This API element is subject to removal in a future version.No replacement.voidstart()Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class ShutdownService
addComponent, configure, getHost, getLocalPort, hasComponent, isListening, removeComponent, stop, toString
-
Method Details
-
getInstance
Deprecated, for removal: This API element is subject to removal in a future version.No direct replacement, seeShutdownService, which is not a singleton. -
getConfiguredInstance
Deprecated, for removal: This API element is subject to removal in a future version.Get configuredShutdownMonitorinstance.- If
ShutdownMonitor.getInstance()has been called, and it has a valid configuration, return that instance. - If the System Properties exist, and contain a valid
configuration, return a
ShutdownMonitorbased on that configuration. (same instance will be returned by subsequent calls togetInstance()
- Returns:
- the configured ShutdownMonitor instance, or null if not configured.
- If
-
reset
Deprecated, for removal: This API element is subject to removal in a future version.No replacement.This existed for test case reasons, it was never a public runtime method. -
register
Deprecated, for removal: This API element is subject to removal in a future version. -
deregister
Deprecated, for removal: This API element is subject to removal in a future version. -
isRegistered
@Deprecated(since="12.1.0", forRemoval=true) public static boolean isRegistered(LifeCycle lifeCycle) Deprecated, for removal: This API element is subject to removal in a future version.No replacement.This existed for test case reasons, it was never a public runtime method. -
isConfigured
public boolean isConfigured()Deprecated, for removal: This API element is subject to removal in a future version. -
setDebug
Deprecated, for removal: This API element is subject to removal in a future version.No replacement, use SLF4J Logger at nameShutdownServiceDoes nothing. -
setExitVm
Deprecated, for removal: This API element is subject to removal in a future version.No replacement.Does nothing. -
isExitVm
public boolean isExitVm()Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
isExitVmin classShutdownService
-
getPort
public int getPort()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:ShutdownServiceGet the configured port.If configured for port 0, then the automatically allocated port is available on
ShutdownService.getLocalPort()- Overrides:
getPortin classShutdownService- Returns:
- the configured port
-
setPort
Deprecated, for removal: This API element is subject to removal in a future version.No replacement. -
setKey
Deprecated, for removal: This API element is subject to removal in a future version.No replacement. -
getKey
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
getKeyin classShutdownService
-
start
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
startin classShutdownService- Throws:
Exception
-
bound
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:ShutdownServiceEvent triggered with the ServerSocket is bound.- Overrides:
boundin classShutdownService- Parameters:
serverSocket- the bound server socket.
-
await
Deprecated, for removal: This API element is subject to removal in a future version.No replacement.Does nothing. This existed for test case reasons, it was never a public runtime method.- Throws:
InterruptedException
-
await
@Deprecated(since="12.1.0", forRemoval=true) protected boolean await(long time, TimeUnit unit) throws InterruptedException Deprecated, for removal: This API element is subject to removal in a future version.No replacement.Does nothing. This existed for test case reasons, it was never a public runtime method.- Throws:
InterruptedException
-
isAlive
protected boolean isAlive()Deprecated, for removal: This API element is subject to removal in a future version.
-
ShutdownServicecomponent, which is not a singleton.