Package org.apache.uima.impl
Class CompositeResourceFactory_impl
- java.lang.Object
-
- org.apache.uima.impl.CompositeResourceFactory_impl
-
- All Implemented Interfaces:
CompositeResourceFactory,ResourceFactory
public class CompositeResourceFactory_impl extends java.lang.Object implements CompositeResourceFactory
A registry containing (ResourceSpecifier Class,ResourceFactory) pairs. Also implements theResourceFactoryinterface, and produces resources by delegating to the most recently registeredResourceFactoryinstance that can handle the class of the given specifier object.
-
-
Constructor Summary
Constructors Constructor Description CompositeResourceFactory_impl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceproduceResource(java.lang.Class<? extends Resource> aResourceClass, ResourceSpecifier aSpecifier, java.util.Map<java.lang.String,java.lang.Object> aAdditionalParams)Produces an appropriateResourceinstance from aResourceSpecifier.voidregisterFactory(java.lang.Class aResourceSpecifierInterface, ResourceFactory aFactory)Registers a ResourceFactory with this composite factory.
-
-
-
Method Detail
-
produceResource
public Resource produceResource(java.lang.Class<? extends Resource> aResourceClass, ResourceSpecifier aSpecifier, java.util.Map<java.lang.String,java.lang.Object> aAdditionalParams) throws ResourceInitializationException
Description copied from interface:ResourceFactoryProduces an appropriateResourceinstance from aResourceSpecifier. This version ofproduceResourcetakes a Map containing additional parameters to be passed to theResource.initialize(ResourceSpecifier,Map)method.- Specified by:
produceResourcein interfaceResourceFactory- 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 aResource.aAdditionalParams- a Map containing additional parameters to pass to theResource.initialize(ResourceSpecifier,Map)method. May benullif there are no parameters.- Returns:
- a
Resourceinstance. Returnsnullif this factory does not know how to create a Resource from theResourceSpecifierprovided. - Throws:
ResourceInitializationException- if a failure occurred during production of the resource- See Also:
ResourceFactory.produceResource(java.lang.Class, org.apache.uima.resource.ResourceSpecifier, java.util.Map)
-
registerFactory
public void registerFactory(java.lang.Class aResourceSpecifierInterface, ResourceFactory aFactory)Description copied from interface:CompositeResourceFactoryRegisters a ResourceFactory with this composite factory.- Specified by:
registerFactoryin interfaceCompositeResourceFactory- Parameters:
aResourceSpecifierInterface- the subinterface ofResourceSpecifierthat the factory can handleaFactory- the factory used to create resources from resource specifiers of the given type- See Also:
CompositeResourceFactory.registerFactory(Class,ResourceFactory)
-
-