Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

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

Inheritance diagram for org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 ShutdownThread (int level)
ThreadGroup getShutdownGroup ()
int getShutdownLevel ()
void run ()
void abortShutdown (Exception cause)
abstract void shutdown () throws ShutdownException

Public Attributes

ThreadGroup shutdownGroup = new ThreadGroup("shutdown" + new Date())

Protected Attributes

int shutdownLevel

Package Attributes

Trace logger

Detailed Description

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

Author:
Emmanuel Cecchet

Nicolas Modrzyk

Definition at line 41 of file ShutdownThread.java.


Constructor & Destructor Documentation

org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread.ShutdownThread int  level  ) 
 

Create a new shutdown thread

Parameters:
level Constants.SHUTDOWN_WAIT, Constants.SHUTDOWN_SAFE or Constants.SHUTDOWN_FORCE

Definition at line 58 of file ShutdownThread.java.

References org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread.logger.

00059   {
00060     this.shutdownLevel = level;
00061     logger = Trace.getLogger("org.objectweb.cjdbc.controller.shutdown");
00062   }


Member Function Documentation

void org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread.abortShutdown Exception  cause  ) 
 

If shutdown fails ...

Parameters:
cause why shutdown was aborted

Definition at line 107 of file ShutdownThread.java.

References org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread.logger.

Referenced by org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread.run().

00108   {
00109     logger.info(Translate.get("controller.shutdown.aborted", cause));
00110   }

ThreadGroup org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread.getShutdownGroup  ) 
 

Returns the shutdownGroup value.

Returns:
Returns the shutdownGroup.

Definition at line 69 of file ShutdownThread.java.

Referenced by org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.shutdown(), and org.objectweb.cjdbc.controller.core.Controller.shutdown().

00070   {
00071     return shutdownGroup;
00072   }

int org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread.getShutdownLevel  ) 
 

Get shutdown level

Returns:
level

Definition at line 79 of file ShutdownThread.java.

00080   {
00081     return this.shutdownLevel;
00082   }

void org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread.run  ) 
 

Execute the shutdown

See also:
java.lang.Runnable#run()

Definition at line 89 of file ShutdownThread.java.

References org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread.abortShutdown(), and org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread.shutdown().

00090   {
00091     try
00092     {
00093       shutdown();
00094     }
00095     catch (ShutdownException se)
00096     {
00097       se.printStackTrace();
00098       abortShutdown(se);
00099     }
00100   }

abstract void org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread.shutdown  )  throws ShutdownException [pure virtual]
 

Specific implementation of the shutdown method.

Exceptions:
ShutdownException if fails

Implemented in org.objectweb.cjdbc.controller.core.shutdown.ControllerForceShutdownThread, org.objectweb.cjdbc.controller.core.shutdown.ControllerSafeShutdownThread, org.objectweb.cjdbc.controller.core.shutdown.ControllerWaitShutdownThread, org.objectweb.cjdbc.controller.core.shutdown.VirtualDatabaseForceShutdownThread, org.objectweb.cjdbc.controller.core.shutdown.VirtualDatabaseSafeShutdownThread, and org.objectweb.cjdbc.controller.core.shutdown.VirtualDatabaseWaitShutdownThread.

Referenced by org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread.run().


Member Data Documentation

Trace org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread.logger [package]
 

Initial value:

 Trace
                                       .getLogger("org.objectweb.cjdbc.controller.shutdown")
Logger instance.

Definition at line 49 of file ShutdownThread.java.

Referenced by org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread.abortShutdown(), and org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread.ShutdownThread().

ThreadGroup org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread.shutdownGroup = new ThreadGroup("shutdown" + new Date())
 

Group to join onto when shutting down

Definition at line 44 of file ShutdownThread.java.


The documentation for this class was generated from the following file:
Generated on Mon Apr 11 22:03:48 2005 for C-JDBC by  doxygen 1.3.9.1