org.mortbay.jetty
Class Server.ShutdownHookThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.mortbay.jetty.Server.ShutdownHookThread
All Implemented Interfaces:
Runnable
Enclosing class:
Server

private static class Server.ShutdownHookThread
extends Thread

ShutdownHook thread for stopping all servers. Thread is hooked first time list of servers is changed.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
private  boolean hooked
           
private  ArrayList servers
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
private Server.ShutdownHookThread()
           
 
Method Summary
 boolean add(Server server)
          Add Server to servers list.
 boolean addAll(Collection c)
          Append all Servers from Collection
 void clear()
          Clear list of Servers.
 boolean contains(Server server)
          Contains Server in servers list?
private  void createShutdownHook()
          Hooks this thread for shutdown.
 boolean remove(Server server)
          Remove Server from list.
 boolean removeAll(Collection c)
          Remove all Servers in Collection from list.
 void run()
          Stop all Servers in list.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

hooked

private boolean hooked

servers

private ArrayList servers
Constructor Detail

Server.ShutdownHookThread

private Server.ShutdownHookThread()
Method Detail

createShutdownHook

private void createShutdownHook()
Hooks this thread for shutdown.

See Also:
Runtime.addShutdownHook(java.lang.Thread)

add

public boolean add(Server server)
Add Server to servers list.


contains

public boolean contains(Server server)
Contains Server in servers list?


addAll

public boolean addAll(Collection c)
Append all Servers from Collection


clear

public void clear()
Clear list of Servers.


remove

public boolean remove(Server server)
Remove Server from list.


removeAll

public boolean removeAll(Collection c)
Remove all Servers in Collection from list.


run

public void run()
Stop all Servers in list.

Specified by:
run in interface Runnable
Overrides:
run in class Thread