Class UIMAFramework
- Direct Known Subclasses:
UIMAFramework_impl
This class also provides the ability to change the underlying UIMA implementation. All UIMA
implementations must provide a subclass of UIMAFramework as part of their
distribution. If you wish to use a UIMA implementation other than the default reference
implementation, set the System property uima.framework_impl to the fully qualified
class name of the UIMAFramework subclass that you wish to use. Note that this must
be done prior to loading this class. If the uima.framework_impl property has not
been set when this class is loaded, the default reference implementation will be used.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringKey to be used in the Properties object returned bygetDefaultPerformanceTuningProperties().static final StringKey to be used in the Properties object returned bygetDefaultPerformanceTuningProperties().static final ThreadLocal<ConfigurationManager>static final ThreadLocal<ResourceManager>static final StringKey to be used in the Properties object returned bygetDefaultPerformanceTuningProperties().static final StringKey to be used in the Properties object returned bygetDefaultPerformanceTuningProperties().static final ObjectKey to be used in the Properties object returned bygetDefaultPerformanceTuningProperties(). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract shortTo be implemented by subclasses; this should return the build revision number of this implementation.protected abstract PropertiesTo be implemented by subclasses; this should return a Properties object representing the default performance tuning settings for the framework.protected abstract LoggerTo be implemented by subclasses; this should return a reference to the default UIMALoggerused by this implementation.protected abstract Logger_getLogger(Class<?> component) To be implemented by subclasses; this should return a reference to the UIMALoggerof the specified source class.protected abstract shortTo be implemented by subclasses; this should return the major version number of this implementation.protected abstract shortTo be implemented by subclasses; this should return the minor version number of this implementation.protected abstract CompositeResourceFactoryTo be implemented by subclasses; this should return a reference to theResourceFactoryused by this implementation, which must implementCompositeResourceFactory.protected abstract ResourceSpecifierFactoryTo be implemented by subclasses; this should return a reference to theResourceSpecifierFactoryused by this implementation.protected abstract XMLParserTo be implemented by subclasses; this should return a reference to the UIMAXMLParserused by this implementation.protected abstract voidTo be implemented by subclasses; called from this class's static initializer to complete initialization of the singleton instance.protected abstract CollectionProcessingManager_newCollectionProcessingManager(ResourceManager aResourceManager) To be implemented by subclasses; this should create a new instance of a class implementingCollectionProcessingManager.protected abstract ConfigurationManagerTo be implemented by subclasses; this should return a new instance of the defaultConfigurationManagerused by this implementation.protected abstract ResourceManagerTo be implemented by subclasses; this should return a new instance of the defaultResourceManagerused by this implementation.protected abstract ResourceManagerTo be implemented by subclasses; this should return a new instance of the defaultResourceManagerPearWrapperused by this implementation.protected abstract LoggerTo be implemented by subclasses; this should return a new UIMALoggerinstance.protected abstract UimaTimerTo be implemented by subclasses; this should return a new UIMAUimaTimerinstance.protected abstract UimaContextAdminTo be implemented by subclasses; this should return a new instance of the defaultUimaContextAdminused by this implementation.protected abstract CollectionProcessingEngine_produceCollectionProcessingEngine(CpeDescription aCpeDescription, Map<String, Object> aAdditionalParams) To be implemented by subclasses; this should produce aCollectionProcessingEngineinstance from acpeDescription.static shortGets the build revision number of the framework implementation.static PropertiesGets the default performance tuning settings for the framework.protected static UIMAFrameworkGets theUIMAFrameworkinstance currently in use.static LoggerGets theLoggerused by the UIMA framework.static LoggerGets theLoggerused by a particular Class, for example an Annotator.static shortGets the major version number of the framework implementation.static shortGets the minor version number of the framework implementation.static CompositeResourceFactoryGet a reference to theResourceFactory.static ResourceSpecifierFactoryGet a reference to theResourceSpecifierFactory.static StringGets the framework implementation's version number as a string.static XMLParserGet a reference to the UIMAXMLParser, which is used to parseResourceSpecifierobjects from their XML representations.static CollectionProcessingManagerCreates a newCollectionProcessingManagerinstance.static CollectionProcessingManagernewCollectionProcessingManager(ResourceManager aResourceManager) Creates a newCollectionProcessingManagerinstance.static ConfigurationManagerGets a new instance of theConfigurationManagerused by this implementation.static ResourceManagerGets a new instance of the defaultResourceManagerused by this implementation.static ResourceManagerGets a new instance of the defaultResourceManagerPearWrapperused by this implementation.static LoggerCreates a newLogger, which can be passed for example to theAnalysisEngine.setLogger(Logger)method in order to have separate Analysis Engine instances used separate loggers.static UimaTimernewTimer()Creates a newUimaTimer, which is used to collect performance statistics for UIMA components.static UimaContextAdminnewUimaContext(Logger aLogger, ResourceManager aResourceManager, ConfigurationManager aConfigManager) Gets a new instance of aUimaContext.static AnalysisEngineproduceAnalysisEngine(ResourceSpecifier aSpecifier) Produces anAnalysisEngineinstance from aResourceSpecifier.static AnalysisEngineproduceAnalysisEngine(ResourceSpecifier aSpecifier, int aMaxSimultaneousRequests, int aTimeoutPeriod) Produces anAnalysisEngineinstance from aResourceSpecifier.static AnalysisEngineproduceAnalysisEngine(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) Produces anAnalysisEngineinstance from aResourceSpecifier.static AnalysisEngineproduceAnalysisEngine(ResourceSpecifier aSpecifier, ResourceManager aResourceManager, Map<String, Object> aAdditionalParams) Produces anAnalysisEngineinstance from aResourceSpecifier.static CasConsumerproduceCasConsumer(ResourceSpecifier aSpecifier) Produces aCasConsumerinstance from aResourceSpecifier.static CasConsumerproduceCasConsumer(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) Produces aCasConsumerinstance from aResourceSpecifier.static CasConsumerproduceCasConsumer(ResourceSpecifier aSpecifier, ResourceManager aResourceManager, Map<String, Object> aAdditionalParams) Produces anCasConsumerinstance from aResourceSpecifier.static CasInitializerproduceCasInitializer(ResourceSpecifier aSpecifier) Deprecated.As of v2.0, CAS Initializers are deprecated.static CasInitializerproduceCasInitializer(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) Produces aCasInitializerinstance from aResourceSpecifier.static CasInitializerproduceCasInitializer(ResourceSpecifier aSpecifier, ResourceManager aResourceManager, Map<String, Object> aAdditionalParams) Produces anCasInitializerinstance from aResourceSpecifier.static CollectionProcessingEngineproduceCollectionProcessingEngine(CpeDescription aCpeDescription) Produces aCollectionProcessingEngineinstance from acpeDescription.static CollectionProcessingEngineproduceCollectionProcessingEngine(CpeDescription aCpeDescription, Map<String, Object> aAdditionalParams) Produces aCollectionProcessingEngineinstance from acpeDescription.static CollectionProcessingEngineproduceCollectionProcessingEngine(CpeDescription aCpeDescription, ResourceManager aResourceManager, Map<String, Object> aAdditionalParams) Produces aCollectionProcessingEngineinstance from acpeDescription.static CollectionReaderproduceCollectionReader(ResourceSpecifier aSpecifier) Produces aCollectionReaderinstance from aResourceSpecifier.static CollectionReaderproduceCollectionReader(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) Produces aCollectionReaderinstance from aResourceSpecifier.static CollectionReaderproduceCollectionReader(ResourceSpecifier aSpecifier, ResourceManager aResourceManager, Map<String, Object> aAdditionalParams) Produces anCollectionReaderinstance from aResourceSpecifier.static ResourceproduceResource(Class<? extends Resource> aResourceClass, ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) Produces an appropriateResourceinstance of a specified class from aResourceSpecifier.static ResourceproduceResource(Class<? extends Resource> aResourceClass, ResourceSpecifier aSpecifier, ResourceManager aResourceManager, Map<String, Object> aAdditionalParams) Produces an appropriateResourceinstance of a specified class from aResourceSpecifier.static ResourceproduceResource(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) Produces an appropriateResourceinstance from aResourceSpecifier.static TextAnalysisEngineproduceTAE(ResourceSpecifier aSpecifier) Deprecated.As of v2.0,produceAnalysisEngine(ResourceSpecifier)should be used instead.static TextAnalysisEngineproduceTAE(ResourceSpecifier aSpecifier, int aMaxSimultaneousRequests, int aTimeoutPeriod) Deprecated.As of v2.0,produceAnalysisEngine(ResourceSpecifier,int,int)should be used instead.static TextAnalysisEngineproduceTAE(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) Deprecated.As of v2.0,produceAnalysisEngine(ResourceSpecifier,Map)should be used instead.static TextAnalysisEngineproduceTAE(ResourceSpecifier aSpecifier, ResourceManager aResourceManager, Map<String, Object> aAdditionalParams) Deprecated.As of v2.0,produceAnalysisEngine(ResourceSpecifier,ResourceManager,Map)should be used instead.
-
Field Details
-
CAS_INITIAL_HEAP_SIZE
Key to be used in the Properties object returned bygetDefaultPerformanceTuningProperties(). The value of this key represents the size of the initial CAS heap in terms of the number of cells (32 bits per cell).- See Also:
-
PROCESS_TRACE_ENABLED
Key to be used in the Properties object returned bygetDefaultPerformanceTuningProperties(). The value of this key indicates whether the ProcessTrace mechanism (which tracks the time spent in individual components of an aggregate AE or CPE) is enabled. A value of "true" (case insensitive) enables ProcessTrace; any other value disables process trace.- See Also:
-
SOCKET_KEEPALIVE_ENABLED
Key to be used in the Properties object returned bygetDefaultPerformanceTuningProperties(). The value of this key indicates whether socket KeepAlive should be turned on (currently implemented only for Vinci clients). The default is true. A value of "false" (case insensitive) for this property disables the keepAlive; any other value leaves the default setting of true.- See Also:
-
JCAS_CACHE_ENABLED
Key to be used in the Properties object returned bygetDefaultPerformanceTuningProperties(). The value of this key indicates whether the JCas object cache should be used (significant memory overhead, but may have performance benefits). The default is true. A value of "false" (case insensitive) for this property disables the cache; any other value leaves the default setting of true.- See Also:
-
SKIP_USER_JCAS_LOADING
Key to be used in the Properties object returned bygetDefaultPerformanceTuningProperties(). The value of this key indicates whether user-defined JCas classes should be loaded or skipped, during type system commit. The default is false; set to "true" to skip. This is used by the Component Descriptor Editor when manipulating type systems, to avoid any issues with loading and working with different type systems where any JCas classes might not match.- See Also:
-
newContextResourceManager
-
newContextConfigManager
-
-
Constructor Details
-
UIMAFramework
public UIMAFramework()
-
-
Method Details
-
_getDefaultPerformanceTuningProperties
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.- Returns:
- default performance tuning properties
-
getVersionString
Gets the framework implementation's version number as a string. This will be the major version number, minor version number, and build revision in that order, separated by dots.- Returns:
- the version number string
-
getMajorVersion
public static short getMajorVersion()Gets the major version number of the framework implementation.- Returns:
- the major version number
-
getMinorVersion
public static short getMinorVersion()Gets the minor version number of the framework implementation.- Returns:
- the minor version number
-
getBuildRevision
public static short getBuildRevision()Gets the build revision number of the framework implementation.- Returns:
- the build revision number
-
getResourceFactory
Get a reference to theResourceFactory. Most applications do not need to deal with theResourceFactory- instead one of the staticproducemethods on this class may be used to create Resources.The framework's Resource Factory always implements
CompositeResourceFactory. A composite resource factory produces resources by delegating to otherResourceFactoryobjects. Developers to register their own specializedResourceFactoryobjects by calling theCompositeResourceFactory.registerFactory(Class,ResourceFactory)method.- Returns:
- the
ResourceFactoryto be used by the application.
-
getResourceSpecifierFactory
Get a reference to theResourceSpecifierFactory. This factory is used when constructingResourceSpecifiers from scratch.- Returns:
- the
ResourceSpecifierFactoryto be used by the application.
-
getXMLParser
Get a reference to the UIMAXMLParser, which is used to parseResourceSpecifierobjects from their XML representations.- Returns:
- the
XMLParserto be used by the application.
-
newCollectionProcessingManager
Creates a newCollectionProcessingManagerinstance. TheCollectionProcessingManagerfacilitates the development of applications that process collections of entities using anAnalysisEngine.- Returns:
- a new
CollectionProcessingManagerinstance to be used by the application.
-
newCollectionProcessingManager
public static CollectionProcessingManager newCollectionProcessingManager(ResourceManager aResourceManager) Creates a newCollectionProcessingManagerinstance. TheCollectionProcessingManagerfacilitates the development of applications that process collections of entities using anAnalysisEngine.- Parameters:
aResourceManager- theResourceManagerto be used by this CPM. If not specified, the default one returned bynewDefaultResourceManager()will be used.- Returns:
- a new
CollectionProcessingManagerinstance to be used by the application.
-
produceResource
public static Resource produceResource(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) throws ResourceInitializationExceptionProduces an appropriateResourceinstance from aResourceSpecifier. TheResourceSpecifiermay either specify how to construct a new instance or how to locate an existing instance.- Parameters:
aSpecifier- an object that specifies how to acquire an instance of aResource.aAdditionalParams- a Map containing additional parameters to pass to theResource.initialize(ResourceSpecifier,Map)method. May benullif there are no parameters. Parameter names are defined as constants on theAnalysisEngine, andResource. Furthermore, the entry under the keyResource.PARAM_PERFORMANCE_TUNING_SETTINGSis a map which may contain settings with keys defined as constants hereUIMAFrameworkinterfaces. For example this can be used to set performance-tuning settings as described ingetDefaultPerformanceTuningProperties().- Returns:
- a
Resourceinstance. - Throws:
ResourceInitializationException- if a failure occurred during production of the resource.
-
produceResource
public static Resource produceResource(Class<? extends Resource> aResourceClass, ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) throws ResourceInitializationExceptionProduces an appropriateResourceinstance of a specified class from aResourceSpecifier. TheResourceSpecifiermay either specify how to construct a new instance or how to locate an existing instance.- Parameters:
aResourceClass- a subclass ofResourceto be produced.aSpecifier- an object that specifies how to acquire an instance of aResource.aAdditionalParams- a Map containing additional parameters to pass to theResource.initialize(ResourceSpecifier,Map)method. May benullif there are no parameters. Parameter names are defined as constants on theAnalysisEngine, andResource. Furthermore, the entry under the keyResource.PARAM_PERFORMANCE_TUNING_SETTINGSis a map which may contain settings with keys defined as constants hereUIMAFrameworkinterfaces. For example this can be used to set performance-tuning settings as described ingetDefaultPerformanceTuningProperties().- Returns:
- a
Resourceinstance. This will be a subclass ofaResourceClass. - Throws:
ResourceInitializationException- if a failure occurred during production of the resource.
-
produceResource
public static Resource produceResource(Class<? extends Resource> aResourceClass, ResourceSpecifier aSpecifier, ResourceManager aResourceManager, Map<String, Object> aAdditionalParams) throws ResourceInitializationExceptionProduces an appropriateResourceinstance of a specified class from aResourceSpecifier. TheResourceSpecifiermay either specify how to construct a new instance or how to locate an existing instance.- Parameters:
aResourceClass- a subclass ofResourceto be produced.aSpecifier- an object that specifies how to acquire an instance of aResource.aResourceManager- theResourceManagerto be used by this analysis engine. If not specified, the default one returned bynewDefaultResourceManager()will be used.aAdditionalParams- a Map containing additional parameters to pass to theResource.initialize(ResourceSpecifier,Map)method. May benullif there are no parameters. Parameter names are defined as constants on theAnalysisEngine, andResource. Furthermore, the entry under the keyResource.PARAM_PERFORMANCE_TUNING_SETTINGSis a map which may contain settings with keys defined as constants hereUIMAFrameworkinterfaces. For example this can be used to set performance-tuning settings as described ingetDefaultPerformanceTuningProperties().- Returns:
- a
Resourceinstance. This will be a subclass ofaResourceClass. - Throws:
ResourceInitializationException- if a failure occurred during production of the resource.
-
produceAnalysisEngine
public static AnalysisEngine produceAnalysisEngine(ResourceSpecifier aSpecifier) throws ResourceInitializationException Produces anAnalysisEngineinstance from aResourceSpecifier. TheResourceSpecifiermay either specify how to construct a new instance or how to locate an existing instance.The AnalysisEngine returned from this method is not guaranteed to be able to process multiple simultaneous requests. See
produceAnalysisEngine(ResourceSpecifier,int,int)for more information.- Parameters:
aSpecifier- an object that specifies how to acquire an instance of aResource. This must specify a subclass ofAnalysisEngine.- Returns:
- an
AnalysisEngineinstance. - Throws:
ResourceInitializationException- if a failure occurred during production of the resource.
-
produceAnalysisEngine
public static AnalysisEngine produceAnalysisEngine(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) throws ResourceInitializationExceptionProduces anAnalysisEngineinstance from aResourceSpecifier. TheResourceSpecifiermay either specify how to construct a new instance or how to locate an existing instance.- Parameters:
aSpecifier- an object that specifies how to acquire an instance of aResource. This must specify a subclass ofAnalysisEngine.aAdditionalParams- a Map containing additional parameters to pass to theResource.initialize(ResourceSpecifier,Map)method. May benullif there are no parameters. Parameter names are defined as constants on theAnalysisEngine, andResource. Furthermore, the entry under the keyResource.PARAM_PERFORMANCE_TUNING_SETTINGSis a map which may contain settings with keys defined as constants hereUIMAFrameworkinterfaces. For example this can be used to set performance-tuning settings as described ingetDefaultPerformanceTuningProperties().- Returns:
- an
AnalysisEngineinstance. - Throws:
ResourceInitializationException- if a failure occurred during production of the resource.
-
produceAnalysisEngine
public static AnalysisEngine produceAnalysisEngine(ResourceSpecifier aSpecifier, ResourceManager aResourceManager, Map<String, Object> aAdditionalParams) throws ResourceInitializationExceptionProduces anAnalysisEngineinstance from aResourceSpecifier. TheResourceSpecifiermay either specify how to construct a new instance or how to locate an existing instance.- Parameters:
aSpecifier- an object that specifies how to acquire an instance of aResource. This must specify a subclass ofAnalysisEngine.aResourceManager- theResourceManagerto be used by this analysis engine. If not specified, the default one returned bynewDefaultResourceManager()will be used.aAdditionalParams- a Map containing additional parameters to pass to theResource.initialize(ResourceSpecifier,Map)method. May benullif there are no parameters. Parameter names are defined as constants on theAnalysisEngine, andResource. Furthermore, the entry under the keyResource.PARAM_PERFORMANCE_TUNING_SETTINGSis a map which may contain settings with keys defined as constants hereUIMAFrameworkinterfaces. For example this can be used to set performance-tuning settings as described ingetDefaultPerformanceTuningProperties().- Returns:
- an
AnalysisEngineinstance. - Throws:
ResourceInitializationException- if a failure occurred during production of the resource.
-
produceAnalysisEngine
public static AnalysisEngine produceAnalysisEngine(ResourceSpecifier aSpecifier, int aMaxSimultaneousRequests, int aTimeoutPeriod) throws ResourceInitializationException Produces anAnalysisEngineinstance from aResourceSpecifier. TheResourceSpecifiermay either specify how to construct a new instance or how to locate an existing instance.This version of
produceAnalysisEngineallows the convenient creation of AnalysisEngines that can handle multiple simultaneous requests. Using this method is equivalent to usingproduceAnalysisEngine(ResourceSpecifier,Map)and including values forAnalysisEngine.PARAM_NUM_SIMULTANEOUS_REQUESTSandAnalysisEngine.PARAM_TIMEOUT_PERIODin the parameter map.- Parameters:
aSpecifier- an object that specifies how to acquire an instance of aResource. This must specify a subclass ofAnalysisEngine.aMaxSimultaneousRequests- the number of simultaneous requests that this AnalysisEngine should be able to process. The value for this parameter should be chosen careful - see the JavaDocs forAnalysisEngine.PARAM_NUM_SIMULTANEOUS_REQUESTS.aTimeoutPeriod- - when the number of simultaneous requests exceedsaMaxSimultaneousReqeusts, additional requests will wait for other requests to finish. This parameter determines the maximum number of milliseconds that a new request should wait before throwing an exception - a value of 0 will cause them to wait forever. See the JavaDocs forAnalysisEngine.PARAM_TIMEOUT_PERIOD.- Returns:
- an
AnalysisEngineinstance. - Throws:
ResourceInitializationException- if a failure occurred during production of the resource.
-
produceTAE
@Deprecated public static TextAnalysisEngine produceTAE(ResourceSpecifier aSpecifier) throws ResourceInitializationException Deprecated.As of v2.0,produceAnalysisEngine(ResourceSpecifier)should be used instead.Produces aTextAnalysisEngineinstance from aResourceSpecifier. TheResourceSpecifiermay either specify how to construct a new instance or how to locate an existing instance.The TextAnalysisEngine returned from this method is not guaranteed to be able to process multiple simultaneous requests. See
produceTAE(ResourceSpecifier,int,int)for more information.- Parameters:
aSpecifier- an object that specifies how to acquire an instance of aResource. This must specify a subclass ofTextAnalysisEngine.- Returns:
- a
TextAnalysisEngineinstance. - Throws:
ResourceInitializationException- if a failure occurred during production of the resource.
-
produceTAE
@Deprecated public static TextAnalysisEngine produceTAE(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) throws ResourceInitializationExceptionDeprecated.As of v2.0,produceAnalysisEngine(ResourceSpecifier,Map)should be used instead.Produces aTextAnalysisEngineinstance from aResourceSpecifier. TheResourceSpecifiermay either specify how to construct a new instance or how to locate an existing instance.- Parameters:
aSpecifier- an object that specifies how to acquire an instance of aResource. This must specify a subclass ofTextAnalysisEngine.aAdditionalParams- a Map containing additional parameters to pass to theResource.initialize(ResourceSpecifier,Map)method. May benullif there are no parameters. Parameter names are defined as constants on theAnalysisEngine, andResource. Furthermore, the entry under the keyResource.PARAM_PERFORMANCE_TUNING_SETTINGSis a map which may contain settings with keys defined as constants hereUIMAFrameworkinterfaces. For example this can be used to set performance-tuning settings as described ingetDefaultPerformanceTuningProperties().- Returns:
- a
TextAnalysisEngineinstance. - Throws:
ResourceInitializationException- if a failure occurred during production of the resource.
-
produceTAE
@Deprecated public static TextAnalysisEngine produceTAE(ResourceSpecifier aSpecifier, ResourceManager aResourceManager, Map<String, Object> aAdditionalParams) throws ResourceInitializationExceptionDeprecated.As of v2.0,produceAnalysisEngine(ResourceSpecifier,ResourceManager,Map)should be used instead.Produces anTextAnalysisEngineinstance from aResourceSpecifier. TheResourceSpecifiermay either specify how to construct a new instance or how to locate an existing instance.- Parameters:
aSpecifier- an object that specifies how to acquire an instance of aResource. This must specify a subclass ofTextAnalysisEngine.aResourceManager- theResourceManagerto be used by this analysis engine. If not specified, the default one returned bynewDefaultResourceManager()will be used.aAdditionalParams- a Map containing additional parameters to pass to theResource.initialize(ResourceSpecifier,Map)method. May benullif there are no parameters. Parameter names are defined as constants on theAnalysisEngine, andResource. Furthermore, the entry under the keyResource.PARAM_PERFORMANCE_TUNING_SETTINGSis a map which may contain settings with keys defined as constants hereUIMAFrameworkinterfaces. For example this can be used to set performance-tuning settings as described ingetDefaultPerformanceTuningProperties().- Returns:
- a
TextAnalysisEngineinstance. - Throws:
ResourceInitializationException- if a failure occurred during production of the resource.
-
produceTAE
@Deprecated public static TextAnalysisEngine produceTAE(ResourceSpecifier aSpecifier, int aMaxSimultaneousRequests, int aTimeoutPeriod) throws ResourceInitializationException Deprecated.As of v2.0,produceAnalysisEngine(ResourceSpecifier,int,int)should be used instead.Produces aTextAnalysisEngineinstance from aResourceSpecifier. TheResourceSpecifiermay either specify how to construct a new instance or how to locate an existing instance.This version of
produceTAEallows the convenient creation of TAEs that can handle multiple simultaneous requests. Using this method is equivalent to usingproduceTAE(ResourceSpecifier,Map)and including values forAnalysisEngine.PARAM_NUM_SIMULTANEOUS_REQUESTSandAnalysisEngine.PARAM_TIMEOUT_PERIODin the parameter map.- Parameters:
aSpecifier- an object that specifies how to acquire an instance of aResource. This must specify a subclass ofTextAnalysisEngine.aMaxSimultaneousRequests- the number of simultaneous requests that this TAE should be able to process. The value for this parameter should be chosen careful - see the JavaDocs forAnalysisEngine.PARAM_NUM_SIMULTANEOUS_REQUESTS.aTimeoutPeriod- - when the number of simultaneous requests exceedsaMaxSimultaneousReqeusts, additional requests will wait for other requests to finish. This parameter determines the maximum number of milliseconds that a new request should wait before throwing an exception - a value of 0 will cause them to wait forever. See the JavaDocs forAnalysisEngine.PARAM_TIMEOUT_PERIOD.- Returns:
- a
TextAnalysisEngineinstance. - Throws:
ResourceInitializationException- if a failure occurred during production of the resource.
-
produceCasConsumer
public static CasConsumer produceCasConsumer(ResourceSpecifier aSpecifier) throws ResourceInitializationException Produces aCasConsumerinstance from aResourceSpecifier. TheResourceSpecifiermay either specify how to construct a new instance or how to locate an existing instance.- Parameters:
aSpecifier- an object that specifies how to acquire an instance of aResource. This must specify a subclass ofCasConsumer.- Returns:
- a
CasConsumerinstance. - Throws:
ResourceInitializationException- if a failure occurred during production of the resource.
-
produceCasConsumer
public static CasConsumer produceCasConsumer(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) throws ResourceInitializationExceptionProduces aCasConsumerinstance from aResourceSpecifier. TheResourceSpecifiermay either specify how to construct a new instance or how to locate an existing instance.- Parameters:
aSpecifier- an object that specifies how to acquire an instance of aResource. This must specify a subclass ofCasConsumer.aAdditionalParams- a Map containing additional parameters to pass to theResource.initialize(ResourceSpecifier,Map)method. May benullif there are no parameters. Parameter names are defined as constants on theAnalysisEngine, andResource. Furthermore, the entry under the keyResource.PARAM_PERFORMANCE_TUNING_SETTINGSis a map which may contain settings with keys defined as constants hereUIMAFrameworkinterfaces. For example this can be used to set performance-tuning settings as described ingetDefaultPerformanceTuningProperties().- Returns:
- a
CasConsumerinstance. - Throws:
ResourceInitializationException- if a failure occurred during production of the resource.
-
produceCasConsumer
public static CasConsumer produceCasConsumer(ResourceSpecifier aSpecifier, ResourceManager aResourceManager, Map<String, Object> aAdditionalParams) throws ResourceInitializationExceptionProduces anCasConsumerinstance from aResourceSpecifier. TheResourceSpecifiermay either specify how to construct a new instance or how to locate an existing instance.- Parameters:
aSpecifier- an object that specifies how to acquire an instance of aResource. This must specify a subclass ofCasConsumer.aResourceManager- theResourceManagerto be used by this CasConsumer. If not specified, the default one returned bynewDefaultResourceManager()will be used.aAdditionalParams- a Map containing additional parameters to pass to theResource.initialize(ResourceSpecifier,Map)method. May benullif there are no parameters. Parameter names are defined as constants on theAnalysisEngine, andResource. Furthermore, the entry under the keyResource.PARAM_PERFORMANCE_TUNING_SETTINGSis a map which may contain settings with keys defined as constants hereUIMAFrameworkinterfaces. For example this can be used to set performance-tuning settings as described ingetDefaultPerformanceTuningProperties().- Returns:
- an
CasConsumerinstance. - Throws:
ResourceInitializationException- if a failure occurred during production of the resource.
-
produceCollectionReader
public static CollectionReader produceCollectionReader(ResourceSpecifier aSpecifier) throws ResourceInitializationException Produces aCollectionReaderinstance from aResourceSpecifier. TheResourceSpecifiermay either specify how to construct a new instance or how to locate an existing instance.- Parameters:
aSpecifier- an object that specifies how to acquire an instance of aResource. This must specify a subclass ofCollectionReader.- Returns:
- a
CollectionReaderinstance. - Throws:
ResourceInitializationException- if a failure occurred during production of the resource.
-
produceCollectionReader
public static CollectionReader produceCollectionReader(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) throws ResourceInitializationExceptionProduces aCollectionReaderinstance from aResourceSpecifier. TheResourceSpecifiermay either specify how to construct a new instance or how to locate an existing instance.- Parameters:
aSpecifier- an object that specifies how to acquire an instance of aResource. This must specify a subclass ofCollectionReader.aAdditionalParams- a Map containing additional parameters to pass to theResource.initialize(ResourceSpecifier,Map)method. May benullif there are no parameters. Parameter names are defined as constants on theAnalysisEngine, andResource. Furthermore, the entry under the keyResource.PARAM_PERFORMANCE_TUNING_SETTINGSis a map which may contain settings with keys defined as constants hereUIMAFrameworkinterfaces. For example this can be used to set performance-tuning settings as described ingetDefaultPerformanceTuningProperties().- Returns:
- a
CollectionReaderinstance. - Throws:
ResourceInitializationException- if a failure occurred during production of the resource.
-
produceCollectionReader
public static CollectionReader produceCollectionReader(ResourceSpecifier aSpecifier, ResourceManager aResourceManager, Map<String, Object> aAdditionalParams) throws ResourceInitializationExceptionProduces anCollectionReaderinstance from aResourceSpecifier. TheResourceSpecifiermay either specify how to construct a new instance or how to locate an existing instance.- Parameters:
aSpecifier- an object that specifies how to acquire an instance of aResource. This must specify a subclass ofCollectionReader.aResourceManager- theResourceManagerto be used by this CollectionReader. If not specified, the default one returned bynewDefaultResourceManager()will be used.aAdditionalParams- a Map containing additional parameters to pass to theResource.initialize(ResourceSpecifier,Map)method. May benullif there are no parameters. Parameter names are defined as constants on theAnalysisEngine, andResource. Furthermore, the entry under the keyResource.PARAM_PERFORMANCE_TUNING_SETTINGSis a map which may contain settings with keys defined as constants hereUIMAFrameworkinterfaces. For example this can be used to set performance-tuning settings as described ingetDefaultPerformanceTuningProperties().- Returns:
- an
CollectionReaderinstance. - Throws:
ResourceInitializationException- if a failure occurred during production of the resource.
-
produceCasInitializer
@Deprecated public static CasInitializer produceCasInitializer(ResourceSpecifier aSpecifier) throws ResourceInitializationException Deprecated.As of v2.0, CAS Initializers are deprecated. A component that performs an operation like HTML detagging should instead be implemented as a "multi-Sofa" annotator. See org.apache.uima.examples.XmlDetagger for an example.Produces aCasInitializerinstance from aResourceSpecifier. TheResourceSpecifiermay either specify how to construct a new instance or how to locate an existing instance.- Parameters:
aSpecifier- an object that specifies how to acquire an instance of aResource. This must specify a subclass ofCasInitializer.- Returns:
- a
CasInitializerinstance. - Throws:
ResourceInitializationException- if a failure occurred during production of the resource.
-
produceCasInitializer
public static CasInitializer produceCasInitializer(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) throws ResourceInitializationExceptionProduces aCasInitializerinstance from aResourceSpecifier. TheResourceSpecifiermay either specify how to construct a new instance or how to locate an existing instance.- Parameters:
aSpecifier- an object that specifies how to acquire an instance of aResource. This must specify a subclass ofCasInitializer.aAdditionalParams- a Map containing additional parameters to pass to theResource.initialize(ResourceSpecifier,Map)method. May benullif there are no parameters. Parameter names are defined as constants on theAnalysisEngine, andResource. Furthermore, the entry under the keyResource.PARAM_PERFORMANCE_TUNING_SETTINGSis a map which may contain settings with keys defined as constants hereUIMAFrameworkinterfaces. For example this can be used to set performance-tuning settings as described ingetDefaultPerformanceTuningProperties().- Returns:
- a
CasInitializerinstance. - Throws:
ResourceInitializationException- if a failure occurred during production of the resource.
-
produceCasInitializer
public static CasInitializer produceCasInitializer(ResourceSpecifier aSpecifier, ResourceManager aResourceManager, Map<String, Object> aAdditionalParams) throws ResourceInitializationExceptionProduces anCasInitializerinstance from aResourceSpecifier. TheResourceSpecifiermay either specify how to construct a new instance or how to locate an existing instance.- Parameters:
aSpecifier- an object that specifies how to acquire an instance of aResource. This must specify a subclass ofCasInitializer.aResourceManager- theResourceManagerto be used by this CasInitializer. If not specified, the default one returned bynewDefaultResourceManager()will be used.aAdditionalParams- a Map containing additional parameters to pass to theResource.initialize(ResourceSpecifier,Map)method. May benullif there are no parameters. Parameter names are defined as constants on theAnalysisEngine, andResource. Furthermore, the entry under the keyResource.PARAM_PERFORMANCE_TUNING_SETTINGSis a map which may contain settings with keys defined as constants hereUIMAFrameworkinterfaces. For example this can be used to set performance-tuning settings as described ingetDefaultPerformanceTuningProperties().- Returns:
- an
CasInitializerinstance. - Throws:
ResourceInitializationException- if a failure occurred during production of the resource.
-
produceCollectionProcessingEngine
public static CollectionProcessingEngine produceCollectionProcessingEngine(CpeDescription aCpeDescription) throws ResourceInitializationException Produces aCollectionProcessingEngineinstance from acpeDescription.- Parameters:
aCpeDescription- an object that specifies how to create an instance of aCollectionProcessingEngine.- Returns:
- a
CollectionProcessingEngineinstance. - Throws:
ResourceInitializationException- if a failure occurred during production of the CPE.
-
produceCollectionProcessingEngine
public static CollectionProcessingEngine produceCollectionProcessingEngine(CpeDescription aCpeDescription, Map<String, Object> aAdditionalParams) throws ResourceInitializationExceptionProduces aCollectionProcessingEngineinstance from acpeDescription.- 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 benullif there are no parameters. Parameter names are defined as constants on theAnalysisEngine, andResource. Furthermore, the entry under the keyResource.PARAM_PERFORMANCE_TUNING_SETTINGSis a map which may contain settings with keys defined as constants hereUIMAFrameworkinterfaces. For example this can be used to set performance-tuning settings as described ingetDefaultPerformanceTuningProperties().- Returns:
- a
CollectionProcessingEngineinstance. - Throws:
ResourceInitializationException- if a failure occurred during production of the CPE.
-
produceCollectionProcessingEngine
public static CollectionProcessingEngine produceCollectionProcessingEngine(CpeDescription aCpeDescription, ResourceManager aResourceManager, Map<String, Object> aAdditionalParams) throws ResourceInitializationExceptionProduces aCollectionProcessingEngineinstance from acpeDescription.- Parameters:
aCpeDescription- an object that specifies how to create an instance of aCollectionProcessingEngine.aResourceManager- theResourceManagerto be used by this CollectionProcessingEngine. If not specified, the default one returned bynewDefaultResourceManager()will be used.aAdditionalParams- a Map containing additional parameters to pass to theCollectionProcessingEngine.initialize(CpeDescription,Map)method. May benullif there are no parameters. Parameter names are defined as constants on theAnalysisEngine, andResource. Furthermore, the entry under the keyResource.PARAM_PERFORMANCE_TUNING_SETTINGSis a map which may contain settings with keys defined as constants hereUIMAFrameworkinterfaces. For example this can be used to set performance-tuning settings as described ingetDefaultPerformanceTuningProperties().- Returns:
- a
CollectionProcessingEngineinstance. - Throws:
ResourceInitializationException- if a failure occurred during production of the CPE.
-
getLogger
Gets theLoggerused by the UIMA framework. An application won't generally write to this logger, although nothing is stopping it from doing so.In the UIMA SDK, the logger is implemented using the Java 1.4 logger as a back end. If you want to configure the logger, for example to specify the location of the log file and the logging level, you should use the standard Java 1.4 logger properties or the java.util.logging APIs. See the section "Specifying the Logging Configuration" in the Annotator and Analysis Engine Developer's Guide chapter of the UIMA documentation for more information.
- Returns:
- the default Logger used by UIMA components
-
getLogger
Gets theLoggerused by a particular Class, for example an Annotator. An application won't generally write to this logger, although nothing is stopping it from doing so.In the UIMA SDK, the logger is implemented using the Java 1.4 logger as a back end. If you want to configure the logger, for example to specify the location of the log file and the logging level, you should use the standard Java 1.4 logger properties or the java.util.logging APIs. See the section "Specifying the Logging Configuration" in the Annotator and Analysis Engine Developer's Guide chapter of the UIMA documentation for more information.
- Parameters:
component- the Class for a component, for example an Annotator or CAS Consumer- Returns:
- the Logger used by the specified component class
-
newLogger
Creates a newLogger, which can be passed for example to theAnalysisEngine.setLogger(Logger)method in order to have separate Analysis Engine instances used separate loggers.- Returns:
- a new Logger instance
- See Also:
-
newTimer
Creates a newUimaTimer, which is used to collect performance statistics for UIMA components.- Returns:
- a new Timer instance
-
newDefaultResourceManager
Gets a new instance of the defaultResourceManagerused by this implementation. An application can configure this ResourceManager and then pass it to theproduceAnalysisEngine(ResourceSpecifier,ResourceManager,Map)method.- Returns:
- a new
ResourceManagerto be used by the application.
-
newDefaultResourceManagerPearWrapper
Gets a new instance of the defaultResourceManagerPearWrapperused by this implementation.- Returns:
- a new
ResourceManagerPearWrapperto be used by the application.
-
newConfigurationManager
Gets a new instance of theConfigurationManagerused by this implementation. This will be used by Resources to manage access to their configuration parameters.- Returns:
- a new
ConfigurationManagerto be used by the application.
-
newUimaContext
public static UimaContextAdmin newUimaContext(Logger aLogger, ResourceManager aResourceManager, ConfigurationManager aConfigManager) Gets a new instance of aUimaContext. Applications do not generally need to call this method.- Parameters:
aLogger- the logger that will be returned by this UimaContext'sgetLogger()method.aResourceManager- the ResourceManager that will be used by this UimaContext to locate and access external resource.aConfigManager- the ConfigurationManager that will be used by this UimaContext to manage Configuration Parameter settings.- Returns:
- a new UIMA Context to be used by the application.
-
getDefaultPerformanceTuningProperties
Gets the default performance tuning settings for the framework. Advanced users can tweak the framework by modifying these properties and passing the modified Properties object into theproduceTAE(ResourceSpecifier,Map)orproduceCollectionProcessingEngine(CpeDescription,Map)methods by putting it into theaAdditionalParamsmap under the keyResource.PARAM_PERFORMANCE_TUNING_SETTINGS. For example, the following code set the initial heap size allocated in the CAS to 100,000:Properties uimaPerfProps = UIMAFramework.getDefaultPerformanceTuningProperties(); uimaPerfProps.setProperty(UIMAFramework.CAS_INITIAL_HEAP_SIZE, "100000"); HashMap params = new HashMap(); params.put(Resource.PARAM_PERFORMANCE_TUNING_SETTINGS, uimaPerfProps); AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(specifier, params);
Valid keys for the
Propertiesobject returned by this method are specified as constants on this interface.- Returns:
- the default set of performance tuning properties. A new object is returned each time this method is called, so changes made to the returned objects will not affect other callers.
-
getInstance
Gets theUIMAFrameworkinstance currently in use.- Returns:
- the
UIMAFrameworkinstance currently in use
-
_getMajorVersion
protected abstract short _getMajorVersion()To be implemented by subclasses; this should return the major version number of this implementation.- Returns:
- the major version number
-
_getMinorVersion
protected abstract short _getMinorVersion()To be implemented by subclasses; this should return the minor version number of this implementation.- Returns:
- the minor version number
-
_initialize
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 thegetInstance()method can be used during initialization.- Throws:
Exception- if initialization fails
-
_getBuildRevision
protected abstract short _getBuildRevision()To be implemented by subclasses; this should return the build revision number of this implementation.- Returns:
- the build revision number
-
_getResourceFactory
To be implemented by subclasses; this should return a reference to theResourceFactoryused by this implementation, which must implementCompositeResourceFactory.- Returns:
- the
ResourceFactoryto be used by the application
-
_getResourceSpecifierFactory
To be implemented by subclasses; this should return a reference to theResourceSpecifierFactoryused by this implementation.- Returns:
- the
ResourceSpecifierFactoryto be used by the application.
-
_getXMLParser
To be implemented by subclasses; this should return a reference to the UIMAXMLParserused by this implementation.- Returns:
- the
XMLParserto be used by the application.
-
_newCollectionProcessingManager
protected abstract CollectionProcessingManager _newCollectionProcessingManager(ResourceManager aResourceManager) To be implemented by subclasses; this should create a new instance of a class implementingCollectionProcessingManager.- Parameters:
aResourceManager- the ResourceManager to be used by the CPM- Returns:
- a new
CollectionProcessingManagerto be used by the application.
-
_getLogger
To be implemented by subclasses; this should return a reference to the default UIMALoggerused by this implementation.- Returns:
- the default
Loggerused by this implementation
-
_getLogger
To be implemented by subclasses; this should return a reference to the UIMALoggerof the specified source class.- Parameters:
component- the class to get the logger for- Returns:
- the
Loggerof the specified source class
-
_newLogger
To be implemented by subclasses; this should return a new UIMALoggerinstance.- Returns:
- a new
Loggerinstance
-
_newTimer
To be implemented by subclasses; this should return a new UIMAUimaTimerinstance.- Returns:
- a new
Timerinstance
-
_newDefaultResourceManager
To be implemented by subclasses; this should return a new instance of the defaultResourceManagerused by this implementation.- Returns:
- a new
ResourceManagerto be used by the application.
-
_newDefaultResourceManagerPearWrapper
To be implemented by subclasses; this should return a new instance of the defaultResourceManagerPearWrapperused by this implementation.- Returns:
- a new
ResourceManagerPearWrapperto be used by the application.
-
_newConfigurationManager
To be implemented by subclasses; this should return a new instance of the defaultConfigurationManagerused by this implementation.- Returns:
- a new
ConfigurationManagerto be used by the application.
-
_newUimaContext
To be implemented by subclasses; this should return a new instance of the defaultUimaContextAdminused by this implementation.- Returns:
- a new
UimaContextAdminto be used by the application.
-
_produceCollectionProcessingEngine
protected abstract CollectionProcessingEngine _produceCollectionProcessingEngine(CpeDescription aCpeDescription, Map<String, Object> aAdditionalParams) throws ResourceInitializationExceptionTo be implemented by subclasses; this should produce aCollectionProcessingEngineinstance from acpeDescription.- 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 benullif there are no parameters. Parameter names are defined as constants on theAnalysisEngine, andResource. Furthermore, the entry under the keyResource.PARAM_PERFORMANCE_TUNING_SETTINGSis a map which may contain settings with keys defined as constants hereUIMAFrameworkinterfaces. For example this can be used to set performance-tuning settings as described ingetDefaultPerformanceTuningProperties().- Returns:
- a
CollectionProcessingEngineinstance. - Throws:
ResourceInitializationException- if a failure occurred during production of the CPE.
-