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

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

public abstract class ShutdownThread
extends java.lang.Object
implements java.lang.Runnable

Skeleton for shutdown threads. This includes Controller, VirtualDatabase and DatabaseBackend shutdown threads.

Author:
Nicolas Modrzyk

Field Summary
static java.lang.String BACKEND
          Backend Thread
static java.lang.String CONTROLLER
          Controller Thread
static java.lang.String DATABASE
          Database Thread
(package private)  Trace logger
          Logger instance.
protected  java.lang.String name
           
 java.lang.ThreadGroup shutdownGroup
          Group to join onto when shutting down
protected  int shutdownLevel
           
protected  java.lang.String type
           
 
Constructor Summary
ShutdownThread(int level, java.lang.String type, java.lang.String name)
          Create a new shutdown thread
 
Method Summary
 void abortShutdown(java.lang.Exception cause)
          If shutdown fails ...
protected  void beforeShutdown()
           
 java.lang.ThreadGroup getShutdownGroup()
          Returns the shutdownGroup value.
 int getShutdownLevel()
          Get shutdown level
 java.lang.String getShutdownType()
          Get shutdown type
protected  void postShutdown()
           
 void run()
          Execute the shutdown
abstract  void shutdownFast()
          Wait for all clients to finish transaction and then force disconnection.
abstract  void shutdownImmediate()
          Force immediate shutdown.
abstract  void shutdownSmart()
          Wait for all clients to finish transaction and disconnect.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTROLLER

public static final java.lang.String CONTROLLER
Controller Thread

See Also:
Constant Field Values

DATABASE

public static final java.lang.String DATABASE
Database Thread

See Also:
Constant Field Values

BACKEND

public static final java.lang.String BACKEND
Backend Thread

See Also:
Constant Field Values

shutdownGroup

public java.lang.ThreadGroup shutdownGroup
Group to join onto when shutting down


shutdownLevel

protected int shutdownLevel

logger

Trace logger
Logger instance.


type

protected java.lang.String type

name

protected java.lang.String name
Constructor Detail

ShutdownThread

public ShutdownThread(int level,
                      java.lang.String type,
                      java.lang.String name)
Create a new shutdown thread

Parameters:
level - Immediate,Smart,Fast
type - of shutdown thread for logging
name - of element to shutdown
Method Detail

run

public void run()
Execute the shutdown

Specified by:
run in interface java.lang.Runnable
See Also:
Runnable.run()

beforeShutdown

protected void beforeShutdown()

postShutdown

protected void postShutdown()

getShutdownType

public java.lang.String getShutdownType()
Get shutdown type

Returns:
controller,database or backend

getShutdownLevel

public int getShutdownLevel()
Get shutdown level

Returns:
level

abortShutdown

public void abortShutdown(java.lang.Exception cause)
If shutdown fails ...

Parameters:
cause - why shutdown was aborted

shutdownSmart

public abstract void shutdownSmart()
                            throws ShutdownException
Wait for all clients to finish transaction and disconnect. Then disable all backends for checkpoints.

Throws:
ShutdownException - if fails

shutdownFast

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

Throws:
ShutdownException - if fails

shutdownImmediate

public abstract void shutdownImmediate()
                                throws ShutdownException
Force immediate shutdown. This method needs recovery at next start up.

Throws:
ShutdownException - if fails

getShutdownGroup

public java.lang.ThreadGroup getShutdownGroup()
Returns the shutdownGroup value.

Returns:
Returns the shutdownGroup.


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