Top Description Constructors Methods
org.apache.derby.iapi.services.context

pack-priv final Class SystemContext

extends ContextImpl
Class Inheritance
Imports
org.apache.derby.shared.common.error.ShutdownException, .StandardException, .ExceptionSeverity, org.apache.derby.iapi.services.monitor.ModuleFactory, .Monitor

A context that shuts the system down if it gets an StandardException with a severity greater than or equal to ExceptionSeverity.SYSTEM_SEVERITY or an exception that is not a StandardException.

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.

private static ModuleFactory
getMonitor()

Must be private so that user code can't call this entry point.

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

Constructor Detail

SystemContextback to summary
pack-priv SystemContext(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

Annotations
@SuppressWarnings:removal
getMonitorback to summary
private static ModuleFactory getMonitor()

Must be private so that user code can't call this entry point.