org.melati.poem
Class PoemDatabaseFactory.PoemShutdownThread
java.lang.Object
java.lang.Thread
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
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 |
PoemDatabaseFactory.PoemShutdownThread
public PoemDatabaseFactory.PoemShutdownThread()
- Constructor.
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.