org.apache.derby.impl.services.monitor
Class ServiceBootContext

java.lang.Object
  extended byorg.apache.derby.iapi.services.context.ContextImpl
      extended byorg.apache.derby.impl.services.monitor.ServiceBootContext
All Implemented Interfaces:
Context

class ServiceBootContext
extends ContextImpl

A context that is used during a service boot to stop cleanup on the stack at this point.


Field Summary
 
Fields inherited from class org.apache.derby.iapi.services.context.ContextImpl
 
Constructor Summary
(package private) ServiceBootContext(ContextManager cm)
           
 
Method Summary
 void cleanupOnError(java.lang.Throwable t)
          Contexts will be passed errors that are caught by the outer system when they are serious enough to require corrective action.
 boolean isLastHandler(int severity)
          Return whether or not this context is the "last" handler for a the specified severity level.
 
Methods inherited from class org.apache.derby.iapi.services.context.ContextImpl
appendErrorInfo, getContextManager, getIdName, popMe, pushMe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceBootContext

ServiceBootContext(ContextManager cm)
Method Detail

cleanupOnError

public void cleanupOnError(java.lang.Throwable t)
Description copied from interface: Context
Contexts will be passed errors that are caught by the outer system when they are serious enough to require corrective action. They will be told what the error is, so that they can react appropriately. Most of the time, the contexts will react by either doing nothing or by removing themselves from the context manager. If there are no other references to the context, removing itself from the manager equates to freeing it.

Contexts must release all their resources before removing themselves from their context manager.

The context manager will "unwind" the contexts during cleanup in the reverse order they were placed on its global stack.

If error is an instance of StandardException then an implementation of this method may throw a new exception if and only if the new exception is an instance of StandardException that is more severe than the original error or the new exception is a not an instance of StandardException (e.g java.lang.NullPointerException).


isLastHandler

public boolean isLastHandler(int severity)
Description copied from interface: Context
Return whether or not this context is the "last" handler for a the specified severity level. Previously, the context manager would march through all of the contexts in cleanupOnError() and call each of their cleanupOnError() methods. That did not work with server side JDBC, especially for a StatementException, because outer contexts could get cleaned up incorrectly. This functionality is specific to the Language system. Any non-language system contexts should return ExceptionSeverity.NOT_APPLICABLE_SEVERITY. NOTE: Both the LanguageConnectionContext and the JDBC Connection Context are interested in session level errors because they both have clean up to do. This method allows both of them to return false so that all such handlers under them can do their clean up.

Specified by:
isLastHandler in interface Context
Overrides:
isLastHandler in class ContextImpl
See Also:
Context.isLastHandler(int)

Built on Tue 2006-10-10 19:23:47+0200, from revision exported

Apache Derby V10.1 Engine Documentation - Copyright © 1997,2005 The Apache Software Foundation or its licensors, as applicable.