. The input to this method
is a ResourceSpecifier, which contains all of the information that
this factory can use to acquire a reference to the resource.
Most applications will not need to interact with this interface.
Applications will generally create resources using the static methods on
the UIMAFramework class.
Note that multiple threads may attempt to manufacture resources
simulatenously, so implementations of this interface MUST be threadsafe.
Developers needing to provide their own ResourceFactory may
wish to consider using the provided
SimpleResourceFactory implementation.
|
Method Summary |
Resource |
produceResource(java.lang.Class<? extends Resource> aResourceClass,
ResourceSpecifier aSpecifier,
java.util.Map<java.lang.String,java.lang.Object> aAdditionalParams)
Produces an appropriate Resource instance from a ResourceSpecifier. |
produceResource
Resource produceResource(java.lang.Class<? extends Resource> aResourceClass,
ResourceSpecifier aSpecifier,
java.util.Map<java.lang.String,java.lang.Object> aAdditionalParams)
throws ResourceInitializationException
- Produces an appropriate
Resource instance from a ResourceSpecifier.
This version of produceResource takes a Map containing additional parameters to
be passed to the Resource.initialize(ResourceSpecifier,Map) method.
- Parameters:
aResourceClass - the class of resource to be produced (NOTE: this is intended to be a standard UIMA
interface name such as "TextAnalysisEngine" or "ASB")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.
- Returns:
- a
Resource instance. Returns null if this factory does
not know how to create a Resource from the ResourceSpecifier provided.
- Throws:
ResourceInitializationException - if a failure occurred during production of the resource
Copyright © 2012. All Rights Reserved.