Top Description Constructors Methods
org.apache.derby.impl.services.monitor

pack-priv final Class ServiceBootContext

extends ContextImpl
Class Inheritance
Imports
org.apache.derby.iapi.services.context.ContextManager, .ContextImpl, org.apache.derby.shared.common.error.ExceptionSeverity

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

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
cleanupOnError(Throwable
The original error
t
)

Implements org.apache.derby.iapi.services.context.Context.cleanupOnError.

Contexts will be passed errors that are caught by the outer system when they are serious enough to require corrective action.

public boolean
isLastHandler(int
The severity level
severity
)

Overrides org.apache.derby.iapi.services.context.ContextImpl.isLastHandler.

Implements org.apache.derby.iapi.services.context.Context.isLastHandler.

Return whether or not this context is the "last" handler for a the specified severity level.

Inherited from org.apache.derby.iapi.services.context.ContextImpl:
appendErrorInfogetContextManagergetIdNamepopMepushMe

Constructor Detail

ServiceBootContextback to summary
pack-priv ServiceBootContext(ContextManager cm)

Method Detail

cleanupOnErrorback to summary
public void cleanupOnError(Throwable t)

Implements org.apache.derby.iapi.services.context.Context.cleanupOnError.

Doc from org.apache.derby.iapi.services.context.Context.cleanupOnError.

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.
On an exception that is session severity or greater the Context must push itself off the stack. This is to ensure that after a session has been closed there are no Contexts on the stack that potentially hold references to objects, thus delaying their garbage collection.

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).

Parameters
t:Throwable

The original error

isLastHandlerback to summary
public boolean isLastHandler(int severity)

Overrides org.apache.derby.iapi.services.context.ContextImpl.isLastHandler.

Implements org.apache.derby.iapi.services.context.Context.isLastHandler.

Doc from org.apache.derby.iapi.services.context.Context.isLastHandler.

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.

Parameters
severity:int

The severity level

Returns:boolean

whether or not this context is the "last" handler for a severity level