Package org.eclipse.jetty.server
Class ShutdownMonitor
- java.lang.Object
-
- org.eclipse.jetty.server.ShutdownMonitor
-
public class ShutdownMonitor extends java.lang.ObjectShutdown/Stop Monitor thread.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.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidderegister(LifeCycle lifeCycle)static ShutdownMonitorgetInstance()java.lang.StringgetKey()intgetPort()protected booleanisAlive()booleanisExitVm()static booleanisRegistered(LifeCycle lifeCycle)static voidregister(LifeCycle... lifeCycles)protected static voidreset()voidsetDebug(boolean flag)voidsetExitVm(boolean exitVm)voidsetKey(java.lang.String key)voidsetPort(int port)protected voidstart()java.lang.StringtoString()
-
-
-
Method Detail
-
getInstance
public static ShutdownMonitor getInstance()
-
reset
protected static void reset()
-
register
public static void register(LifeCycle... lifeCycles)
-
deregister
public static void deregister(LifeCycle lifeCycle)
-
isRegistered
public static boolean isRegistered(LifeCycle lifeCycle)
-
getKey
public java.lang.String getKey()
-
getPort
public int getPort()
-
isExitVm
public boolean isExitVm()
-
setDebug
public void setDebug(boolean flag)
-
setExitVm
public void setExitVm(boolean exitVm)
- Parameters:
exitVm- true to exit the VM on shutdown
-
setKey
public void setKey(java.lang.String key)
-
setPort
public void setPort(int port)
-
start
protected void start() throws java.lang.Exception- Throws:
java.lang.Exception
-
isAlive
protected boolean isAlive()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-