Public Member Functions | |
ControllerShutdownThread (Controller controller, int level) | |
Protected Member Functions | |
void | shutdownJmxAgent () |
void | shutdownDatabases () |
void | shutdownServerConnectionThread (int joinTimeoutInMillis) throws ShutdownException |
void | generateReportIfNeeded () |
Protected Attributes | |
Controller | controller |
Definition at line 46 of file ControllerShutdownThread.java.
|
Prepare the thread for shutting down.
Definition at line 57 of file ControllerShutdownThread.java. 00058 {
00059 super(level);
00060 this.controller = controller;
00061 }
|
|
|
Shutdown all databases of this controller using the current shutdown level. Definition at line 85 of file ControllerShutdownThread.java. References org.objectweb.cjdbc.common.log.Trace.error(), org.objectweb.cjdbc.controller.core.Controller.getVirtualDatabases(), and org.objectweb.cjdbc.common.log.Trace.info(). Referenced by org.objectweb.cjdbc.controller.core.shutdown.ControllerWaitShutdownThread.shutdown(), org.objectweb.cjdbc.controller.core.shutdown.ControllerSafeShutdownThread.shutdown(), and org.objectweb.cjdbc.controller.core.shutdown.ControllerForceShutdownThread.shutdown(). 00086 { 00087 logger.info("Shutting down databases"); 00088 try 00089 { 00090 //Shutdown each virtual database with proper level 00091 ArrayList listvb = controller.getVirtualDatabases(); 00092 int nbvb = listvb.size(); 00093 for (int i = 0; i < nbvb; i++) 00094 { 00095 logger.info("Shutting down database:" 00096 + ((VirtualDatabase) listvb.get(i)).getVirtualDatabaseName() 00097 + " with level:" + this.shutdownLevel); 00098 ((VirtualDatabase) listvb.get(i)).shutdown(this.shutdownLevel); 00099 logger.info("Database:" 00100 + ((VirtualDatabase) listvb.get(i)).getVirtualDatabaseName() 00101 + " is shutdown"); 00102 } 00103 } 00104 catch (Exception e) 00105 { 00106 logger.error(Translate.get("controller.shutdown.database.error", e)); 00107 } 00108 }
|
|
Shutdown the JMX Agent. Definition at line 66 of file ControllerShutdownThread.java. References org.objectweb.cjdbc.common.log.Trace.error(), org.objectweb.cjdbc.controller.core.Controller.getJmxEnable(), and org.objectweb.cjdbc.common.log.Trace.info(). Referenced by org.objectweb.cjdbc.controller.core.shutdown.ControllerWaitShutdownThread.shutdown(), org.objectweb.cjdbc.controller.core.shutdown.ControllerSafeShutdownThread.shutdown(), and org.objectweb.cjdbc.controller.core.shutdown.ControllerForceShutdownThread.shutdown(). 00067 { 00068 logger.info("Shutting down Jmx Agent"); 00069 try 00070 { 00071 if (controller.getJmxEnable()) 00072 MBeanServerManager.setJmxEnabled(false); 00073 } 00074 catch (Exception jme) 00075 { 00076 logger.error(Translate.get("controller.shutdown.jmx.error", jme 00077 .getMessage()), jme); 00078 //throw new ShutdownException(jme); 00079 } 00080 }
|
|
Shutdown the ControllerServerThread and its attached connection to reject new incoming connections.
Definition at line 118 of file ControllerShutdownThread.java. References org.objectweb.cjdbc.common.log.Trace.debug(), org.objectweb.cjdbc.controller.core.Controller.getConnectionThread(), org.objectweb.cjdbc.common.log.Trace.info(), org.objectweb.cjdbc.common.log.Trace.isDebugEnabled(), org.objectweb.cjdbc.controller.core.ControllerServerThread.isShuttingDown, and org.objectweb.cjdbc.controller.core.ControllerServerThread.shutdown(). Referenced by org.objectweb.cjdbc.controller.core.shutdown.ControllerWaitShutdownThread.shutdown(), org.objectweb.cjdbc.controller.core.shutdown.ControllerSafeShutdownThread.shutdown(), and org.objectweb.cjdbc.controller.core.shutdown.ControllerForceShutdownThread.shutdown(). 00120 { 00121 if (logger.isDebugEnabled()) 00122 logger.debug("Shutting down ControllerServerThread"); 00123 try 00124 { 00125 // Shutdown Server Connections Thread 00126 ControllerServerThread thread = controller.getConnectionThread(); 00127 if (thread != null && !thread.isShuttingDown()) 00128 { 00129 thread.shutdown(); 00130 logger.info("Waiting for controller thread termination."); 00131 thread.join(joinTimeoutInMillis); 00132 } 00133 } 00134 catch (Exception e) 00135 { 00136 throw new ShutdownException(e); 00137 } 00138 }
|