java.lang.Object
org.apache.derby.iapi.services.context.ContextManager
- public class ContextManager
- extends java.lang.Object
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.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
holder
private final java.util.Stack holder
messageLocale
private java.util.Locale messageLocale
ctxTable
private final java.util.Hashtable ctxTable
owningCsf
final ContextService owningCsf
logSeverityLevel
private int logSeverityLevel
errorStream
private org.apache.derby.iapi.services.stream.HeaderPrintWriter errorStream
errorStringBuilder
private ErrorStringBuilder errorStringBuilder
shutdown
private boolean shutdown
finder
private org.apache.derby.iapi.services.i18n.LocaleFinder finder
cmStack
final java.util.Stack cmStack
activeThread
java.lang.Thread activeThread
activeCount
int activeCount
ContextManager
ContextManager(ContextService csf,
org.apache.derby.iapi.services.stream.HeaderPrintWriter stream)
- constructor specifying the hash table size and load
factor for the hashed-by-id context stacks.
pushContext
public void pushContext(Context newContext)
getContext
public Context getContext(java.lang.String contextId)
popContext
public void popContext()
popContext
void popContext(Context theContext)
cleanupOnError
public boolean cleanupOnError(java.lang.Throwable error)
setInterrupted
boolean setInterrupted(Context c)
checkInterrupt
private void checkInterrupt()
- Check to see if we have been interrupted. If we have then
a ShutdownException will be thrown. This will be either the
one passed to interrupt or a generic one if some outside
source interrupted the thread.
setLocaleFinder
public void setLocaleFinder(org.apache.derby.iapi.services.i18n.LocaleFinder finder)
- Set the locale for this context.
setMessageLocale
public void setMessageLocale(java.lang.String localeID)
throws org.apache.derby.iapi.error.StandardException
getMessageLocale
public java.util.Locale getMessageLocale()
flushErrorString
private void flushErrorString()
- Flush the built up error string to whereever
it is supposed to go, and reset the error string
reportError
private boolean reportError(java.lang.Throwable t)