Class ShutdownMonitor

java.lang.Object
org.eclipse.jetty.server.ShutdownService
org.eclipse.jetty.server.ShutdownMonitor

@Deprecated(since="12.1.0", forRemoval=true) public class ShutdownMonitor extends ShutdownService
Deprecated, for removal: This API element is subject to removal in a future version.
Replaced with ShutdownService component, which is not a singleton.
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 to US_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 to true

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 Type
    Method
    Description
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    No replacement.
    protected boolean
    await(long time, TimeUnit unit)
    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 configured ShutdownMonitor instance.
    Deprecated, for removal: This API element is subject to removal in a future version.
    No direct replacement, see ShutdownService, which is not a singleton.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the configured port.
    protected boolean
    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
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    static boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    No replacement.
    static void
    register(LifeCycle... lifeCycles)
    Deprecated, for removal: This API element is subject to removal in a future version.
    protected static void
    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 name ShutdownService
    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
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Method Details

    • getInstance

      @Deprecated(since="12.1.0", forRemoval=true) public static ShutdownMonitor getInstance()
      Deprecated, for removal: This API element is subject to removal in a future version.
      No direct replacement, see ShutdownService, which is not a singleton.
    • getConfiguredInstance

      protected static ShutdownMonitor getConfiguredInstance()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Get configured ShutdownMonitor instance.
      1. If ShutdownMonitor.getInstance() has been called, and it has a valid configuration, return that instance.
      2. 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 to getInstance()
      Returns:
      the configured ShutdownMonitor instance, or null if not configured.
    • reset

      @Deprecated(since="12.1.0", forRemoval=true) protected static void 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(since="12.1.0", forRemoval=true) public static void register(LifeCycle... lifeCycles)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • deregister

      @Deprecated(since="12.1.0", forRemoval=true) public static void deregister(LifeCycle lifeCycle)
      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(since="12.1.0", forRemoval=true) public void setDebug(boolean flag)
      Deprecated, for removal: This API element is subject to removal in a future version.
      No replacement, use SLF4J Logger at name ShutdownService
      Does nothing.
    • setExitVm

      @Deprecated(since="12.1.0", forRemoval=true) public void setExitVm(boolean exitVm)
      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 class ShutdownService
    • 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 class ShutdownService
      Returns:
      the configured port
    • setPort

      @Deprecated(since="12.1.0", forRemoval=true) public void setPort(int port)
      Deprecated, for removal: This API element is subject to removal in a future version.
      No replacement.
    • setKey

      @Deprecated(since="12.1.0", forRemoval=true) public void setKey(String key)
      Deprecated, for removal: This API element is subject to removal in a future version.
      No replacement.
    • getKey

      public String getKey()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      getKey in class ShutdownService
    • start

      public void start() throws Exception
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      start in class ShutdownService
      Throws:
      Exception
    • bound

      protected void bound(ServerSocket serverSocket)
      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 class ShutdownService
      Parameters:
      serverSocket - the bound server socket.
    • await

      @Deprecated(since="12.1.0", forRemoval=true) public void await() 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
    • 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.