|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.uima.UIMAFramework
public abstract class UIMAFramework
This is an application's main interface point to the UIMA Framework. Static methods on this class allow the application to create instances of UIMA components.
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 | |
---|---|
static String |
CAS_INITIAL_HEAP_SIZE
Key to be used in the Properties object returned by getDefaultPerformanceTuningProperties() . |
static String |
JCAS_CACHE_ENABLED
Key to be used in the Properties object returned by getDefaultPerformanceTuningProperties() . |
static String |
PROCESS_TRACE_ENABLED
Key to be used in the Properties object returned by getDefaultPerformanceTuningProperties() . |
static Object |
SOCKET_KEEPALIVE_ENABLED
Key to be used in the Properties object returned by getDefaultPerformanceTuningProperties() . |
Constructor Summary | |
---|---|
UIMAFramework()
|
Method Summary | |
---|---|
protected abstract short |
_getBuildRevision()
To be implemented by subclasses; this should return the build revision number of this implementation. |
protected abstract Properties |
_getDefaultPerformanceTuningProperties()
To be implemented by subclasses; this should return a Properties object representing the default performance tuning settings for the framework. |
protected abstract Logger |
_getLogger()
To be implemented by subclasses; this should return a reference to the default UIMA Logger used by this implementation. |
protected abstract Logger |
_getLogger(Class<?> component)
To be implemented by subclasses; this should return a reference to the UIMA Logger of
the specified source class. |
protected abstract short |
_getMajorVersion()
To be implemented by subclasses; this should return the major version number of this implementation. |
protected abstract short |
_getMinorVersion()
To be implemented by subclasses; this should return the minor version number of this implementation. |
protected abstract CompositeResourceFactory |
_getResourceFactory()
To be implemented by subclasses; this should return a reference to the ResourceFactory used by this implementation, which must implement
CompositeResourceFactory . |
protected abstract ResourceSpecifierFactory |
_getResourceSpecifierFactory()
To be implemented by subclasses; this should return a reference to the ResourceSpecifierFactory used by this implementation. |
protected abstract XMLParser |
_getXMLParser()
To be implemented by subclasses; this should return a reference to the UIMA XMLParser
used by this implementation. |
protected abstract void |
_initialize()
To 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 implementing CollectionProcessingManager . |
protected abstract ConfigurationManager |
_newConfigurationManager()
To be implemented by subclasses; this should return a new instance of the default ConfigurationManager used by this implementation. |
protected abstract ResourceManager |
_newDefaultResourceManager()
To be implemented by subclasses; this should return a new instance of the default ResourceManager used by this implementation. |
protected abstract ResourceManager |
_newDefaultResourceManagerPearWrapper()
To be implemented by subclasses; this should return a new instance of the default ResourceManagerPearWrapper used by this implementation. |
protected abstract Logger |
_newLogger()
To be implemented by subclasses; this should return a new UIMA Logger instance. |
protected abstract UimaTimer |
_newTimer()
To be implemented by subclasses; this should return a new UIMA UimaTimer instance. |
protected abstract UimaContextAdmin |
_newUimaContext()
To be implemented by subclasses; this should return a new instance of the default UimaContextAdmin used by this implementation. |
protected abstract CollectionProcessingEngine |
_produceCollectionProcessingEngine(CpeDescription aCpeDescription,
Map<String,Object> aAdditionalParams)
To be implemented by subclasses; this should produce a CollectionProcessingEngine
instance from a cpeDescription . |
static short |
getBuildRevision()
Gets the build revision number of the framework implementation. |
static Properties |
getDefaultPerformanceTuningProperties()
Gets the default performance tuning settings for the framework. |
protected static UIMAFramework |
getInstance()
Gets the UIMAFramework instance currently in use. |
static Logger |
getLogger()
Gets the Logger used by the UIMA framework. |
static Logger |
getLogger(Class<?> component)
Gets the Logger used by a particular Class, for example an
Annotator. |
static short |
getMajorVersion()
Gets the major version number of the framework implementation. |
static short |
getMinorVersion()
Gets the minor version number of the framework implementation. |
static CompositeResourceFactory |
getResourceFactory()
Get a reference to the ResourceFactory . |
static ResourceSpecifierFactory |
getResourceSpecifierFactory()
Get a reference to the ResourceSpecifierFactory . |
static String |
getVersionString()
Gets the framework implementation's version number as a string. |
static XMLParser |
getXMLParser()
Get a reference to the UIMA XMLParser , which is used to parse
ResourceSpecifier objects from their XML representations. |
static CollectionProcessingManager |
newCollectionProcessingManager()
Creates a new CollectionProcessingManager instance. |
static CollectionProcessingManager |
newCollectionProcessingManager(ResourceManager aResourceManager)
Creates a new CollectionProcessingManager instance. |
static ConfigurationManager |
newConfigurationManager()
Gets a new instance of the ConfigurationManager used by this implementation. |
static ResourceManager |
newDefaultResourceManager()
Gets a new instance of the default ResourceManager used by this implementation. |
static ResourceManager |
newDefaultResourceManagerPearWrapper()
Gets a new instance of the default ResourceManagerPearWrapper used by this implementation. |
static Logger |
newLogger()
Creates a new Logger , which can be passed for example to the
AnalysisEngine.setLogger(Logger) method in order to have separate Analysis Engine
instances used separate loggers. |
static UimaTimer |
newTimer()
Creates a new UimaTimer , which is used to collect performance
statistics for UIMA components. |
static UimaContextAdmin |
newUimaContext(Logger aLogger,
ResourceManager aResourceManager,
ConfigurationManager aConfigManager)
Gets a new instance of a UimaContext . |
static AnalysisEngine |
produceAnalysisEngine(ResourceSpecifier aSpecifier)
Produces an AnalysisEngine instance from a ResourceSpecifier . |
static AnalysisEngine |
produceAnalysisEngine(ResourceSpecifier aSpecifier,
int aMaxSimultaneousRequests,
int aTimeoutPeriod)
Produces an AnalysisEngine instance from a ResourceSpecifier . |
static AnalysisEngine |
produceAnalysisEngine(ResourceSpecifier aSpecifier,
Map<String,Object> aAdditionalParams)
Produces an AnalysisEngine instance from a ResourceSpecifier . |
static AnalysisEngine |
produceAnalysisEngine(ResourceSpecifier aSpecifier,
ResourceManager aResourceManager,
Map<String,Object> aAdditionalParams)
Produces an AnalysisEngine instance from a ResourceSpecifier . |
static CasConsumer |
produceCasConsumer(ResourceSpecifier aSpecifier)
Produces a CasConsumer instance from a ResourceSpecifier . |
static CasConsumer |
produceCasConsumer(ResourceSpecifier aSpecifier,
Map<String,Object> aAdditionalParams)
Produces a CasConsumer instance from a ResourceSpecifier . |
static CasConsumer |
produceCasConsumer(ResourceSpecifier aSpecifier,
ResourceManager aResourceManager,
Map<String,Object> aAdditionalParams)
Produces an CasConsumer instance from a ResourceSpecifier . |
static CasInitializer |
produceCasInitializer(ResourceSpecifier aSpecifier)
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 XmlDetagger for an example. |
static CasInitializer |
produceCasInitializer(ResourceSpecifier aSpecifier,
Map<String,Object> aAdditionalParams)
Produces a CasInitializer instance from a ResourceSpecifier . |
static CasInitializer |
produceCasInitializer(ResourceSpecifier aSpecifier,
ResourceManager aResourceManager,
Map<String,Object> aAdditionalParams)
Produces an CasInitializer instance from a ResourceSpecifier . |
static CollectionProcessingEngine |
produceCollectionProcessingEngine(CpeDescription aCpeDescription)
Produces a CollectionProcessingEngine instance from a cpeDescription . |
static CollectionProcessingEngine |
produceCollectionProcessingEngine(CpeDescription aCpeDescription,
Map<String,Object> aAdditionalParams)
Produces a CollectionProcessingEngine instance from a cpeDescription . |
static CollectionProcessingEngine |
produceCollectionProcessingEngine(CpeDescription aCpeDescription,
ResourceManager aResourceManager,
Map<String,Object> aAdditionalParams)
Produces a CollectionProcessingEngine instance from a cpeDescription . |
static CollectionReader |
produceCollectionReader(ResourceSpecifier aSpecifier)
Produces a CollectionReader instance from a ResourceSpecifier . |
static CollectionReader |
produceCollectionReader(ResourceSpecifier aSpecifier,
Map<String,Object> aAdditionalParams)
Produces a CollectionReader instance from a ResourceSpecifier . |
static CollectionReader |
produceCollectionReader(ResourceSpecifier aSpecifier,
ResourceManager aResourceManager,
Map<String,Object> aAdditionalParams)
Produces an CollectionReader instance from a ResourceSpecifier . |
static Resource |
produceResource(Class<? extends Resource> aResourceClass,
ResourceSpecifier aSpecifier,
Map<String,Object> aAdditionalParams)
Produces an appropriate Resource instance of a specified class from a
ResourceSpecifier . |
static Resource |
produceResource(Class<? extends Resource> aResourceClass,
ResourceSpecifier aSpecifier,
ResourceManager aResourceManager,
Map<String,Object> aAdditionalParams)
Produces an appropriate Resource instance of a specified class from a
ResourceSpecifier . |
static Resource |
produceResource(ResourceSpecifier aSpecifier,
Map<String,Object> aAdditionalParams)
Produces an appropriate Resource instance from a ResourceSpecifier . |
static TextAnalysisEngine |
produceTAE(ResourceSpecifier aSpecifier)
Deprecated. As of v2.0, produceAnalysisEngine(ResourceSpecifier) should be used
instead. |
static TextAnalysisEngine |
produceTAE(ResourceSpecifier aSpecifier,
int aMaxSimultaneousRequests,
int aTimeoutPeriod)
Deprecated. As of v2.0, produceAnalysisEngine(ResourceSpecifier,int,int) should be
used instead. |
static TextAnalysisEngine |
produceTAE(ResourceSpecifier aSpecifier,
Map<String,Object> aAdditionalParams)
Deprecated. As of v2.0, produceAnalysisEngine(ResourceSpecifier,Map) should be used
instead. |
static TextAnalysisEngine |
produceTAE(ResourceSpecifier aSpecifier,
ResourceManager aResourceManager,
Map<String,Object> aAdditionalParams)
Deprecated. As of v2.0, produceAnalysisEngine(ResourceSpecifier,ResourceManager,Map)
should be used instead. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String CAS_INITIAL_HEAP_SIZE
getDefaultPerformanceTuningProperties()
. The value of this key represents the size of
the initial CAS heap in terms of the number of cells (32 bits per cell).
public static final String PROCESS_TRACE_ENABLED
getDefaultPerformanceTuningProperties()
. 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.
public static final Object SOCKET_KEEPALIVE_ENABLED
getDefaultPerformanceTuningProperties()
. 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.
Socket.setKeepAlive(boolean)
public static final String JCAS_CACHE_ENABLED
getDefaultPerformanceTuningProperties()
. 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.
Constructor Detail |
---|
public UIMAFramework()
Method Detail |
---|
protected abstract Properties _getDefaultPerformanceTuningProperties()
public static String getVersionString()
public static short getMajorVersion()
public static short getMinorVersion()
public static short getBuildRevision()
public static CompositeResourceFactory getResourceFactory()
ResourceFactory
. Most applications do not need to deal
with the ResourceFactory
- instead one of the static produce
methods 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 other ResourceFactory
objects. Developers to register their own specialized ResourceFactory
objects by
calling the CompositeResourceFactory.registerFactory(Class,ResourceFactory)
method.
ResourceFactory
to be used by the application.public static ResourceSpecifierFactory getResourceSpecifierFactory()
ResourceSpecifierFactory
. This factory is used when
constructing ResourceSpecifier
s from scratch.
ResourceSpecifierFactory
to be used by the application.public static XMLParser getXMLParser()
XMLParser
, which is used to parse
ResourceSpecifier
objects from their XML representations.
XMLParser
to be used by the application.public static CollectionProcessingManager newCollectionProcessingManager()
CollectionProcessingManager
instance. The
CollectionProcessingManager
facilitates the development of applications that
process collections of entities using an AnalysisEngine
.
CollectionProcessingManager
instance to be used by the
application.public static CollectionProcessingManager newCollectionProcessingManager(ResourceManager aResourceManager)
CollectionProcessingManager
instance. The
CollectionProcessingManager
facilitates the development of applications that
process collections of entities using an AnalysisEngine
.
aResourceManager
- the ResourceManager
to be used by this CPM. If not specified, the
default one returned by newDefaultResourceManager()
will be used.
CollectionProcessingManager
instance to be used by the
application.public static Resource produceResource(ResourceSpecifier aSpecifier, Map<String,Object> aAdditionalParams) throws ResourceInitializationException
Resource
instance from a ResourceSpecifier
.
The ResourceSpecifier
may either specify how to construct a new instance or how
to locate an existing instance.
aSpecifier
- an object that specifies how to acquire an instance of a Resource
.aAdditionalParams
- a Map containing additional parameters to pass to the
Resource.initialize(ResourceSpecifier,Map)
method. May be null
if there are no parameters. For example this can be used to set performance-tuning
settings as described in getDefaultPerformanceTuningProperties()
.
Resource
instance.
ResourceInitializationException
- if a failure occurred during production of the resource.public static Resource produceResource(Class<? extends Resource> aResourceClass, ResourceSpecifier aSpecifier, Map<String,Object> aAdditionalParams) throws ResourceInitializationException
Resource
instance of a specified class from a
ResourceSpecifier
. The ResourceSpecifier
may either specify how
to construct a new instance or how to locate an existing instance.
aResourceClass
- a subclass of Resource
to be produced.aSpecifier
- an object that specifies how to acquire an instance of a Resource
.aAdditionalParams
- a Map containing additional parameters to pass to the
Resource.initialize(ResourceSpecifier,Map)
method. May be null
if there are no parameters. For example this can be used to set performance-tuning
settings as described in getDefaultPerformanceTuningProperties()
.
Resource
instance. This will be a subclass of
aResourceClass
.
ResourceInitializationException
- if a failure occurred during production of the resource.public static Resource produceResource(Class<? extends Resource> aResourceClass, ResourceSpecifier aSpecifier, ResourceManager aResourceManager, Map<String,Object> aAdditionalParams) throws ResourceInitializationException
Resource
instance of a specified class from a
ResourceSpecifier
. The ResourceSpecifier
may either specify how
to construct a new instance or how to locate an existing instance.
aResourceClass
- a subclass of Resource
to be produced.aSpecifier
- an object that specifies how to acquire an instance of a Resource
.aResourceManager
- the ResourceManager
to be used by this analysis engine. If not
specified, the default one returned by newDefaultResourceManager()
will be
used.aAdditionalParams
- a Map containing additional parameters to pass to the
Resource.initialize(ResourceSpecifier,Map)
method. May be null
if there are no parameters. For example this can be used to set performance-tuning
settings as described in getDefaultPerformanceTuningProperties()
.
Resource
instance. This will be a subclass of
aResourceClass
.
ResourceInitializationException
- if a failure occurred during production of the resource.public static AnalysisEngine produceAnalysisEngine(ResourceSpecifier aSpecifier) throws ResourceInitializationException
AnalysisEngine
instance from a ResourceSpecifier
. The
ResourceSpecifier
may 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.
aSpecifier
- an object that specifies how to acquire an instance of a Resource
.
This must specify a subclass of AnalysisEngine
.
AnalysisEngine
instance.
ResourceInitializationException
- if a failure occurred during production of the resource.public static AnalysisEngine produceAnalysisEngine(ResourceSpecifier aSpecifier, Map<String,Object> aAdditionalParams) throws ResourceInitializationException
AnalysisEngine
instance from a ResourceSpecifier
. The
ResourceSpecifier
may either specify how to construct a new instance or how to
locate an existing instance.
aSpecifier
- an object that specifies how to acquire an instance of a Resource
.
This must specify a subclass of AnalysisEngine
.aAdditionalParams
- a Map containing additional parameters to pass to the
Resource.initialize(ResourceSpecifier,Map)
method. May be null
if there are no parameters. Valid parameter names are defined as constants on the
AnalysisEngine
interface. For example this can be used to set
performance-tuning settings as described in
getDefaultPerformanceTuningProperties()
.
AnalysisEngine
instance.
ResourceInitializationException
- if a failure occurred during production of the resource.public static AnalysisEngine produceAnalysisEngine(ResourceSpecifier aSpecifier, ResourceManager aResourceManager, Map<String,Object> aAdditionalParams) throws ResourceInitializationException
AnalysisEngine
instance from a ResourceSpecifier
. The
ResourceSpecifier
may either specify how to construct a new instance or how to
locate an existing instance.
aSpecifier
- an object that specifies how to acquire an instance of a Resource
.
This must specify a subclass of AnalysisEngine
.aResourceManager
- the ResourceManager
to be used by this analysis engine. If not
specified, the default one returned by newDefaultResourceManager()
will be
used.aAdditionalParams
- a Map containing additional parameters to pass to the
Resource.initialize(ResourceSpecifier,Map)
method. May be null
if there are no parameters. Valid parameter names are defined as constants on the
AnalysisEngine
interface. For example this can be used to set
performance-tuning settings as described in
getDefaultPerformanceTuningProperties()
.
AnalysisEngine
instance.
ResourceInitializationException
- if a failure occurred during production of the resource.public static AnalysisEngine produceAnalysisEngine(ResourceSpecifier aSpecifier, int aMaxSimultaneousRequests, int aTimeoutPeriod) throws ResourceInitializationException
AnalysisEngine
instance from a ResourceSpecifier
. The
ResourceSpecifier
may either specify how to construct a new instance or how to
locate an existing instance.
This version of produceAnalysisEngine
allows the convenient creation of
AnalysisEngines that can handle multiple simultaneous requests. Using this method is equivalent
to using produceAnalysisEngine(ResourceSpecifier,Map)
and including values for
AnalysisEngine.PARAM_NUM_SIMULTANEOUS_REQUESTS
and
AnalysisEngine.PARAM_TIMEOUT_PERIOD
in the parameter map.
aSpecifier
- an object that specifies how to acquire an instance of a Resource
.
This must specify a subclass of AnalysisEngine
.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 for
AnalysisEngine.PARAM_NUM_SIMULTANEOUS_REQUESTS
.aTimeoutPeriod
- -
when the number of simultaneous requests exceeds aMaxSimultaneousReqeusts
,
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 for
AnalysisEngine.PARAM_TIMEOUT_PERIOD
.
AnalysisEngine
instance.
ResourceInitializationException
- if a failure occurred during production of the resource.@Deprecated public static TextAnalysisEngine produceTAE(ResourceSpecifier aSpecifier) throws ResourceInitializationException
produceAnalysisEngine(ResourceSpecifier)
should be used
instead.
TextAnalysisEngine
instance from a ResourceSpecifier
. The
ResourceSpecifier
may 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.
aSpecifier
- an object that specifies how to acquire an instance of a Resource
.
This must specify a subclass of TextAnalysisEngine
.
TextAnalysisEngine
instance.
ResourceInitializationException
- if a failure occurred during production of the resource.@Deprecated public static TextAnalysisEngine produceTAE(ResourceSpecifier aSpecifier, Map<String,Object> aAdditionalParams) throws ResourceInitializationException
produceAnalysisEngine(ResourceSpecifier,Map)
should be used
instead.
TextAnalysisEngine
instance from a ResourceSpecifier
. The
ResourceSpecifier
may either specify how to construct a new instance or how to
locate an existing instance.
aSpecifier
- an object that specifies how to acquire an instance of a Resource
.
This must specify a subclass of TextAnalysisEngine
.aAdditionalParams
- a Map containing additional parameters to pass to the
Resource.initialize(ResourceSpecifier,Map)
method. May be null
if there are no parameters. Valid parameter names are defined as constants on the
AnalysisEngine
interface. For example this can be used to set
performance-tuning settings as described in
getDefaultPerformanceTuningProperties()
.
TextAnalysisEngine
instance.
ResourceInitializationException
- if a failure occurred during production of the resource.@Deprecated public static TextAnalysisEngine produceTAE(ResourceSpecifier aSpecifier, ResourceManager aResourceManager, Map<String,Object> aAdditionalParams) throws ResourceInitializationException
produceAnalysisEngine(ResourceSpecifier,ResourceManager,Map)
should be used instead.
TextAnalysisEngine
instance from a ResourceSpecifier
. The
ResourceSpecifier
may either specify how to construct a new instance or how to
locate an existing instance.
aSpecifier
- an object that specifies how to acquire an instance of a Resource
.
This must specify a subclass of TextAnalysisEngine
.aResourceManager
- the ResourceManager
to be used by this analysis engine. If not
specified, the default one returned by newDefaultResourceManager()
will be
used.aAdditionalParams
- a Map containing additional parameters to pass to the
Resource.initialize(ResourceSpecifier,Map)
method. May be null
if there are no parameters. Valid parameter names are defined as constants on the
AnalysisEngine
interface. For example this can be used to set
performance-tuning settings as described in
getDefaultPerformanceTuningProperties()
.
TextAnalysisEngine
instance.
ResourceInitializationException
- if a failure occurred during production of the resource.@Deprecated public static TextAnalysisEngine produceTAE(ResourceSpecifier aSpecifier, int aMaxSimultaneousRequests, int aTimeoutPeriod) throws ResourceInitializationException
produceAnalysisEngine(ResourceSpecifier,int,int)
should be
used instead.
TextAnalysisEngine
instance from a ResourceSpecifier
. The
ResourceSpecifier
may either specify how to construct a new instance or how to
locate an existing instance.
This version of produceTAE
allows the convenient creation of TAEs that can
handle multiple simultaneous requests. Using this method is equivalent to using
produceTAE(ResourceSpecifier,Map)
and including values for
AnalysisEngine.PARAM_NUM_SIMULTANEOUS_REQUESTS
and
AnalysisEngine.PARAM_TIMEOUT_PERIOD
in the parameter map.
aSpecifier
- an object that specifies how to acquire an instance of a Resource
.
This must specify a subclass of TextAnalysisEngine
.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 for
AnalysisEngine.PARAM_NUM_SIMULTANEOUS_REQUESTS
.aTimeoutPeriod
- -
when the number of simultaneous requests exceeds aMaxSimultaneousReqeusts
,
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 for
AnalysisEngine.PARAM_TIMEOUT_PERIOD
.
TextAnalysisEngine
instance.
ResourceInitializationException
- if a failure occurred during production of the resource.public static CasConsumer produceCasConsumer(ResourceSpecifier aSpecifier) throws ResourceInitializationException
CasConsumer
instance from a ResourceSpecifier
. The
ResourceSpecifier
may either specify how to construct a new instance or how to
locate an existing instance.
aSpecifier
- an object that specifies how to acquire an instance of a Resource
.
This must specify a subclass of CasConsumer
.
CasConsumer
instance.
ResourceInitializationException
- if a failure occurred during production of the resource.public static CasConsumer produceCasConsumer(ResourceSpecifier aSpecifier, Map<String,Object> aAdditionalParams) throws ResourceInitializationException
CasConsumer
instance from a ResourceSpecifier
. The
ResourceSpecifier
may either specify how to construct a new instance or how to
locate an existing instance.
aSpecifier
- an object that specifies how to acquire an instance of a Resource
.
This must specify a subclass of CasConsumer
.aAdditionalParams
- a Map containing additional parameters to pass to the
Resource.initialize(ResourceSpecifier,Map)
method. May be null
if there are no parameters. For example this can be used to set performance-tuning
settings as described in getDefaultPerformanceTuningProperties()
.
CasConsumer
instance.
ResourceInitializationException
- if a failure occurred during production of the resource.public static CasConsumer produceCasConsumer(ResourceSpecifier aSpecifier, ResourceManager aResourceManager, Map<String,Object> aAdditionalParams) throws ResourceInitializationException
CasConsumer
instance from a ResourceSpecifier
. The
ResourceSpecifier
may either specify how to construct a new instance or how to
locate an existing instance.
aSpecifier
- an object that specifies how to acquire an instance of a Resource
.
This must specify a subclass of CasConsumer
.aResourceManager
- the ResourceManager
to be used by this CasConsumer. If not specified,
the default one returned by newDefaultResourceManager()
will be used.aAdditionalParams
- a Map containing additional parameters to pass to the
Resource.initialize(ResourceSpecifier,Map)
method. May be null
if there are no parameters. Valid parameter names are defined as constants on the
CasConsumer
interface. For example this can be used to set performance-tuning
settings as described in getDefaultPerformanceTuningProperties()
.
CasConsumer
instance.
ResourceInitializationException
- if a failure occurred during production of the resource.public static CollectionReader produceCollectionReader(ResourceSpecifier aSpecifier) throws ResourceInitializationException
CollectionReader
instance from a ResourceSpecifier
. The
ResourceSpecifier
may either specify how to construct a new instance or how to
locate an existing instance.
aSpecifier
- an object that specifies how to acquire an instance of a Resource
.
This must specify a subclass of CollectionReader
.
CollectionReader
instance.
ResourceInitializationException
- if a failure occurred during production of the resource.public static CollectionReader produceCollectionReader(ResourceSpecifier aSpecifier, Map<String,Object> aAdditionalParams) throws ResourceInitializationException
CollectionReader
instance from a ResourceSpecifier
. The
ResourceSpecifier
may either specify how to construct a new instance or how to
locate an existing instance.
aSpecifier
- an object that specifies how to acquire an instance of a Resource
.
This must specify a subclass of CollectionReader
.aAdditionalParams
- a Map containing additional parameters to pass to the
Resource.initialize(ResourceSpecifier,Map)
method. May be null
if there are no parameters. For example this can be used to set performance-tuning
settings as described in getDefaultPerformanceTuningProperties()
.
CollectionReader
instance.
ResourceInitializationException
- if a failure occurred during production of the resource.public static CollectionReader produceCollectionReader(ResourceSpecifier aSpecifier, ResourceManager aResourceManager, Map<String,Object> aAdditionalParams) throws ResourceInitializationException
CollectionReader
instance from a ResourceSpecifier
. The
ResourceSpecifier
may either specify how to construct a new instance or how to
locate an existing instance.
aSpecifier
- an object that specifies how to acquire an instance of a Resource
.
This must specify a subclass of CollectionReader
.aResourceManager
- the ResourceManager
to be used by this CollectionReader. If not
specified, the default one returned by newDefaultResourceManager()
will be
used.aAdditionalParams
- a Map containing additional parameters to pass to the
Resource.initialize(ResourceSpecifier,Map)
method. May be null
if there are no parameters. Valid parameter names are defined as constants on the
CollectionReader
interface. For example this can be used to set
performance-tuning settings as described in
getDefaultPerformanceTuningProperties()
.
CollectionReader
instance.
ResourceInitializationException
- if a failure occurred during production of the resource.@Deprecated public static CasInitializer produceCasInitializer(ResourceSpecifier aSpecifier) throws ResourceInitializationException
XmlDetagger
for an example.
CasInitializer
instance from a ResourceSpecifier
. The
ResourceSpecifier
may either specify how to construct a new instance or how to
locate an existing instance.
aSpecifier
- an object that specifies how to acquire an instance of a Resource
.
This must specify a subclass of CasInitializer
.
CasInitializer
instance.
ResourceInitializationException
- if a failure occurred during production of the resource.public static CasInitializer produceCasInitializer(ResourceSpecifier aSpecifier, Map<String,Object> aAdditionalParams) throws ResourceInitializationException
CasInitializer
instance from a ResourceSpecifier
. The
ResourceSpecifier
may either specify how to construct a new instance or how to
locate an existing instance.
aSpecifier
- an object that specifies how to acquire an instance of a Resource
.
This must specify a subclass of CasInitializer
.aAdditionalParams
- a Map containing additional parameters to pass to the
Resource.initialize(ResourceSpecifier,Map)
method. May be null
if there are no parameters. For example this can be used to set performance-tuning
settings as described in getDefaultPerformanceTuningProperties()
.
CasInitializer
instance.
ResourceInitializationException
- if a failure occurred during production of the resource.public static CasInitializer produceCasInitializer(ResourceSpecifier aSpecifier, ResourceManager aResourceManager, Map<String,Object> aAdditionalParams) throws ResourceInitializationException
CasInitializer
instance from a ResourceSpecifier
. The
ResourceSpecifier
may either specify how to construct a new instance or how to
locate an existing instance.
aSpecifier
- an object that specifies how to acquire an instance of a Resource
.
This must specify a subclass of CasInitializer
.aResourceManager
- the ResourceManager
to be used by this CasInitializer. If not
specified, the default one returned by newDefaultResourceManager()
will be
used.aAdditionalParams
- a Map containing additional parameters to pass to the
Resource.initialize(ResourceSpecifier,Map)
method. May be null
if there are no parameters. Valid parameter names are defined as constants on the
CasInitializer
interface. For example this can be used to set
performance-tuning settings as described in
getDefaultPerformanceTuningProperties()
.
CasInitializer
instance.
ResourceInitializationException
- if a failure occurred during production of the resource.public static CollectionProcessingEngine produceCollectionProcessingEngine(CpeDescription aCpeDescription) throws ResourceInitializationException
CollectionProcessingEngine
instance from a cpeDescription
.
aCpeDescription
- an object that specifies how to create an instance of a
CollectionProcessingEngine
.
CollectionProcessingEngine
instance.
ResourceInitializationException
- if a failure occurred during production of the CPE.public static CollectionProcessingEngine produceCollectionProcessingEngine(CpeDescription aCpeDescription, Map<String,Object> aAdditionalParams) throws ResourceInitializationException
CollectionProcessingEngine
instance from a cpeDescription
.
aCpeDescription
- an object that specifies how to create an instance of a
CollectionProcessingEngine
.aAdditionalParams
- a Map containing additional parameters to pass to the
CollectionProcessingEngine.initialize(CpeDescription,Map)
method. May be
null
if there are no parameters. For example this can be used to set
performance-tuning settings as described in
getDefaultPerformanceTuningProperties()
.
CollectionProcessingEngine
instance.
ResourceInitializationException
- if a failure occurred during production of the CPE.public static CollectionProcessingEngine produceCollectionProcessingEngine(CpeDescription aCpeDescription, ResourceManager aResourceManager, Map<String,Object> aAdditionalParams) throws ResourceInitializationException
CollectionProcessingEngine
instance from a cpeDescription
.
aCpeDescription
- an object that specifies how to create an instance of a
CollectionProcessingEngine
.aResourceManager
- the ResourceManager
to be used by this CollectionProcessingEngine. If
not specified, the default one returned by newDefaultResourceManager()
will
be used.aAdditionalParams
- a Map containing additional parameters to pass to the
CollectionProcessingEngine.initialize(CpeDescription,Map)
method. May be
null
if there are no parameters. For example this can be used to set
performance-tuning settings as described in
getDefaultPerformanceTuningProperties()
.
CollectionProcessingEngine
instance.
ResourceInitializationException
- if a failure occurred during production of the CPE.public static Logger getLogger()
Logger
used 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.
public static Logger getLogger(Class<?> component)
Logger
used 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.
component
- the Class for a component, for example an Annotator or CAS Consumer
public static Logger newLogger()
Logger
, which can be passed for example to the
AnalysisEngine.setLogger(Logger)
method in order to have separate Analysis Engine
instances used separate loggers.
getLogger()
public static UimaTimer newTimer()
UimaTimer
, which is used to collect performance
statistics for UIMA components.
public static ResourceManager newDefaultResourceManager()
ResourceManager
used by this implementation. An
application can configure this ResourceManager and then pass it to the
produceAnalysisEngine(ResourceSpecifier,ResourceManager,Map)
method.
ResourceManager
to be used by the application.public static ResourceManager newDefaultResourceManagerPearWrapper()
ResourceManagerPearWrapper
used by this implementation.
ResourceManagerPearWrapper
to be used by the application.public static ConfigurationManager newConfigurationManager()
ConfigurationManager
used by this implementation. This will
be used by Resources to manage access to their configuration parameters.
ConfigurationManager
to be used by the application.public static UimaContextAdmin newUimaContext(Logger aLogger, ResourceManager aResourceManager, ConfigurationManager aConfigManager)
UimaContext
. Applications do not generally need to call this
method.
aLogger
- the logger that will be returned by this UimaContext's getLogger()
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.
public static Properties getDefaultPerformanceTuningProperties()
produceTAE(ResourceSpecifier,Map)
or
produceCollectionProcessingEngine(CpeDescription,Map)
methods by putting it into the
aAdditionalParams
map under the key
Resource.PARAM_PERFORMANCE_TUNING_SETTINGS
. For example, the following code set the
initial heap size allocated in the CAS to 100,000:
Properties perfProps = UIMAFramework.getDefaultPerformanceTuningProperties(); perfProps.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 Properties
object rerturned by this method are specified as
constants on this interface.
protected static UIMAFramework getInstance()
UIMAFramework
instance currently in use.
UIMAFramework
instance currently in useprotected abstract short _getMajorVersion()
protected abstract short _getMinorVersion()
protected abstract void _initialize() throws Exception
getInstance()
method can be used during initialization.
Exception
- if initialization failsprotected abstract short _getBuildRevision()
protected abstract CompositeResourceFactory _getResourceFactory()
ResourceFactory
used by this implementation, which must implement
CompositeResourceFactory
.
ResourceFactory
to be used by the applicationprotected abstract ResourceSpecifierFactory _getResourceSpecifierFactory()
ResourceSpecifierFactory
used by this implementation.
ResourceSpecifierFactory
to be used by the application.protected abstract XMLParser _getXMLParser()
XMLParser
used by this implementation.
XMLParser
to be used by the application.protected abstract CollectionProcessingManager _newCollectionProcessingManager(ResourceManager aResourceManager)
CollectionProcessingManager
.
aResourceManager
- the ResourceManager to be used by the CPM
CollectionProcessingManager
to be used by the application.protected abstract Logger _getLogger()
Logger
used by this implementation.
Logger
used by this implementationprotected abstract Logger _getLogger(Class<?> component)
Logger
of
the specified source class.
Logger
of the specified source classprotected abstract Logger _newLogger()
Logger
instance.
Logger
instanceprotected abstract UimaTimer _newTimer()
UimaTimer
instance.
Timer
instanceprotected abstract ResourceManager _newDefaultResourceManager()
ResourceManager
used by this implementation.
ResourceManager
to be used by the application.protected abstract ResourceManager _newDefaultResourceManagerPearWrapper()
ResourceManagerPearWrapper
used by this implementation.
ResourceManagerPearWrapper
to be used by the application.protected abstract ConfigurationManager _newConfigurationManager()
ConfigurationManager
used by this implementation.
ConfigurationManager
to be used by the application.protected abstract UimaContextAdmin _newUimaContext()
UimaContextAdmin
used by this implementation.
UimaContextAdmin
to be used by the application.protected abstract CollectionProcessingEngine _produceCollectionProcessingEngine(CpeDescription aCpeDescription, Map<String,Object> aAdditionalParams) throws ResourceInitializationException
CollectionProcessingEngine
instance from a cpeDescription
.
aCpeDescription
- an object that specifies how to create an instance of a
CollectionProcessingEngine
.aAdditionalParams
- a Map containing additional parameters to pass to the
CollectionProcessingEngine.initialize(CpeDescription,Map)
method. May be
null
if there are no parameters. For example this can be used to set
performance-tuning settings as described in
getDefaultPerformanceTuningProperties()
.
CollectionProcessingEngine
instance.
ResourceInitializationException
- if a failure occurred during production of the CPE.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |