We provide this abstract class for other implementations to use so that they can simply add fields and operations on them. To be usable by the context manager, the subclasses must define CleanupOnError and call super() in any constructor.
Contexts assist in cleanup when errors are caught in the outer block.
Contexts implement the sanity interface to check and provide information about their contents.
| Modifier and Type | Field and Description |
|---|---|
| private final ContextManager | |
| private final String |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public StringBuffer | |
| public final ContextManager | getContextManager()
Implements org. Returns the context manager that has stored this context in its stack. |
| public final String | getIdName()
Implements org. Returns the current id name associated with this context. |
| public boolean | isLastHandler(int
The severity level severity)Implements org. Return whether or not this context is the "last" handler for a the specified severity level. |
| public final void | popMe()
Implements org. Pop myself of the context stack. |
| public final void | pushMe()
Implements org. Push myself onto my context stack. |
| myContextManager | back to summary |
|---|---|
| private final ContextManager myContextManager | |
| myIdName | back to summary |
|---|---|
| private final String myIdName | |
| ContextImpl | back to summary |
|---|---|
| protected ContextImpl(ContextManager cm, String id) | |
| appendErrorInfo | back to summary |
|---|---|
| public StringBuffer appendErrorInfo() | |
| getContextManager | back to summary |
|---|---|
| public final ContextManager getContextManager() Implements org. Doc from org. Returns the context manager that has stored this context in its stack.
| |
| getIdName | back to summary |
|---|---|
| public final String getIdName() Implements org. Doc from org. Returns the current id name associated with this context. Contexts are placed into stacks by id, in a context manager. Null if the context is not assigned to an id. Contexts known by context managers are always assigned to an id. A default Id name should be defined in each specific context interface as a static final field with the name CONTEXT_ID. For example, see org.apache.derby.iapi.sql.compile.CompilerContext.CONTEXT_ID.
| |
| isLastHandler | back to summary |
|---|---|
| public boolean isLastHandler(int severity) Implements org. Doc from org. 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.
| |
| popMe | back to summary |
|---|---|
| public final void popMe() Implements org. Doc from org. Pop myself of the context stack.
| |
| pushMe | back to summary |
|---|---|
| public final void pushMe() Implements org. Doc from org. Push myself onto my context stack. | |