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 Stringprivate static final UimaContextHolder.ContextHolderReferenceTypeprivate static final Map<UimaContext, StackTraceElement[]> private static final booleanprivate static final InheritableThreadLocal<Object> private static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidClears the UimaContext entry for the current threadstatic UimaContextGet the UimaContext for this threadprivate static ObjectmakeRef(UimaContext aContext) static UimaContextsetContext(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.
-