1 21 22 package org.apache.derby.iapi.services.context; 23 24 import org.apache.derby.iapi.error.StandardException; 25 import org.apache.derby.iapi.services.monitor.Monitor; 26 import org.apache.derby.iapi.error.ExceptionSeverity; 27 32 final class SystemContext extends ContextImpl 33 { 34 SystemContext(ContextManager cm) { 35 super(cm, "SystemContext"); 36 } 37 38 public void cleanupOnError(Throwable t) { 39 40 boolean doShutdown = false; 41 if (t instanceof StandardException) { 42 StandardException se = (StandardException) t; 43 int severity = se.getSeverity(); 44 if (severity < ExceptionSeverity.SESSION_SEVERITY) 45 return; 46 47 popMe(); 48 49 if (severity >= ExceptionSeverity.SYSTEM_SEVERITY) 50 doShutdown = true; 51 } else if (t instanceof ShutdownException) { 52 } else if (t instanceof ThreadDeath ) { 54 } 58 59 if (!doShutdown) { 60 getContextManager().owningCsf.removeContext(getContextManager()); 63 return; 64 } 65 66 67 try { 68 System.err.println("Shutting down due to severe error."); 71 Monitor.getStream().printlnWithHeader("Shutting down due to severe error." + t.getMessage()); 72 73 } finally { 74 Monitor.getMonitor().shutdown(); 76 } 77 78 } 79 80 } 81 82 | Popular Tags |