|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.iapi.services.context.ContextManager
public class ContextManager
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.
Nested Class Summary | |
---|---|
private static class |
ContextManager.CtxStack
The CtxStack implement a stack on top of an ArrayList (to avoid the inherent overhead associated with java.util.Stack which is built on top of java.util.Vector, which is fully synchronized). |
Field Summary | |
---|---|
(package private) int |
activeCount
Count of the number of setCurrentContextManager calls by a single thread, for nesting situations with a single active Contextmanager. |
(package private) java.lang.Thread |
activeThread
The thread that owns this ContextManager, set by ContextService.setCurrentContextManager and reset by resetCurrentContextManager. |
private java.util.HashMap |
ctxTable
HashMap that holds the Context objects. |
private HeaderPrintWriter |
errorStream
|
private ErrorStringBuilder |
errorStringBuilder
|
private LocaleFinder |
finder
|
private java.util.ArrayList |
holder
List of all Contexts |
private int |
logSeverityLevel
|
private java.util.Locale |
messageLocale
|
(package private) ContextService |
owningCsf
|
private boolean |
shutdown
|
Constructor Summary | |
---|---|
ContextManager(ContextService csf,
HeaderPrintWriter stream)
Constructs a new instance. |
Method Summary | |
---|---|
private void |
checkInterrupt()
Check to see if we have been interrupted. |
boolean |
cleanupOnError(java.lang.Throwable error)
|
private void |
flushErrorString()
Flush the built up error string to whereever it is supposed to go, and reset the error string |
Context |
getContext(java.lang.String contextId)
Obtain the last pushed Context object of the type indicated by the contextId argument. |
java.util.List |
getContextStack(java.lang.String contextId)
Return an unmodifiable list reference to the ArrayList backing CtxStack object for this type of Contexts. |
java.util.Locale |
getMessageLocale()
|
(package private) boolean |
isEmpty()
Is the ContextManager empty containing no Contexts. |
void |
popContext()
Remove the last pushed Context object, regardless of type. |
(package private) void |
popContext(Context theContext)
Removes the specified Context object. |
void |
pushContext(Context newContext)
Add a Context object to the ContextManager. |
private boolean |
reportError(java.lang.Throwable t)
|
(package private) boolean |
setInterrupted(Context c)
|
void |
setLocaleFinder(LocaleFinder finder)
Set the locale for this context. |
void |
setMessageLocale(java.lang.String localeID)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final java.util.HashMap ctxTable
pushContext(Context)
private final java.util.ArrayList holder
private java.util.Locale messageLocale
final ContextService owningCsf
private int logSeverityLevel
private HeaderPrintWriter errorStream
private ErrorStringBuilder errorStringBuilder
private boolean shutdown
private LocaleFinder finder
java.lang.Thread activeThread
ContextService.setCurrentContextManager(ContextManager)
,
ContextService.resetCurrentContextManager(ContextManager)
,
activeCount
int activeCount
ContextService.threadContextList
Constructor Detail |
---|
ContextManager(ContextService csf, HeaderPrintWriter stream)
csf
- the ContextService owning this ContextManagerstream
- error stream for reporting errorsMethod Detail |
---|
public void pushContext(Context newContext)
newContext
- the new Context objectpublic Context getContext(java.lang.String contextId)
contextId
- a String identifying the type of Context
public void popContext()
void popContext(Context theContext)
theContext
- the Context object to remove.final boolean isEmpty()
public final java.util.List getContextStack(java.lang.String contextId)
contextId
- the type of Context stack to return.
GenericLanguageConnectionContext.resetSavepoints()
,
StatementContext.resetSavePoint()
public boolean cleanupOnError(java.lang.Throwable error)
boolean setInterrupted(Context c)
private void checkInterrupt()
public void setLocaleFinder(LocaleFinder finder)
public void setMessageLocale(java.lang.String localeID) throws StandardException
StandardException
public java.util.Locale getMessageLocale()
private void flushErrorString()
private boolean reportError(java.lang.Throwable t)
|
Built on Thu 2011-03-10 11:54:14+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |