org.melati.poem
Class PoemDatabaseFactory.PoemShutdownThread

Package class diagram package PoemDatabaseFactory.PoemShutdownThread
java.lang.Object
  extended by java.lang.Thread
      extended by org.melati.poem.PoemDatabaseFactory.PoemShutdownThread
All Implemented Interfaces:
Runnable
Enclosing class:
PoemDatabaseFactory

public static class PoemDatabaseFactory.PoemShutdownThread
extends Thread

Shutdown databases cleanly when JVM exits. This method is called in one of two ways: when the jvm exits or when a ServletContext is detroyed. Jetty, and presumably other servlet containers, registers its listeners as shutdown hooks too, so there is no way of determining which is to be executed first. If PoemDatabaseFactory has not been initialised before the ContextListener is activated then this thread will be created but will fail to register. It will then be run by the ContextListener. It may well be that the registered thread will be run before the ContextListener thread, or visa versa, so there is a synchronised variable to ensure it actually does something only the first time.

Since:
23 May 2007
Author:
timp
See Also:
PoemServletContextListener

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
PoemDatabaseFactory.PoemShutdownThread()
          Constructor.
 
Method Summary
 void run()
          
 
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
 

Constructor Detail

PoemDatabaseFactory.PoemShutdownThread

public PoemDatabaseFactory.PoemShutdownThread()
Constructor.

Method Detail

run

public void run()

Specified by:
run in interface Runnable
Overrides:
run in class Thread
See Also:
Thread.run()


Copyright © 2000-2010 PanEris. All Rights Reserved.