org.objectweb.cjdbc.controller.shutdown
Class VirtualDatabaseShutdownThread

java.lang.Object
  extended byorg.objectweb.cjdbc.controller.shutdown.ShutdownThread
      extended byorg.objectweb.cjdbc.controller.shutdown.VirtualDatabaseShutdownThread
All Implemented Interfaces:
java.lang.Runnable

public class VirtualDatabaseShutdownThread
extends ShutdownThread

Executes all the work for shutting down a virtual database. This implies waiting for current clients to finish their transaction or disconnect them. Shutdown databases by shutting down backends and storing checkpoints

Version:
1.0
Author:
Nicolas Modrzyk

Field Summary
(package private)  VirtualDatabase database
           
(package private)  int shutdownLevel
           
 
Fields inherited from class org.objectweb.cjdbc.controller.shutdown.ShutdownThread
BACKEND, CONTROLLER, DATABASE, logger, name, type
 
Constructor Summary
VirtualDatabaseShutdownThread(VirtualDatabase db, int ilevel)
          Prepare the thread for shutting down.
 
Method Summary
private  void shutdownBackends(java.lang.String checkpoint)
           
 void shutdownFast()
          Wait for all clients to finish transaction and then force disconnection.
 void shutdownImmediate()
          Force immediate shutdown.
 void shutdownSmart()
          Wait for all clients to finish transaction and disconnect.
private  void terminateClients()
           
private  void waitForDisconnectClients()
           
 
Methods inherited from class org.objectweb.cjdbc.controller.shutdown.ShutdownThread
abortShutdown, finish, getShutdownLevel, getShutdownType, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

database

VirtualDatabase database

shutdownLevel

int shutdownLevel
Constructor Detail

VirtualDatabaseShutdownThread

public VirtualDatabaseShutdownThread(VirtualDatabase db,
                                     int ilevel)
Prepare the thread for shutting down.

Parameters:
db - the database to shutdown
ilevel - the level Smart,Fast,Immediate
Method Detail

shutdownFast

public void shutdownFast()
                  throws ShutdownException
Description copied from class: ShutdownThread
Wait for all clients to finish transaction and then force disconnection. Then disable backends for checkpoint. This shutdown method does not need recovery.

Specified by:
shutdownFast in class ShutdownThread
Throws:
ShutdownException - if fails
See Also:
ShutdownThread.shutdownFast()

shutdownImmediate

public void shutdownImmediate()
                       throws ShutdownException
Description copied from class: ShutdownThread
Force immediate shutdown. This method needs recovery at next start up.

Specified by:
shutdownImmediate in class ShutdownThread
Throws:
ShutdownException - if fails
See Also:
ShutdownThread.shutdownImmediate()

shutdownSmart

public void shutdownSmart()
                   throws ShutdownException
Description copied from class: ShutdownThread
Wait for all clients to finish transaction and disconnect. Then disable all backends for checkpoints.

Specified by:
shutdownSmart in class ShutdownThread
Throws:
ShutdownException - if fails
See Also:
ShutdownThread.shutdownSmart()

terminateClients

private void terminateClients()
                       throws ShutdownException
Throws:
ShutdownException

waitForDisconnectClients

private void waitForDisconnectClients()
                               throws ShutdownException
Throws:
ShutdownException

shutdownBackends

private void shutdownBackends(java.lang.String checkpoint)
                       throws ShutdownException
Throws:
ShutdownException


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