net.xoetrope.optional.data.sql
Class DatabaseLifecycleListener

java.lang.Object
  extended by net.xoetrope.optional.data.sql.DatabaseLifecycleListener
All Implemented Interfaces:
XLifeCycleListener

public class DatabaseLifecycleListener
extends java.lang.Object
implements XLifeCycleListener

A shutdown/lifecycle listener designed for database like the standalone or in-memory version of HSQLDB. The listener calls SHUTDOWN on the database so as to give the database a chance to save any modified tables and records before the JVM exits. The listener is added by referencing it in the startup properties vile via the LifeCycleListener entry.

Copyright (c) Xoetrope Ltd., 2002-2006. See license.txt for license details

$Revision: 2.1 $


Field Summary
protected  XProject currentProject
           
 
Constructor Summary
DatabaseLifecycleListener()
           
 
Method Summary
 boolean canClose(XProject project)
          Can the current project close?
 void initialize(XProject project)
          Called when the application/applet has been created and initialized.
 void shutdown()
          Called when the application/applet has been shutdown and is about to exit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentProject

protected XProject currentProject
Constructor Detail

DatabaseLifecycleListener

public DatabaseLifecycleListener()
Method Detail

initialize

public void initialize(XProject project)
Called when the application/applet has been created and initialized. Does nothing in this instance

Specified by:
initialize in interface XLifeCycleListener
Parameters:
project - the owner project

shutdown

public void shutdown()
Called when the application/applet has been shutdown and is about to exit. Calls SHUTDOWN on the database

Specified by:
shutdown in interface XLifeCycleListener

canClose

public boolean canClose(XProject project)
Can the current project close?

Specified by:
canClose in interface XLifeCycleListener
Parameters:
project - the project initiating the shutdown
Returns:
true if the application can close