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_ASCII
charset.
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 org.eclipse.jetty.server.ShutdownService
components, lock
-
Method Summary
Modifier and TypeMethodDescriptionvoid
await()
Deprecated, for removal: This API element is subject to removal in a future version.No replacement.protected boolean
Deprecated, for removal: This API element is subject to removal in a future version.No replacement.protected void
bound
(ServerSocket serverSocket) Deprecated, for removal: This API element is subject to removal in a future version.Event triggered with the ServerSocket is bound.static void
deregister
(LifeCycle lifeCycle) Deprecated, for removal: This API element is subject to removal in a future version.protected static ShutdownMonitor
Deprecated, for removal: This API element is subject to removal in a future version.Get configuredShutdownMonitor
instance.static ShutdownMonitor
Deprecated, 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.int
getPort()
Deprecated, for removal: This API element is subject to removal in a future version.Get the configured port.protected boolean
isAlive()
Deprecated, for removal: This API element is subject to removal in a future version.boolean
Deprecated, for removal: This API element is subject to removal in a future version.boolean
isExitVm()
Deprecated, for removal: This API element is subject to removal in a future version.static boolean
isRegistered
(LifeCycle lifeCycle) Deprecated, for removal: This API element is subject to removal in a future version.No replacement.static void
Deprecated, for removal: This API element is subject to removal in a future version.protected static void
reset()
Deprecated, for removal: This API element is subject to removal in a future version.No replacement.void
setDebug
(boolean flag) Deprecated, for removal: This API element is subject to removal in a future version.No replacement, use SLF4J Logger at nameShutdownService
void
setExitVm
(boolean exitVm) Deprecated, for removal: This API element is subject to removal in a future version.No replacement.void
Deprecated, for removal: This API element is subject to removal in a future version.No replacement.void
setPort
(int port) Deprecated, for removal: This API element is subject to removal in a future version.No replacement.void
start()
Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class org.eclipse.jetty.server.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 configuredShutdownMonitor
instance.- 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
ShutdownMonitor
based 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 nameShutdownService
Does 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:
isExitVm
in classShutdownService
-
getPort
public int getPort()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:ShutdownService
Get the configured port.If configured for port 0, then the automatically allocated port is available on
ShutdownService.getLocalPort()
- Overrides:
getPort
in 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:
getKey
in classShutdownService
-
start
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
start
in classShutdownService
- Throws:
Exception
-
bound
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:ShutdownService
Event triggered with the ServerSocket is bound.- Overrides:
bound
in 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.
-
ShutdownService
component, which is not a singleton.