Package org.apache.uima.impl
Class UIMAFramework_impl
- java.lang.Object
-
- org.apache.uima.UIMAFramework
-
- org.apache.uima.impl.UIMAFramework_impl
-
public class UIMAFramework_impl extends UIMAFramework
This is the main interface point to the UIMA reference implemention. Applications cannot use this class directly. Use the static methods onUIMAFramework
instead.This class is a singleton which will be accessed by many threads simulatenously. It must be threadsafe.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
UIMAFramework_impl.FactoryConfigParseHandler
SAX Handler for parsing factory config file.
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.Class<UIMAFramework_impl>
CLASS_NAME
current classstatic boolean
debug
private static java.lang.String
LOG_RESOURCE_BUNDLE
resource bundle for log messagesprivate static java.lang.String
LOGGER_CLASS_SYSTEM_PROPERTY
private java.lang.String
mConfigurationManagerImplClassName
ConfigurationManager implementation class, an instance of which will be returned byUIMAFramework.newConfigurationManager()
.private java.lang.String
mCpeClassName
The class of theCollectionProcessingEngine
used by the UIMA reference implementation.private java.lang.String
mCpmImplClassName
CollectionProcessingManager implementation class, an instance of which will be returned byUIMAFramework.newCollectionProcessingManager()
.private Logger
mDefaultLogger
The defaultLogger
instance used by the UIMA reference implementation.private java.util.Properties
mDefaultPerformanceTuningProperties
Default performance tuning properties.private java.lang.Class
mLoggerClass
The class of theLogger
used by the UIMA reference implementation.private java.util.concurrent.ConcurrentHashMap<java.lang.String,Logger>
mLoggers
HashMap includes all log wrapper classesprivate CompositeResourceFactory
mResourceFactory
TheResourceFactory
used by the UIMA reference implementation.private java.lang.String
mResourceManagerImplClassName
ResourceManager implementation class, an instance of which will be returned byUIMAFramework.newDefaultResourceManager()
.private java.lang.String
mResourceManagerPearWrapperImplClassName
ResourceManagerPearWrapper implementation class, an instance of which will be returned byUIMAFramework.newDefaultResourceManagerPearWrapper()
.private ResourceSpecifierFactory
mResourceSpecifierFactory
TheResourceSpecifierFactory
used by the UIMA reference implementation.private java.lang.String
mTimerClassName
The class of theTimer
used by the UIMA reference implementation.private java.lang.String
mUimaContextImplClassName
The class of theUimaContext
used by the UIMA reference implementation.private XMLParser
mXMLParser
TheXMLParser
used by the UIMA reference implementation.-
Fields inherited from class org.apache.uima.UIMAFramework
CAS_INITIAL_HEAP_SIZE, JCAS_CACHE_ENABLED, newContextConfigManager, newContextResourceManager, PROCESS_TRACE_ENABLED, SKIP_USER_JCAS_LOADING, SOCKET_KEEPALIVE_ENABLED
-
-
Constructor Summary
Constructors Constructor Description UIMAFramework_impl()
Creates a new UIMAFramework_impl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description short
_getBuildRevision()
To be implemented by subclasses; this should return the build revision number of this implementation.protected java.util.Properties
_getDefaultPerformanceTuningProperties()
To be implemented by subclasses; this should return a Properties object representing the default performance tuning settings for the framework.protected Logger
_getLogger()
To be implemented by subclasses; this should return a reference to the UIMALogger
used by this implementation.protected Logger
_getLogger(java.lang.Class component)
To be implemented by subclasses; this should return a reference to the UIMALogger
of the specified source class.short
_getMajorVersion()
To be implemented by subclasses; this should return the major version number of this implementation.short
_getMinorVersion()
To be implemented by subclasses; this should return the minor version number of this implementation.protected CompositeResourceFactory
_getResourceFactory()
Retrieves a reference to theResourceFactory
used by the UIMA reference implementation.protected ResourceSpecifierFactory
_getResourceSpecifierFactory()
To be implemented by subclasses; this should return a reference to theResourceSpecifierFactory
used by this implementation.protected XMLParser
_getXMLParser()
To be implemented by subclasses; this should return a reference to the UIMAXMLParser
used by this implementation.protected void
_initialize()
To be implemented by subclasses; called from this class's static initializer to complete initialization of the singleton instance.protected CollectionProcessingManager
_newCollectionProcessingManager(ResourceManager aResourceManager)
To be implemented by subclasses; this should create a new instance of a class implementingCollectionProcessingManager
.protected ConfigurationManager
_newConfigurationManager()
To be implemented by subclasses; this should return a new instance of theConfigurationManager
used by this implementation.protected ResourceManager
_newDefaultResourceManager()
To be implemented by subclasses; this should return a new instance of the defaultResourceManager
used by this implementation.protected ResourceManager
_newDefaultResourceManagerPearWrapper()
To be implemented by subclasses; this should return a new instance of the defaultResourceManager
used by this implementation.protected Logger
_newLogger()
To be implemented by subclasses; this should return a new UIMALogger
instance.protected UimaTimer
_newTimer()
To be implemented by subclasses; this should return a new UIMAUimaTimer
instance.protected UimaContextAdmin
_newUimaContext()
To be implemented by subclasses; this should return a new instance of the defaultUimaContextAdmin
used by this implementation.protected CollectionProcessingEngine
_produceCollectionProcessingEngine(CpeDescription aCpeDescription, java.util.Map<java.lang.String,java.lang.Object> aAdditionalParams)
To be implemented by subclasses; this should produce aCollectionProcessingEngine
instance from acpeDescription
.protected void
parseFactoryConfig()
Parses the factoryConfig.xml file and sets up the ResourceFactory, ResourceSpecifierFactory, and XMLParser.-
Methods inherited from class org.apache.uima.UIMAFramework
getBuildRevision, getDefaultPerformanceTuningProperties, getInstance, getLogger, getLogger, getMajorVersion, getMinorVersion, getResourceFactory, getResourceSpecifierFactory, getVersionString, getXMLParser, newCollectionProcessingManager, newCollectionProcessingManager, newConfigurationManager, newDefaultResourceManager, newDefaultResourceManagerPearWrapper, newLogger, newTimer, newUimaContext, produceAnalysisEngine, produceAnalysisEngine, produceAnalysisEngine, produceAnalysisEngine, produceCasConsumer, produceCasConsumer, produceCasConsumer, produceCasInitializer, produceCasInitializer, produceCasInitializer, produceCollectionProcessingEngine, produceCollectionProcessingEngine, produceCollectionProcessingEngine, produceCollectionReader, produceCollectionReader, produceCollectionReader, produceResource, produceResource, produceResource, produceTAE, produceTAE, produceTAE, produceTAE
-
-
-
-
Field Detail
-
debug
public static final boolean debug
- See Also:
- Constant Field Values
-
LOG_RESOURCE_BUNDLE
private static final java.lang.String LOG_RESOURCE_BUNDLE
resource bundle for log messages- See Also:
- Constant Field Values
-
LOGGER_CLASS_SYSTEM_PROPERTY
private static final java.lang.String LOGGER_CLASS_SYSTEM_PROPERTY
- See Also:
- Constant Field Values
-
CLASS_NAME
private static final java.lang.Class<UIMAFramework_impl> CLASS_NAME
current class
-
mResourceFactory
private CompositeResourceFactory mResourceFactory
TheResourceFactory
used by the UIMA reference implementation.
-
mResourceSpecifierFactory
private ResourceSpecifierFactory mResourceSpecifierFactory
TheResourceSpecifierFactory
used by the UIMA reference implementation.
-
mXMLParser
private XMLParser mXMLParser
TheXMLParser
used by the UIMA reference implementation.
-
mLoggerClass
private java.lang.Class mLoggerClass
The class of theLogger
used by the UIMA reference implementation.
-
mDefaultLogger
private Logger mDefaultLogger
The defaultLogger
instance used by the UIMA reference implementation.
-
mCpmImplClassName
private java.lang.String mCpmImplClassName
CollectionProcessingManager implementation class, an instance of which will be returned byUIMAFramework.newCollectionProcessingManager()
.
-
mResourceManagerImplClassName
private java.lang.String mResourceManagerImplClassName
ResourceManager implementation class, an instance of which will be returned byUIMAFramework.newDefaultResourceManager()
.
-
mResourceManagerPearWrapperImplClassName
private java.lang.String mResourceManagerPearWrapperImplClassName
ResourceManagerPearWrapper implementation class, an instance of which will be returned byUIMAFramework.newDefaultResourceManagerPearWrapper()
.
-
mConfigurationManagerImplClassName
private java.lang.String mConfigurationManagerImplClassName
ConfigurationManager implementation class, an instance of which will be returned byUIMAFramework.newConfigurationManager()
.
-
mUimaContextImplClassName
private java.lang.String mUimaContextImplClassName
The class of theUimaContext
used by the UIMA reference implementation.
-
mCpeClassName
private java.lang.String mCpeClassName
The class of theCollectionProcessingEngine
used by the UIMA reference implementation.
-
mTimerClassName
private java.lang.String mTimerClassName
The class of theTimer
used by the UIMA reference implementation.
-
mDefaultPerformanceTuningProperties
private java.util.Properties mDefaultPerformanceTuningProperties
Default performance tuning properties.
-
mLoggers
private java.util.concurrent.ConcurrentHashMap<java.lang.String,Logger> mLoggers
HashMap includes all log wrapper classes
-
-
Method Detail
-
_initialize
protected void _initialize() throws java.lang.Exception
Description copied from class:UIMAFramework
To be implemented by subclasses; called from this class's static initializer to complete initialization of the singleton instance. This initialization is done outside the constructor so that theUIMAFramework.getInstance()
method can be used during initialization.- Specified by:
_initialize
in classUIMAFramework
- Throws:
java.lang.Exception
- if initialization fails- See Also:
UIMAFramework._initialize()
-
_getMajorVersion
public short _getMajorVersion()
Description copied from class:UIMAFramework
To be implemented by subclasses; this should return the major version number of this implementation.- Specified by:
_getMajorVersion
in classUIMAFramework
- Returns:
- the major version number
- See Also:
UIMAFramework._getMajorVersion()
-
_getMinorVersion
public short _getMinorVersion()
Description copied from class:UIMAFramework
To be implemented by subclasses; this should return the minor version number of this implementation.- Specified by:
_getMinorVersion
in classUIMAFramework
- Returns:
- the minor version number
- See Also:
UIMAFramework._getMinorVersion()
-
_getBuildRevision
public short _getBuildRevision()
Description copied from class:UIMAFramework
To be implemented by subclasses; this should return the build revision number of this implementation.- Specified by:
_getBuildRevision
in classUIMAFramework
- Returns:
- the build revision number
- See Also:
UIMAFramework._getBuildRevision()
-
_getResourceFactory
protected CompositeResourceFactory _getResourceFactory()
Retrieves a reference to theResourceFactory
used by the UIMA reference implementation.- Specified by:
_getResourceFactory
in classUIMAFramework
- Returns:
- the
ResourceFactory
to be used by the application
-
_getResourceSpecifierFactory
protected ResourceSpecifierFactory _getResourceSpecifierFactory()
To be implemented by subclasses; this should return a reference to theResourceSpecifierFactory
used by this implementation.- Specified by:
_getResourceSpecifierFactory
in classUIMAFramework
- Returns:
- the
ResourceSpecifierFactory
to be used by the application.
-
_getXMLParser
protected XMLParser _getXMLParser()
To be implemented by subclasses; this should return a reference to the UIMAXMLParser
used by this implementation.- Specified by:
_getXMLParser
in classUIMAFramework
- Returns:
- the
XMLParser
to be used by the application.
-
_newCollectionProcessingManager
protected CollectionProcessingManager _newCollectionProcessingManager(ResourceManager aResourceManager)
Description copied from class:UIMAFramework
To be implemented by subclasses; this should create a new instance of a class implementingCollectionProcessingManager
.- Specified by:
_newCollectionProcessingManager
in classUIMAFramework
- Parameters:
aResourceManager
- the ResourceManager to be used by the CPM- Returns:
- a new
CollectionProcessingManager
to be used by the application. - See Also:
UIMAFramework.newCollectionProcessingManager()
-
_getLogger
protected Logger _getLogger()
To be implemented by subclasses; this should return a reference to the UIMALogger
used by this implementation.- Specified by:
_getLogger
in classUIMAFramework
- Returns:
- the
Logger
to be used by the application.
-
_getLogger
protected Logger _getLogger(java.lang.Class component)
To be implemented by subclasses; this should return a reference to the UIMALogger
of the specified source class.- Specified by:
_getLogger
in classUIMAFramework
- Parameters:
component
- the class to get the logger for- Returns:
- the
Logger
of the specified source class
-
_newLogger
protected Logger _newLogger()
Description copied from class:UIMAFramework
To be implemented by subclasses; this should return a new UIMALogger
instance.- Specified by:
_newLogger
in classUIMAFramework
- Returns:
- a new
Logger
instance - See Also:
UIMAFramework._newLogger()
-
_newDefaultResourceManager
protected ResourceManager _newDefaultResourceManager()
To be implemented by subclasses; this should return a new instance of the defaultResourceManager
used by this implementation.- Specified by:
_newDefaultResourceManager
in classUIMAFramework
- Returns:
- a new
ResourceManager
to be used by the application.
-
_newDefaultResourceManagerPearWrapper
protected ResourceManager _newDefaultResourceManagerPearWrapper()
To be implemented by subclasses; this should return a new instance of the defaultResourceManager
used by this implementation.- Specified by:
_newDefaultResourceManagerPearWrapper
in classUIMAFramework
- Returns:
- a new
ResourceManager
to be used by the application.
-
_newConfigurationManager
protected ConfigurationManager _newConfigurationManager()
To be implemented by subclasses; this should return a new instance of theConfigurationManager
used by this implementation.- Specified by:
_newConfigurationManager
in classUIMAFramework
- Returns:
- a new
ConfigurationManager
to be used by the application.
-
_newUimaContext
protected UimaContextAdmin _newUimaContext()
Description copied from class:UIMAFramework
To be implemented by subclasses; this should return a new instance of the defaultUimaContextAdmin
used by this implementation.- Specified by:
_newUimaContext
in classUIMAFramework
- Returns:
- a new
UimaContextAdmin
to be used by the application. - See Also:
UIMAFramework._newUimaContext()
-
_newTimer
protected UimaTimer _newTimer()
Description copied from class:UIMAFramework
To be implemented by subclasses; this should return a new UIMAUimaTimer
instance.- Specified by:
_newTimer
in classUIMAFramework
- Returns:
- a new
Timer
instance - See Also:
UIMAFramework._newTimer()
-
_produceCollectionProcessingEngine
protected CollectionProcessingEngine _produceCollectionProcessingEngine(CpeDescription aCpeDescription, java.util.Map<java.lang.String,java.lang.Object> aAdditionalParams) throws ResourceInitializationException
Description copied from class:UIMAFramework
To be implemented by subclasses; this should produce aCollectionProcessingEngine
instance from acpeDescription
.- Specified by:
_produceCollectionProcessingEngine
in classUIMAFramework
- Parameters:
aCpeDescription
- an object that specifies how to create an instance of aCollectionProcessingEngine
.aAdditionalParams
- a Map containing additional parameters to pass to theCollectionProcessingEngine.initialize(CpeDescription,Map)
method. May benull
if there are no parameters. Parameter names are defined as constants on theAnalysisEngine
, andResource
. Furthermore, the entry under the keyResource.PARAM_PERFORMANCE_TUNING_SETTINGS
is a map which may contain settings with keys defined as constants hereUIMAFramework
interfaces. For example this can be used to set performance-tuning settings as described inUIMAFramework.getDefaultPerformanceTuningProperties()
.- Returns:
- a
CollectionProcessingEngine
instance. - Throws:
ResourceInitializationException
- if a failure occurred during production of the CPE.
-
_getDefaultPerformanceTuningProperties
protected java.util.Properties _getDefaultPerformanceTuningProperties()
Description copied from class:UIMAFramework
To be implemented by subclasses; this should return a Properties object representing the default performance tuning settings for the framework. It must return a new Properties object each time it is called.- Specified by:
_getDefaultPerformanceTuningProperties
in classUIMAFramework
- Returns:
- default performance tuning properties
-
parseFactoryConfig
protected void parseFactoryConfig() throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.io.IOException, java.lang.ClassNotFoundException, java.lang.InstantiationException, java.lang.IllegalAccessException
Parses the factoryConfig.xml file and sets up the ResourceFactory, ResourceSpecifierFactory, and XMLParser.- Throws:
javax.xml.parsers.ParserConfigurationException
- if the XML parser could not be configuredorg.xml.sax.SAXException
- if factoryConfig.xml could not be parsedjava.lang.ClassNotFoundException
- -java.lang.IllegalAccessException
- -java.lang.InstantiationException
- -java.io.IOException
- -
-
-