com.caucho.env.shutdown
Class ShutdownSystem

java.lang.Object
  extended by com.caucho.env.service.AbstractResinSubSystem
      extended by com.caucho.env.shutdown.ShutdownSystem
All Implemented Interfaces:
ResinSubSystem

public class ShutdownSystem
extends AbstractResinSubSystem

The ShutdownSystem manages the Resin shutdown and includes a timeout thread. If the timeout takes longer than shutdown-wait-max, the ShutdownSystem will force a JVM exit.


Field Summary
static int START_PRIORITY
           
 
Fields inherited from interface com.caucho.env.service.ResinSubSystem
START_PRIORITY_CACHE_SERVICE, START_PRIORITY_CLASSLOADER, START_PRIORITY_CLUSTER_SERVICE, START_PRIORITY_DEFAULT, START_PRIORITY_ENV_SYSTEM, START_PRIORITY_NETWORK_CLUSTER
 
Method Summary
static ShutdownSystem createAndAddService()
           
static ShutdownSystem createAndAddService(boolean isEmbedded)
           
 void destroy()
          Destroys the service.
 void dumpThreads()
          Dump threads for debugging
static ShutdownSystem getCurrent()
           
 ExitCode getExitCode()
           
 LifecycleState getLifecycleState()
          Returns the current lifecycle state.
 long getShutdownWaitMax()
           
 int getStartPriority()
          Returns the start priority of the service, used to determine which services to start first.
 boolean isShutdownOnOutOfMemory()
           
 void setShutdownOnOutOfMemory(boolean isShutdown)
           
 void setShutdownWaitTime(long shutdownTime)
           
 void shutdown(ExitCode exitCode, java.lang.String msg)
          Start the server shutdown
static void shutdownActive(ExitCode exitCode, java.lang.String msg)
          Start the server shutdown
static void shutdownOutOfMemory(java.lang.String msg)
          Start the server shutdown
 void start()
          Starts the server.
static void startFailsafe(java.lang.String msg)
           
 void startFailSafeShutdown(java.lang.String msg)
           
 void startFailSafeShutdown(java.lang.String msg, long period)
           
 void stop()
          Starts the server.
 java.lang.String toString()
           
 
Methods inherited from class com.caucho.env.service.AbstractResinSubSystem
getStopPriority, preCreate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

START_PRIORITY

public static final int START_PRIORITY
See Also:
Constant Field Values
Method Detail

createAndAddService

public static ShutdownSystem createAndAddService()

createAndAddService

public static ShutdownSystem createAndAddService(boolean isEmbedded)

getCurrent

public static ShutdownSystem getCurrent()

getShutdownWaitMax

public long getShutdownWaitMax()

setShutdownWaitTime

public void setShutdownWaitTime(long shutdownTime)

setShutdownOnOutOfMemory

public void setShutdownOnOutOfMemory(boolean isShutdown)

isShutdownOnOutOfMemory

public boolean isShutdownOnOutOfMemory()

getLifecycleState

public LifecycleState getLifecycleState()
Returns the current lifecycle state.


getExitCode

public ExitCode getExitCode()

shutdownOutOfMemory

public static void shutdownOutOfMemory(java.lang.String msg)
Start the server shutdown


startFailsafe

public static void startFailsafe(java.lang.String msg)

shutdownActive

public static void shutdownActive(ExitCode exitCode,
                                  java.lang.String msg)
Start the server shutdown


shutdown

public void shutdown(ExitCode exitCode,
                     java.lang.String msg)
Start the server shutdown


startFailSafeShutdown

public void startFailSafeShutdown(java.lang.String msg)

startFailSafeShutdown

public void startFailSafeShutdown(java.lang.String msg,
                                  long period)

dumpThreads

public void dumpThreads()
Dump threads for debugging


getStartPriority

public int getStartPriority()
Description copied from interface: ResinSubSystem
Returns the start priority of the service, used to determine which services to start first.

Specified by:
getStartPriority in interface ResinSubSystem
Overrides:
getStartPriority in class AbstractResinSubSystem

start

public void start()
Starts the server.

Specified by:
start in interface ResinSubSystem
Overrides:
start in class AbstractResinSubSystem

stop

public void stop()
Starts the server.

Specified by:
stop in interface ResinSubSystem
Overrides:
stop in class AbstractResinSubSystem

destroy

public void destroy()
Description copied from interface: ResinSubSystem
Destroys the service.

Specified by:
destroy in interface ResinSubSystem
Overrides:
destroy in class AbstractResinSubSystem

toString

public java.lang.String toString()
Overrides:
toString in class AbstractResinSubSystem