Package org.apache.uima.impl
Class RootUimaContext_impl
- java.lang.Object
-
- org.apache.uima.impl.UimaContext_ImplBase
-
- org.apache.uima.impl.RootUimaContext_impl
-
- All Implemented Interfaces:
UimaContext,UimaContextAdmin
public class RootUimaContext_impl extends UimaContext_ImplBase
Implementation of the rootUimaContext. UIMA Contexts are arranged in a tree structure corresponding to the nested structure of the components in a CPE or Aggregate AE. The root UimaContext has direct references to shared components such as the ResourceManager and ConfigurationManager. The children UimaContexts reference these through the root.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.uima.impl.UimaContext_ImplBase
UimaContext_ImplBase.ComponentInfoImpl
-
-
Field Summary
Fields Modifier and Type Field Description private ConfigurationManagermConfigurationManagerConfigurationManager used to access configuration parameter settingsprotected SettingsmExternalOverridesExternal parameter override specifications - held at the root context levelprivate InstrumentationFacility_implmInstrumentationFacilityInstrumentation Facility (wraps ProcessTrace)private LoggermLoggerLogger Volatile because mLogger can be updated on one thread and accessed on anotherprivate ResourceManagermResourceManagerResourceManager used to locate and access external resourcesprivate SessionmSessionCurrent Session Has general setter and getter; marked volatile to allow effect of setting to be seen on another thread-
Fields inherited from class org.apache.uima.impl.UimaContext_ImplBase
loggingThrottleLimit, mCasPoolSize, mMBean, mOutstandingCASes, mQualifiedContextName, mSofaMappings
-
-
Constructor Summary
Constructors Constructor Description RootUimaContext_impl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigurationManagergetConfigurationManager()Gets the ConfigurationManager instance used by this UimaContext to resolve configuration parameter resource accesses.SettingsgetExternalOverrides()(non-Javadoc)InstrumentationFacilitygetInstrumentationFacility()Gets the InstrumentationFacility to be used within this AnalysisEngine.LoggergetLogger()Gets theLoggerto which log output will be sent.ResourceManagergetResourceManager()Gets the ResourceManager used by this UimaContext to locate and access external resourcesUimaContextAdmingetRootContext()Get the Root ContextSessiongetSession()Returns the Session object, which can be used to store data that pertains to a particular client session.voidinitializeRoot(Logger aLogger, ResourceManager aResourceManager, ConfigurationManager aConfigurationManager)Initializes a root UimaContext.voidsetExternalOverrides(Settings externalOverrides)(non-Javadoc)voidsetLogger(Logger aLogger)Sets the Logger for this UimaContext.voidsetProcessTrace(ProcessTrace aProcessTrace)Sets the current ProcessTrace object, which will receive trace events generated by the InstrumentationFacility.voidsetSession(Session aSession)Sets the current session object.-
Methods inherited from class org.apache.uima.impl.UimaContext_ImplBase
combineSofaMappings, createChild, defineCasPool, getComponentInfo, getConfigParameterNames, getConfigParameterNames, getConfigParameterValue, getConfigParameterValue, getConfigurationGroupNames, getDataPath, getDataPathElements, getEmptyCas, getManagementInterface, getMdcId, getQualifiedContextName, getResourceAsStream, getResourceAsStream, getResourceFilePath, getResourceFilePath, getResourceObject, getResourceObject, getResourceURI, getResourceURI, getResourceURL, getResourceURL, getSharedSettingArray, getSharedSettingNames, getSharedSettingValue, getSofaMap, getSofaMappings, getUniqueName, makeQualifiedName, mapSofaIDToComponentSofaName, mapToSofaID, maybeThrottleLogger, returnedCAS, setLoggingThrottleLimit
-
-
-
-
Field Detail
-
mLogger
private volatile Logger mLogger
Logger Volatile because mLogger can be updated on one thread and accessed on another
-
mResourceManager
private final ResourceManager mResourceManager
ResourceManager used to locate and access external resources
-
mConfigurationManager
private final ConfigurationManager mConfigurationManager
ConfigurationManager used to access configuration parameter settings
-
mInstrumentationFacility
private final InstrumentationFacility_impl mInstrumentationFacility
Instrumentation Facility (wraps ProcessTrace)
-
mSession
private volatile Session mSession
Current Session Has general setter and getter; marked volatile to allow effect of setting to be seen on another thread
-
mExternalOverrides
protected volatile Settings mExternalOverrides
External parameter override specifications - held at the root context level
-
-
Method Detail
-
getExternalOverrides
public Settings getExternalOverrides()
Description copied from class:UimaContext_ImplBase(non-Javadoc)- Specified by:
getExternalOverridesin interfaceUimaContext- Specified by:
getExternalOverridesin interfaceUimaContextAdmin- Overrides:
getExternalOverridesin classUimaContext_ImplBase- Returns:
- the Settings object
- See Also:
UimaContextAdmin.getExternalOverrides()
-
setExternalOverrides
public void setExternalOverrides(Settings externalOverrides)
Description copied from class:UimaContext_ImplBase(non-Javadoc)- Specified by:
setExternalOverridesin interfaceUimaContextAdmin- Overrides:
setExternalOverridesin classUimaContext_ImplBase- Parameters:
externalOverrides- the external overrides settings- See Also:
UimaContextAdmin.setExternalOverrides(org.apache.uima.util.Settings)
-
initializeRoot
public void initializeRoot(Logger aLogger, ResourceManager aResourceManager, ConfigurationManager aConfigurationManager)
Description copied from interface:UimaContextAdminInitializes 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.
-
getLogger
public Logger getLogger()
Description copied from interface:UimaContextGets theLoggerto which log output will be sent. UIMA components should use this facility rather than writing to their own log files (or to stdout).- Returns:
- an instance of a logger for use by this annotator.
- See Also:
AnnotatorContext.getLogger()
-
setLogger
public void setLogger(Logger aLogger)
Description copied from interface:UimaContextAdminSets 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.
-
getResourceManager
public ResourceManager getResourceManager()
Gets the ResourceManager used by this UimaContext to locate and access external resources- Returns:
- the ResourceManager
-
getConfigurationManager
public ConfigurationManager getConfigurationManager()
Description copied from interface:UimaContextAdminGets the ConfigurationManager instance used by this UimaContext to resolve configuration parameter resource accesses.- Returns:
- the ConfigurationManager instance for this UimaContext
-
getInstrumentationFacility
public InstrumentationFacility getInstrumentationFacility()
Gets the InstrumentationFacility to be used within this AnalysisEngine.- Returns:
- the InstrumentationFacility to be used within this AnalysisEngine
-
setProcessTrace
public void setProcessTrace(ProcessTrace aProcessTrace)
Sets the current ProcessTrace object, which will receive trace events generated by the InstrumentationFacility.This method is to be called from the Analysis Engine, not the Annotator, so it is not part of the AnnotatorContext interface.
- Parameters:
aProcessTrace- the ProcessTrace object to receive trace events
-
setSession
public void setSession(Session aSession)
Description copied from interface:UimaContextAdminSets 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
-
getSession
public Session getSession()
Description copied from interface:UimaContextReturns the Session object, which can be used to store data that pertains to a particular client session. All data that must persist across requests must be stored in the Session object and NOT in component instance variables. In some service deployments, a single component instance may serve multiple clients. In that case, the service wrapper may provide a different Session object for each client, and this method would return the appropriate Session object for the component to use for the current call.Note that Session support is NOT implemented in any of the service wrappers (e.g. Vinci) currently provided in the UIMA SDK.
- Returns:
- the current Session object
-
getRootContext
public UimaContextAdmin getRootContext()
Get the Root Context- Returns:
- root context
-
-