org.apache.uima.impl
Class CompositeResourceFactory_impl

java.lang.Object
  extended by 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 the ResourceFactory interface, and produces resources by delegating to the most recently registered ResourceFactory instance that can handle the class of the given specifier object.


Constructor Summary
CompositeResourceFactory_impl()
           
 
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.
 void registerFactory(java.lang.Class aResourceSpecifierInterface, ResourceFactory aFactory)
          Registers a ResourceFactory with this composite factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeResourceFactory_impl

public CompositeResourceFactory_impl()
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: ResourceFactory
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.

Specified by:
produceResource in interface ResourceFactory
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
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: CompositeResourceFactory
Registers a ResourceFactory with this composite factory.

Specified by:
registerFactory in interface CompositeResourceFactory
Parameters:
aResourceSpecifierInterface - the subinterface of ResourceSpecifier that the factory can handle
aFactory - the factory used to create resources from resource specifiers of the given type
See Also:
CompositeResourceFactory.registerFactory(Class,ResourceFactory)


Copyright © 2012. All Rights Reserved.