Package org.apache.uima
Class UimaContextHolder
java.lang.Object
org.apache.uima.UimaContextHolder
This class holds the UimaContext for the current thread, or a parent thread. The getContext
method may be used by any plain Java class invoked by an annotator, The POJO must run in the same
thread or a child thread of the annotator.
For example a POJO can access the shared External Override Settings with: String paramValue =
UimaContextHolder.getContext().getSetting(paramName);
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static enum
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private static final UimaContextHolder.ContextHolderReferenceType
private static final Map
<UimaContext, StackTraceElement[]> private static final boolean
private static final InheritableThreadLocal
<Object> private static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Clears the UimaContext entry for the current threadstatic UimaContext
Get the UimaContext for this threadprivate static Object
makeRef
(UimaContext aContext) static UimaContext
setContext
(UimaContext uimaContext) Sets the UimaContext for the current thread.
-
Field Details
-
TRACK_CONTEXT_HOLDER_TRACKING
- See Also:
-
CONTEXT_HOLDER_REFERENCE_TYPE
- See Also:
-
IS_TRACK_CONTEXT_HOLDER_TRACKING
private static final boolean IS_TRACK_CONTEXT_HOLDER_TRACKING -
CONTEXT_HOLDER_REFERENCE_TYPE_VALUE
private static final UimaContextHolder.ContextHolderReferenceType CONTEXT_HOLDER_REFERENCE_TYPE_VALUE -
THREAD_LOCAL_CONTEXT
-
CONTEXT_SETTERS
-
-
Constructor Details
-
UimaContextHolder
private UimaContextHolder()
-
-
Method Details
-
getContext
Get the UimaContext for this thread- Returns:
- the thread-specific UimaContext
-
setContext
Sets the UimaContext for the current thread.NOTE - Should be used only by the UIMA Framework.
- Parameters:
uimaContext
- - new UimaContext for this thread- Returns:
- - previous UimaContext for this thread
-
makeRef
-
clearContext
public static void clearContext()Clears the UimaContext entry for the current threadNOTE - Should be used only by the UIMA Framework.
-