Package org.apache.uima
Class UimaContextHolder
- java.lang.Object
-
- org.apache.uima.UimaContextHolder
-
public class UimaContextHolder extends java.lang.ObjectThis 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 Classes Modifier and Type Class Description private static classUimaContextHolder.ContextHolderReferenceType
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringCONTEXT_HOLDER_REFERENCE_TYPEprivate static UimaContextHolder.ContextHolderReferenceTypeCONTEXT_HOLDER_REFERENCE_TYPE_VALUEprivate static java.util.Map<UimaContext,java.lang.StackTraceElement[]>CONTEXT_SETTERSprivate static booleanIS_TRACK_CONTEXT_HOLDER_TRACKINGprivate static java.lang.InheritableThreadLocal<java.lang.Object>THREAD_LOCAL_CONTEXTprivate static java.lang.StringTRACK_CONTEXT_HOLDER_TRACKING
-
Constructor Summary
Constructors Modifier Constructor Description privateUimaContextHolder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidclearContext()Clears the UimaContext entry for the current threadstatic UimaContextgetContext()Get the UimaContext for this threadprivate static java.lang.ObjectmakeRef(UimaContext aContext)static UimaContextsetContext(UimaContext uimaContext)Sets the UimaContext for the current thread.
-
-
-
Field Detail
-
TRACK_CONTEXT_HOLDER_TRACKING
private static final java.lang.String TRACK_CONTEXT_HOLDER_TRACKING
- See Also:
- Constant Field Values
-
CONTEXT_HOLDER_REFERENCE_TYPE
private static final java.lang.String CONTEXT_HOLDER_REFERENCE_TYPE
- See Also:
- Constant Field Values
-
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
private static final java.lang.InheritableThreadLocal<java.lang.Object> THREAD_LOCAL_CONTEXT
-
CONTEXT_SETTERS
private static final java.util.Map<UimaContext,java.lang.StackTraceElement[]> CONTEXT_SETTERS
-
-
Method Detail
-
getContext
public static UimaContext getContext()
Get the UimaContext for this thread- Returns:
- the thread-specific UimaContext
-
setContext
public static UimaContext setContext(UimaContext uimaContext)
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
private static java.lang.Object makeRef(UimaContext aContext)
-
clearContext
public static void clearContext()
Clears the UimaContext entry for the current threadNOTE - Should be used only by the UIMA Framework.
-
-