Package org.apache.uima
Interface UimaContextAdmin
- All Superinterfaces:
UimaContext
- All Known Implementing Classes:
ChildUimaContext_impl
,FlowControllerContext_impl
,RootUimaContext_impl
,UimaContext_ImplBase
Admin interface to the UIMA Context. Developer code should only use the
UimaContext
interface. The methods on this interface are for the framework's use only. *-
Method Summary
Modifier and TypeMethodDescriptioncreateChild
(String aContextName, Map<String, String> aSofaMappings) Creates a UimaContext that is a child of this UimaContext.void
defineCasPool
(int aSize, Properties aPerformanceTuningSettings, boolean aSofaAware) Defines the CAS pool that this UimaContext must support.Gets the ComponentInfo object for this component, which can be passed toCAS.setCurrentComponentInfo(ComponentInfo)
.Gets the ConfigurationManager instance used by this UimaContext to resolve configuration parameter resource accesses.Gets the settings to be used for external parameter overridesGets an object that can be used to do monitoring or management of this AnalysisEngine.Gets the fully-qualified name of this context.Gets the ResourceManager instance used by this UimaContext to resolve external resource accesses.Gets the Root Context for this Resource.Gets an unmodifiable Map containing the mapping of component sofa name to absolute sofa ID.Returns a UUID-like unique name of this component.default void
initializeRoot
(Logger aLogger) Initializes a root UimaContext.void
initializeRoot
(Logger aLogger, ResourceManager aResourceManager, ConfigurationManager aConfigurationManager) Deprecated.void
returnedCAS
(AbstractCas aCAS) Called internally by the framework whenever the AnalysisComponent returns a CAS from its next() method or calls cas.release().void
setExternalOverrides
(Settings externalOverrides) Sets the Settings for external parameter overridesvoid
Sets the Logger for this UimaContext.void
setProcessTrace
(ProcessTrace aProcessTrace) Sets the current ProcessTrace object, which will receive trace events generated by the InstrumentationFacility.void
setSession
(Session aSession) Sets the current session object.Methods inherited from interface org.apache.uima.UimaContext
getConfigParameterNames, getConfigParameterNames, getConfigParameterValue, getConfigParameterValue, getConfigurationGroupNames, getDataPath, getDataPathElements, getEmptyCas, getInstrumentationFacility, getLogger, getResourceAsStream, getResourceAsStream, getResourceFilePath, getResourceFilePath, getResourceObject, getResourceObject, getResourceURI, getResourceURI, getResourceURL, getResourceURL, getSession, getSharedSettingArray, getSharedSettingNames, getSharedSettingValue, getSofaMappings, mapSofaIDToComponentSofaName, mapToSofaID
-
Method Details
-
initializeRoot
Initializes a root UimaContext.- Parameters:
aLogger
- the logger that will be returned by this UimaContext'sUimaContext.getLogger()
method.
-
initializeRoot
@Deprecated(since="3.6.0") void initializeRoot(Logger aLogger, ResourceManager aResourceManager, ConfigurationManager aConfigurationManager) Deprecated.UseinitializeRoot(Logger)
instead.Initializes a root UimaContext.- Parameters:
aLogger
- the logger that will be returned by this UimaContext'sUimaContext.getLogger()
method.aResourceManager
- Deprecated: this parameter is ignored! The ResourceManager that will be used by this UimaContext to locate and access external resource.aConfigurationManager
- Deprecated: this parameter is ignored! The ConfigurationManager that will be used by this UimaContext to access its configuration parameter settings.- To be removed in version:
- 4.0.0
-
createChild
Creates a UimaContext that is a child of this UimaContext.- Parameters:
aContextName
- a name for the new context, which must be unique with respect to all children of the parent context.aSofaMappings
- mappings from child's sofa name to parent's sofa name. May be null.- Returns:
- the Administrative interface to the UIMA Context
-
setLogger
Sets the Logger for this UimaContext. If this method is not called, the default logger (UIMAFramework.getLogger()
) will be used.- Parameters:
aLogger
- the logger that will be returned by this UimaContext'sUimaContext.getLogger()
method.
-
setProcessTrace
Sets the current ProcessTrace object, which will receive trace events generated by the InstrumentationFacility.- Parameters:
aProcessTrace
- the ProcessTrace object to receive trace events
-
getResourceManager
ResourceManager getResourceManager()Gets the ResourceManager instance used by this UimaContext to resolve external resource accesses.- Returns:
- the ResourceManager instance for this UimaContext
-
getConfigurationManager
ConfigurationManager getConfigurationManager()Gets the ConfigurationManager instance used by this UimaContext to resolve configuration parameter resource accesses.- Returns:
- the ConfigurationManager instance for this UimaContext
-
getQualifiedContextName
String getQualifiedContextName()Gets the fully-qualified name of this context. This is a slash-separated name consisting of each containing context name back to the root. It always begins and ends with a slash. For example, the context name for an annotator nested within two AnalysisEngines might look like:/MyTopLevelAnalysisEngine/MyComponentAnalysisEngine/MyAnnotator/
.- Returns:
- the qualified context name
-
setSession
Sets the current session object. A default Session object is created when the UimaContext is created. In a multi-client deployment, the deployment wrapper is responsible for ensuring that an appropriate Session object is installed here prior to invoking components that use this UimaContext.- Parameters:
aSession
- the session object
-
getRootContext
UimaContextAdmin getRootContext()Gets the Root Context for this Resource. This is the top-level context for the outermost aggregate component (AnalysisEngine or CollectionProcessingEngine).- Returns:
- root context
-
defineCasPool
void defineCasPool(int aSize, Properties aPerformanceTuningSettings, boolean aSofaAware) throws ResourceInitializationException Defines the CAS pool that this UimaContext must support. This method must be called beforeUimaContext.getEmptyCas(Class)
may be called.- Parameters:
aSize
- the minimum CAS pool size requiredaPerformanceTuningSettings
- settings, including initial CAS heap size, for the AEaSofaAware
- whether the component that will receive these CASes is sofa aware. This is needed to determine which view to get. Sofa-aware components get the base view; sofa-unaware components get the default text sofa view (or whatever is mapped to it).- Throws:
ResourceInitializationException
- if a CAS could not be created.
-
getManagementInterface
AnalysisEngineManagement getManagementInterface()Gets an object that can be used to do monitoring or management of this AnalysisEngine.- Returns:
- an object exposing a management interface to this AE
-
getComponentInfo
ComponentInfo getComponentInfo()Gets the ComponentInfo object for this component, which can be passed toCAS.setCurrentComponentInfo(ComponentInfo)
.- Returns:
- the component info
-
getSofaMap
Gets an unmodifiable Map containing the mapping of component sofa name to absolute sofa ID.- Returns:
- the Sofa map for this component
-
returnedCAS
Called internally by the framework whenever the AnalysisComponent returns a CAS from its next() method or calls cas.release(). Used to monitor the number of CASes that the AnalysisComponent is using at any one time.- Parameters:
aCAS
- the CAS that was returned or released
-
getUniqueName
String getUniqueName()Returns a UUID-like unique name of this component.- Returns:
- - unique name of this component
-
getExternalOverrides
Settings getExternalOverrides()Gets the settings to be used for external parameter overrides- Specified by:
getExternalOverrides
in interfaceUimaContext
- Returns:
- the Settings object
-
setExternalOverrides
Sets the Settings for external parameter overrides- Parameters:
externalOverrides
- the external overrides settings
-
initializeRoot(Logger)
instead.