| java.lang.Object org.apache.derby.iapi.services.context.ContextManager
ContextManager | public class ContextManager (Code) | | The ContextManager collects contexts as they are
created. It maintains stacks of contexts by
named ids, so that the top context of a given
type can be returned. It also maintains a global
stack so that contexts can be traversed in the
order they were created.
The first implementation of the context manager
assumes there is only one thread to worry about
and that the user(s) of the class only create one
instance of ContextManager.
|
Field Summary | |
int | activeCount Count of the number of setCurrentContextManager calls
by a single thread, for nesting situations with a single
active Contextmanager. | Thread | activeThread The thread that owns this ContextManager, set by
ContextService.setCurrentContextManager and reset
by resetCurrentContextManager. | final ContextService | owningCsf |
activeCount | int activeCount(Code) | | Count of the number of setCurrentContextManager calls
by a single thread, for nesting situations with a single
active Contextmanager. If nesting is occuring with multiple
different ContextManagers then this value is set to -1
and nesting is represented by entries in a stack in the
ThreadLocal variable, threadContextList.
See Also: ContextService.threadContextList |
activeThread | Thread activeThread(Code) | | The thread that owns this ContextManager, set by
ContextService.setCurrentContextManager and reset
by resetCurrentContextManager. Only a single
thread can be active in a ContextManager at any time,
and the thread only "owns" the ContextManager while
it is executing code within Derby. In the JDBC case
setCurrentContextManager is called at the start of
a JBDC method and resetCurrentContextManager on completion.
Nesting within the same thread is supported, such as server-side
JDBC calls in a Java routine or procedure. In that case
the activeCount will represent the level of nesting, in
some situations.
See Also: ContextService.setCurrentContextManager(ContextManager) See Also: ContextService.resetCurrentContextManager(ContextManager) See Also: ContextManager.activeCount |
ContextManager | ContextManager(ContextService csf, HeaderPrintWriter stream)(Code) | | Constructs a new instance. No CtxStacks are inserted into the
hashMap as they will be allocated on demand.
Parameters: csf - the ContextService owning this ContextManager Parameters: stream - error stream for reporting errors |
cleanupOnError | public boolean cleanupOnError(Throwable error)(Code) | | true if the context manager is shutdown, false otherwise. |
getContext | public Context getContext(String contextId)(Code) | | Obtain the last pushed Context object of the type indicated by
the contextId argument.
Parameters: contextId - a String identifying the type of Context The Context object with the corresponding contextId, or null if not found |
isEmpty | final boolean isEmpty()(Code) | | Is the ContextManager empty containing no Contexts.
|
popContext | public void popContext()(Code) | | Remove the last pushed Context object, regardless of type. If
there are no Context objects, no action is taken.
|
popContext | void popContext(Context theContext)(Code) | | Removes the specified Context object. If
the specified Context object does not exist, the call will fail.
Parameters: theContext - the Context object to remove. |
pushContext | public void pushContext(Context newContext)(Code) | | Add a Context object to the ContextManager. The object is added
both to the holder list and to a stack for the specific type of
Context.
Parameters: newContext - the new Context object |
setInterrupted | synchronized boolean setInterrupted(Context c)(Code) | | |
setLocaleFinder | public void setLocaleFinder(LocaleFinder finder)(Code) | | Set the locale for this context.
|
|
|