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

java.lang.Object
  extended byorg.objectweb.cjdbc.controller.core.shutdown.ShutdownThread
      extended byorg.objectweb.cjdbc.controller.core.shutdown.ControllerShutdownThread
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
ControllerForceShutdownThread, ControllerSafeShutdownThread, ControllerWaitShutdownThread

public abstract class ControllerShutdownThread
extends ShutdownThread

Abstract class for all implementations of controller shutdown strategies.

Version:
1.2
Author:
Nicolas Modrzyk , Emmanuel Cecchet

Field Summary
protected  Controller controller
           
 
Fields inherited from class org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread
logger, shutdownGroup, shutdownLevel
 
Constructor Summary
ControllerShutdownThread(Controller controller, int level)
          Prepare the thread for shutting down.
 
Method Summary
protected  void generateReportIfNeeded()
          Generate a controller report if it has been enabled in the config file.
protected  void shutdownDatabases()
          Shutdown all databases of this controller using the current shutdown level.
protected  void shutdownJmxAgent()
          Shutdown the JMX Agent.
protected  void shutdownServerConnectionThread(int joinTimeoutInMillis)
          Shutdown the ControllerServerThread and its attached connection to reject new incoming connections.
 
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

controller

protected Controller controller
Constructor Detail

ControllerShutdownThread

public ControllerShutdownThread(Controller controller,
                                int level)
Prepare the thread for shutting down.

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

shutdownJmxAgent

protected void shutdownJmxAgent()
Shutdown the JMX Agent.


shutdownDatabases

protected void shutdownDatabases()
Shutdown all databases of this controller using the current shutdown level.


shutdownServerConnectionThread

protected void shutdownServerConnectionThread(int joinTimeoutInMillis)
                                       throws ShutdownException
Shutdown the ControllerServerThread and its attached connection to reject new incoming connections.

Parameters:
joinTimeoutInMillis - timeout in milliseconds to wait for controller server thread termination. A timeout of 0 means wait forever.
Throws:
ShutdownException - if an error occurs

generateReportIfNeeded

protected void generateReportIfNeeded()
Generate a controller report if it has been enabled in the config file.



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