org.objectweb.cjdbc.controller.core.shutdown
Class VirtualDatabaseShutdownThread

java.lang.Object
  extended byorg.objectweb.cjdbc.controller.core.shutdown.ShutdownThread
      extended byorg.objectweb.cjdbc.controller.core.shutdown.VirtualDatabaseShutdownThread
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
VirtualDatabaseForceShutdownThread, VirtualDatabaseSafeShutdownThread, VirtualDatabaseWaitShutdownThread

public abstract class VirtualDatabaseShutdownThread
extends ShutdownThread

Abstract class for all implementations of virtual database shutdown strategies.

Version:
1.0
Author:
Nicolas Modrzyk , Emmanuel Cecchet

Field Summary
protected  VirtualDatabase virtualDatabase
           
 
Fields inherited from class org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread
logger, shutdownGroup, shutdownLevel
 
Constructor Summary
VirtualDatabaseShutdownThread(VirtualDatabase vdb, int level)
          Prepare the thread for shutting down.
 
Method Summary
protected  void disableAllBackends()
          Disable all database backends with a checkpoint named after the current time if a recovery log is available.
protected  void shutdownCacheRecoveryLogAndGroupCommunication()
          Shutdown the result cache, recovery log and close the distributed virtual database group communication channel (if the virtual database is distributed).
protected  void terminateVirtualDatabaseWorkerThreads()
          Terminate the VirtualDatabaseWorkerThreads
protected  void waitForClientsToDisconnect()
          Wait for all VirtualDatabaseWorkerThreads to terminate when all clients have disconnected.
protected  void waitForTransactionsAndWritesToComplete()
          Wait for currently open transactions and pending writes to complete (in this order: 1.transaction, 2.writes).
 
Methods inherited from class org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread
abortShutdown, getShutdownGroup, getShutdownLevel, run, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

virtualDatabase

protected VirtualDatabase virtualDatabase
Constructor Detail

VirtualDatabaseShutdownThread

public VirtualDatabaseShutdownThread(VirtualDatabase vdb,
                                     int level)
Prepare the thread for shutting down.

Parameters:
vdb - the database to shutdown
level - Constants.SHUTDOWN_WAIT, Constants.SHUTDOWN_SAFE or Constants.SHUTDOWN_FORCE
Method Detail

shutdownCacheRecoveryLogAndGroupCommunication

protected void shutdownCacheRecoveryLogAndGroupCommunication()
Shutdown the result cache, recovery log and close the distributed virtual database group communication channel (if the virtual database is distributed).


disableAllBackends

protected void disableAllBackends()
Disable all database backends with a checkpoint named after the current time if a recovery log is available.


terminateVirtualDatabaseWorkerThreads

protected void terminateVirtualDatabaseWorkerThreads()
Terminate the VirtualDatabaseWorkerThreads


waitForClientsToDisconnect

protected void waitForClientsToDisconnect()
Wait for all VirtualDatabaseWorkerThreads to terminate when all clients have disconnected.


waitForTransactionsAndWritesToComplete

protected void waitForTransactionsAndWritesToComplete()
Wait for currently open transactions and pending writes to complete (in this order: 1.transaction, 2.writes).



Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.