Package org.apache.uima
Interface UimaContextAdmin
-
- All Superinterfaces:
UimaContext
- All Known Implementing Classes:
ChildUimaContext_impl
,FlowControllerContext_impl
,RootUimaContext_impl
,UimaContext_ImplBase
public interface UimaContextAdmin extends UimaContext
Admin interface to the UIMA Context. Developer code should only use theUimaContext
interface. The methods on this interface are for the framework's use only. *
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description UimaContextAdmin
createChild(java.lang.String aContextName, java.util.Map<java.lang.String,java.lang.String> aSofaMappings)
Creates a UimaContext that is a child of this UimaContext.void
defineCasPool(int aSize, java.util.Properties aPerformanceTuningSettings, boolean aSofaAware)
Defines the CAS pool that this UimaContext must support.ComponentInfo
getComponentInfo()
Gets the ComponentInfo object for this component, which can be passed toCAS.setCurrentComponentInfo(ComponentInfo)
.ConfigurationManager
getConfigurationManager()
Gets the ConfigurationManager instance used by this UimaContext to resolve configuration parameter resource accesses.Settings
getExternalOverrides()
Gets the settings to be used for external parameter overridesAnalysisEngineManagement
getManagementInterface()
Gets an object that can be used to do monitoring or management of this AnalysisEngine.java.lang.String
getQualifiedContextName()
Gets the fully-qualified name of this context.ResourceManager
getResourceManager()
Gets the ResourceManager instance used by this UimaContext to resolve external resource accesses.UimaContextAdmin
getRootContext()
Gets the Root Context for this Resource.java.util.Map<java.lang.String,java.lang.String>
getSofaMap()
Gets an unmodifiable Map containing the mapping of component sofa name to absolute sofa ID.java.lang.String
getUniqueName()
Returns a UUID-like unique name of this component.void
initializeRoot(Logger aLogger, ResourceManager aResourceManager, ConfigurationManager aConfigurationManager)
Initializes a root UimaContext.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
setLogger(Logger aLogger)
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, getEmptyCas, getInstrumentationFacility, getLogger, getResourceAsStream, getResourceAsStream, getResourceFilePath, getResourceFilePath, getResourceObject, getResourceObject, getResourceURI, getResourceURI, getResourceURL, getResourceURL, getSession, getSharedSettingArray, getSharedSettingNames, getSharedSettingValue, getSofaMappings, mapSofaIDToComponentSofaName, mapToSofaID
-
-
-
-
Method Detail
-
initializeRoot
void initializeRoot(Logger aLogger, ResourceManager aResourceManager, ConfigurationManager aConfigurationManager)
Initializes a root UimaContext.- Parameters:
aLogger
- the logger that will be returned by this UimaContext'sUimaContext.getLogger()
method.aResourceManager
- the ResourceManager that will be used by this UimaContext to locate and access external resource.aConfigurationManager
- the ConfigurationManager that will be used by this UimaContext to access its configuration parameter settings.
-
createChild
UimaContextAdmin createChild(java.lang.String aContextName, java.util.Map<java.lang.String,java.lang.String> aSofaMappings)
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
void setLogger(Logger aLogger)
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
void setProcessTrace(ProcessTrace aProcessTrace)
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
java.lang.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
void setSession(Session aSession)
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, java.util.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
java.util.Map<java.lang.String,java.lang.String> getSofaMap()
Gets an unmodifiable Map containing the mapping of component sofa name to absolute sofa ID.- Returns:
- the Sofa map for this component
-
returnedCAS
void returnedCAS(AbstractCas aCAS)
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
java.lang.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
void setExternalOverrides(Settings externalOverrides)
Sets the Settings for external parameter overrides- Parameters:
externalOverrides
- the external overrides settings
-
-