Class ExternalResourceFactory
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
bindResource
(ExternalResourceDescription aRes, String aBindTo, ExternalResourceDescription aNestedRes) Deprecated.static void
bindResource
(ResourceManagerConfiguration aResMgrCfg, String aBindTo, String aRes) static void
bindResource
(ResourceManagerConfiguration aResMgrCfg, String aBindTo, ExternalResourceDescription aRes) static void
bindResource
(ResourceSpecifier aDesc, Class<?> aApi, Class<? extends Resource> aRes, String... aParams) Scan the given resource specifier for external resource dependencies and whenever a dependency with a compatible type is found, the resource will be bound.static void
bindResource
(ResourceSpecifier aDesc, Class<? extends Resource> aRes, String... aParams) Scan the given resource specifier for external resource dependencies and whenever a dependency with a compatible type is found, the resource will be bound.static void
bindResource
(ResourceSpecifier aDesc, String aKey, File aFile) Scan the given resource specifier for external resource dependencies and whenever a dependency is encounter that has the specified key, the resource will be bound.static void
bindResource
(ResourceSpecifier aDesc, String aKey, Class<? extends Resource> aRes, String... aParams) Scan the given resource specifier for external resource dependencies and whenever a dependency with the given key is encountered, the given resource is bound to it.static void
bindResource
(ResourceSpecifier aDesc, String aKey, String aUrl) Deprecated.static void
bindResource
(ResourceSpecifier aDesc, String aKey, URL aUrl) Scan the given resource specifier for external resource dependencies and whenever a dependency is encounter that has the specified key, the resource will be bound.static void
bindResource
(ResourceSpecifier aDesc, String aKey, ExternalResourceDescription aResDesc) Scan the given resource specifier for external resource dependencies and whenever a dependency with the given key is encountered, the given resource is bound to it.static void
bindResource
(ResourceSpecifier aDesc, ExternalResourceDescription aResDesc) Scan the given resource specifier for external resource dependencies and whenever a dependency with a compatible type is found, the given resource is bound to it.static void
bindResourceOnce
(ExternalResourceDescription aRes, String aBindTo, ExternalResourceDescription aNestedRes) Create a binding for the given external resource in the given resource.static void
bindResourceOnce
(ResourceManagerConfiguration aResMgrCfg, String aBindTo, ExternalResourceDescription aRes) Create a binding for the given external resource in the given resource manager.static void
bindResourceOnce
(ResourceCreationSpecifier aDesc, String aBindTo, ExternalResourceDescription aRes) Create a binding for the given external resource in the resource manager configuration of the given resource.static void
bindResourceOnceWithoutNested
(ResourceManagerConfiguration aResMgrCfg, String aBindTo, String aRes) Create a binding for the given external resource in the given resource manager configuration.static void
bindResourceOnceWithoutNested
(ResourceCreationSpecifier aDesc, String aBindTo, String aRes) Create a binding for the given external resource in resource manager configuration of the given resource creation specified.static void
bindResourceUsingUrl
(ResourceSpecifier aDesc, Class<?> aApi, Class<? extends SharedResourceObject> aRes, String aUrl, Object... aParams) Scan the given resource specifier for external resource dependencies and whenever a dependency is encountered that has a key equal to the API class name, the resource will be bound.static void
bindResourceUsingUrl
(ResourceSpecifier aDesc, Class<? extends SharedResourceObject> aRes, String aUrl, Object... aParams) Scan the given resource specifier for external resource dependencies and whenever a dependency with a compatible type is found, the resource will be bound.static void
bindResourceUsingUrl
(ResourceSpecifier aDesc, String aKey, Class<? extends SharedResourceObject> aRes, String aUrl, Object... aParams) Scan the given resource specifier for external resource dependencies and whenever a dependency with the given key is encountered the resource will be bound.static void
bindResourceUsingUrl
(ResourceSpecifier aDesc, String aKey, String aUrl) Scan the given resource specifier for external resource dependencies and whenever a dependency is encountered that has the specified key, the resource will be bound.static void
createDependency
(ResourceSpecifier aDesc, String aKey, Class<?> aApi) Create a new dependency for the specified resource and bind it.static void
createDependencyAndBind
(ResourceSpecifier aDesc, String aKey, Class<? extends Resource> aImpl, Class<?> aApi, String... aParams) Create a new dependency for the specified resource and bind it.static void
createDependencyAndBind
(ResourceSpecifier aDesc, String aKey, Class<? extends Resource> aImpl, String... aParams) Create a new dependency for the specified resource and bind it.static void
createDependencyAndBindUsingUrl
(AnalysisEngineDescription aDesc, String aKey, Class<? extends SharedResourceObject> aImpl, String aUrl, Object... aParams) Create a new dependency for the specified resource and bind it.static ExternalResourceDescription
createNamedFileResourceDescription
(String aName, String aUrl) Create an external resource description for a file addressable via an URL.static ExternalResourceDescription
createNamedResourceDescription
(String aName, Class<? extends Resource> aInterface, Object... aParams) Create an external resource description for a custom resource.static ExternalResourceDescription
createNamedResourceDescriptionUsingUrl
(String aName, Class<? extends SharedResourceObject> aInterface, String aUrl, Object... aParams) Create an external resource description for aSharedResourceObject
.static <R extends Resource>
RcreateResource
(Class<R> resourceClass, Object... params) Create an instance of a UIMA shared/external resource class.static <R extends Resource>
RcreateResource
(Class<R> resourceClass, ResourceManager resMgr, Object... params) Create an instance of a UIMA shared/external resource class.static ExternalResourceBinding
createResourceBinding
(String aKey, String aResourceKey) Create an external resource binding.static ExternalResourceBinding
createResourceBinding
(String aKey, ExternalResourceDescription aResource) Create an external resource binding.static ExternalResourceDependency[]
createResourceDependencies
(Class<?> cls) static ExternalResourceDependency
createResourceDependency
(Field field) Creates anExternalResourceDependency
for a field annotated withExternalResource
.static ExternalResourceDependency
createResourceDependency
(String aKey, Class<?> aInterface, boolean aOptional, String aDescription) Creates an ExternalResourceDependency for a given key and interface.static ExternalResourceDescription
createResourceDescription
(Class<? extends Resource> aInterface, Object... aParams) Create an external resource description for a custom resource.static ExternalResourceDescription
createSharedResourceDescription
(File aFile, Class<? extends SharedResourceObject> aInterface, Object... aParams) Create an external resource description for aSharedResourceObject
.static ExternalResourceDescription
createSharedResourceDescription
(String aUrl, Class<? extends SharedResourceObject> aInterface, Object... aParams) Create an external resource description for aSharedResourceObject
.static ExternalResourceDescription
createSharedResourceDescription
(URL aUrl, Class<? extends SharedResourceObject> aInterface, Object... aParams) Create an external resource description for aSharedResourceObject
.protected static Map
<String, ExternalResourceDescription> extractResourceParameters
(Object[] configurationData) Extracts the external resource from the configuration parameters and nulls out these parameters.protected static String
Find the name of the class implementing this resource.static boolean
isExternalResourceField
(Field field) This method determines if the field is annotated withExternalResource
.
-
Field Details
-
PARAM_RESOURCE_NAME
- See Also:
-
PREFIX_SEPARATOR
Used to separate resource name from key for nested resource.- See Also:
-
-
Method Details
-
isExternalResourceField
This method determines if the field is annotated withExternalResource
.- Parameters:
field
- the field to analyze- Returns:
- whether the field is marked as an external resource
-
createResourceDescription
public static ExternalResourceDescription createResourceDescription(Class<? extends Resource> aInterface, Object... aParams) Create an external resource description for a custom resource.- Parameters:
aInterface
- the interface the resource should implement.aParams
- parameters passed to the resource when it is created.- Returns:
- the description.
- See Also:
-
createNamedResourceDescription
public static ExternalResourceDescription createNamedResourceDescription(String aName, Class<? extends Resource> aInterface, Object... aParams) Create an external resource description for a custom resource.- Parameters:
aName
- the name of the resource (the key).aInterface
- the interface the resource should implement.aParams
- parameters passed to the resource when it is created.- Returns:
- the description.
- See Also:
-
createNamedResourceDescriptionUsingUrl
public static ExternalResourceDescription createNamedResourceDescriptionUsingUrl(String aName, Class<? extends SharedResourceObject> aInterface, String aUrl, Object... aParams) Create an external resource description for aSharedResourceObject
.- Parameters:
aName
- the name of the resource (the key).aInterface
- the interface the resource should implement.aUrl
- the URL from which the resource is initialized.aParams
- parameters passed to the resource when it is created.- Returns:
- the description.
- See Also:
-
createNamedFileResourceDescription
public static ExternalResourceDescription createNamedFileResourceDescription(String aName, String aUrl) Create an external resource description for a file addressable via an URL.- Parameters:
aName
- the name of the resource (the key).aUrl
- a URL.- Returns:
- the description.
- See Also:
-
createResourceBinding
public static ExternalResourceBinding createResourceBinding(String aKey, ExternalResourceDescription aResource) Create an external resource binding.- Parameters:
aKey
- the key to bind to.aResource
- the resource to bind.- Returns:
- the description.
-
createResourceBinding
Create an external resource binding. This is a more convenient method of creating anExternalResourceBinding
than callingResourceSpecifierFactory.createExternalResourceBinding()
and setting the resource name and key manually.- Parameters:
aKey
- the key to bind to.aResourceKey
- the resource key to bind.- Returns:
- the description.
-
createResourceDependency
Creates anExternalResourceDependency
for a field annotated withExternalResource
.- Parameters:
field
- the field to analyze- Returns:
- a external resource dependency
-
createResourceDependency
public static ExternalResourceDependency createResourceDependency(String aKey, Class<?> aInterface, boolean aOptional, String aDescription) Creates an ExternalResourceDependency for a given key and interface. This is a more convenient method of creating anExternalResourceDependency
than callingResourceSpecifierFactory.createExternalResourceDependency()
and setting the fields manually.- Parameters:
aKey
- the resource keyaInterface
- the resource interfaceaOptional
- determines whether the dependency is optionalaDescription
- a description of the resource- Returns:
- the external resource dependency
-
createResourceDependencies
public static ExternalResourceDependency[] createResourceDependencies(Class<?> cls) throws ResourceInitializationException - Parameters:
cls
- the class to analyze- Returns:
- the external resource dependencies
- Throws:
ResourceInitializationException
- if the external resource dependencies could not be created
-
bindResource
public static void bindResource(ResourceSpecifier aDesc, String aKey, URL aUrl) throws InvalidXMLException Scan the given resource specifier for external resource dependencies and whenever a dependency is encounter that has the specified key, the resource will be bound.Caveat: If you use this method, you may expect that
DataResource.getUrl()
orDataResource.getUri()
will return the same URL that you have specified here. This may NOT be the case. UIMA will internally try to resolve the URL via aResourceManager
. If it cannot resolve a remove URL, this mechanism will think it may be a local file and will return some local path - or it may redirect it to some location as though fit by theResourceManager
.- Parameters:
aDesc
- a description.aKey
- the key to bind to.aUrl
- a URL.- Throws:
InvalidXMLException
- if import resolution failed- See Also:
-
bindResource
public static void bindResource(ResourceSpecifier aDesc, String aKey, File aFile) throws InvalidXMLException Scan the given resource specifier for external resource dependencies and whenever a dependency is encounter that has the specified key, the resource will be bound.Caveat: If you use this method, you may expect that
DataResource.getUrl()
orDataResource.getUri()
will return the URL of the file that you have specified here. This may NOT be the case. UIMA will internally try to resolve the URL via aResourceManager
. If it cannot resolve a remove URL, this mechanism will think it may be a local file and will return some local path - or it may redirect it to some location as though fit by theResourceManager
.- Parameters:
aDesc
- a description.aKey
- the key to bind to.aFile
- a file.- Throws:
InvalidXMLException
- if import resolution failed- See Also:
-
bindResource
@Deprecated public static void bindResource(ResourceSpecifier aDesc, String aKey, String aUrl) throws InvalidXMLException Deprecated.Scan the given resource specifier for external resource dependencies and whenever a dependency is encountered that has the specified key, the resource will be bound.Caveat: If you use this method, you may expect that
DataResource.getUrl()
orDataResource.getUri()
will return the same URL that you have specified here. This is may NOT be the case. UIMA will internally try to resolve the URL via aResourceManager
. If it cannot resolve a remove URL, this mechanism will think it may be a local file and will return some local path - or it may redirect it to some location as though fit by theResourceManager
.- Parameters:
aDesc
- a description.aKey
- the key to bind to.aUrl
- a URL.- Throws:
InvalidXMLException
- if import resolution failed- See Also:
-
bindResourceUsingUrl
public static void bindResourceUsingUrl(ResourceSpecifier aDesc, String aKey, String aUrl) throws InvalidXMLException Scan the given resource specifier for external resource dependencies and whenever a dependency is encountered that has the specified key, the resource will be bound.Caveat: If you use this method, you may expect that
DataResource.getUrl()
orDataResource.getUri()
will return the same URL that you have specified here. This is may NOT be the case. UIMA will internally try to resolve the URL via aResourceManager
. If it cannot resolve a remove URL, this mechanism will think it may be a local file and will return some local path - or it may redirect it to some location as though fit by theResourceManager
.- Parameters:
aDesc
- a description.aKey
- the key to bind to.aUrl
- a URL.- Throws:
InvalidXMLException
- if import resolution failed- See Also:
-
bindResource
public static void bindResource(ResourceSpecifier aDesc, Class<? extends Resource> aRes, String... aParams) throws InvalidXMLException, ClassNotFoundException Scan the given resource specifier for external resource dependencies and whenever a dependency with a compatible type is found, the resource will be bound.- Parameters:
aDesc
- a description.aRes
- the resource to bind.aParams
- parameters passed to the resource when it is created.- Throws:
InvalidXMLException
- if import resolution failedClassNotFoundException
- if the resource implementation class or interface class could not be accessed- See Also:
-
bindResource
public static void bindResource(ResourceSpecifier aDesc, Class<?> aApi, Class<? extends Resource> aRes, String... aParams) throws InvalidXMLException, ClassNotFoundException Scan the given resource specifier for external resource dependencies and whenever a dependency with a compatible type is found, the resource will be bound.- Parameters:
aDesc
- a description.aApi
- the resource interface.aRes
- the resource to bind.aParams
- parameters passed to the resource when it is created.- Throws:
InvalidXMLException
- if import resolution failedClassNotFoundException
- if the resource implementation class or interface class could not be accessed- See Also:
-
bindResourceUsingUrl
public static void bindResourceUsingUrl(ResourceSpecifier aDesc, Class<? extends SharedResourceObject> aRes, String aUrl, Object... aParams) throws InvalidXMLException, ClassNotFoundException Scan the given resource specifier for external resource dependencies and whenever a dependency with a compatible type is found, the resource will be bound.- Parameters:
aDesc
- a description.aRes
- the resource to bind.aUrl
- the URL from which the resource is initialized.aParams
- parameters passed to the resource when it is created.- Throws:
InvalidXMLException
- if import resolution failedClassNotFoundException
- if the resource implementation class or interface class could not be accessed- See Also:
-
bindResourceUsingUrl
public static void bindResourceUsingUrl(ResourceSpecifier aDesc, Class<?> aApi, Class<? extends SharedResourceObject> aRes, String aUrl, Object... aParams) throws InvalidXMLException Scan the given resource specifier for external resource dependencies and whenever a dependency is encountered that has a key equal to the API class name, the resource will be bound.- Parameters:
aDesc
- a description.aApi
- the resource interface.aRes
- the resource to bind.aUrl
- the URL from which the resource is initialized.aParams
- parameters passed to the resource when it is created.- Throws:
InvalidXMLException
- if import resolution failed- See Also:
-
bindResourceUsingUrl
public static void bindResourceUsingUrl(ResourceSpecifier aDesc, String aKey, Class<? extends SharedResourceObject> aRes, String aUrl, Object... aParams) throws InvalidXMLException Scan the given resource specifier for external resource dependencies and whenever a dependency with the given key is encountered the resource will be bound.- Parameters:
aDesc
- a description.aKey
- the key to bind to.aRes
- the resource to bind.aUrl
- the URL from which the resource is initialized.aParams
- parameters passed to the resource when it is created.- Throws:
InvalidXMLException
- if import resolution failed- See Also:
-
bindResource
public static void bindResource(ResourceSpecifier aDesc, String aKey, Class<? extends Resource> aRes, String... aParams) throws InvalidXMLException Scan the given resource specifier for external resource dependencies and whenever a dependency with the given key is encountered, the given resource is bound to it.- Parameters:
aDesc
- a description.aKey
- the key to bind to.aRes
- the resource to bind.aParams
- parameters passed to the resource when it is created.- Throws:
InvalidXMLException
- if import resolution failed- See Also:
-
bindResource
public static void bindResource(ResourceSpecifier aDesc, ExternalResourceDescription aResDesc) throws InvalidXMLException, ClassNotFoundException Scan the given resource specifier for external resource dependencies and whenever a dependency with a compatible type is found, the given resource is bound to it.- Parameters:
aDesc
- a description.aResDesc
- the resource description.- Throws:
InvalidXMLException
- if import resolution failedClassNotFoundException
- if the resource implementation class or interface class could not be accessed
-
bindResource
public static void bindResource(ResourceSpecifier aDesc, String aKey, ExternalResourceDescription aResDesc) throws InvalidXMLException Scan the given resource specifier for external resource dependencies and whenever a dependency with the given key is encountered, the given resource is bound to it.- Parameters:
aDesc
- a description.aKey
- the key to bind to.aResDesc
- the resource description.- Throws:
InvalidXMLException
- if import resolution failed
-
createDependencyAndBind
public static void createDependencyAndBind(ResourceSpecifier aDesc, String aKey, Class<? extends Resource> aImpl, String... aParams) throws InvalidXMLException Create a new dependency for the specified resource and bind it. This method is helpful for UIMA components that do not use the uimaFITExternalResource
annotation, because no external resource dependencies can be automatically generated by uimaFIT for such components.- Parameters:
aDesc
- a description.aKey
- the key to bind to.aImpl
- the resource implementation.aParams
- additional parameters supported by the resource.- Throws:
InvalidXMLException
- if import resolution failed
-
createDependencyAndBind
public static void createDependencyAndBind(ResourceSpecifier aDesc, String aKey, Class<? extends Resource> aImpl, Class<?> aApi, String... aParams) throws InvalidXMLException Create a new dependency for the specified resource and bind it. This method is helpful for UIMA components that do not use the uimaFITExternalResource
annotation, because no external resource dependencies can be automatically generated by uimaFIT for such components.- Parameters:
aDesc
- a description.aKey
- the key to bind to.aImpl
- the resource implementation.aApi
- the resource interfaceaParams
- additional parameters supported by the resource.- Throws:
InvalidXMLException
- if import resolution failed
-
createDependency
Create a new dependency for the specified resource and bind it. This method is helpful for UIMA components that do not use the uimaFITExternalResource
annotation, because no external resource dependencies can be automatically generated by uimaFIT for such components.- Parameters:
aDesc
- a description.aKey
- the key to bind to.aApi
- the resource API.
-
createDependencyAndBindUsingUrl
public static void createDependencyAndBindUsingUrl(AnalysisEngineDescription aDesc, String aKey, Class<? extends SharedResourceObject> aImpl, String aUrl, Object... aParams) throws InvalidXMLException Create a new dependency for the specified resource and bind it. This method is helpful for UIMA components that do not use the uimaFITExternalResource
annotation, because no external resource dependencies can be automatically generated by uimaFIT for such components.- Parameters:
aDesc
- a description.aKey
- the key to bind to.aImpl
- the resource implementation.aUrl
- the resource URL.aParams
- additional parameters supported by the resource.- Throws:
InvalidXMLException
- if import resolution failed
-
bindResource
@Deprecated public static void bindResource(ResourceManagerConfiguration aResMgrCfg, String aBindTo, ExternalResourceDescription aRes) Create a binding for the given external resource in the given resource manager. This method also scans the given external resource for any nested external resources and creates bindings for them as well.- Parameters:
aResMgrCfg
- the resource manager to create the binding in.aBindTo
- what key to bind to.aRes
- the resource that should be bound.
-
bindResourceOnce
public static void bindResourceOnce(ResourceManagerConfiguration aResMgrCfg, String aBindTo, ExternalResourceDescription aRes) Create a binding for the given external resource in the given resource manager. This method also scans the given external resource for any nested external resources and creates bindings for them as well.NOTE:If you use this method on resource manager configurations of aggregate analysis engine descriptions because it will not have any effects on the delegate analysis engines of the aggregate. If you want to recursively bind an external resource to the delegates in an aggregate engine, use e.g.
bindResource(ResourceSpecifier, String, ExternalResourceDescription)
.- Parameters:
aResMgrCfg
- the resource manager to create the binding in.aBindTo
- what key to bind to.aRes
- the resource that should be bound.
-
bindResource
@Deprecated public static void bindResource(ExternalResourceDescription aRes, String aBindTo, ExternalResourceDescription aNestedRes) Create a new external resource binding.- Parameters:
aRes
- the resource to bind toaBindTo
- what key to bind to.aNestedRes
- the resource that should be bound.
-
bindResourceOnce
public static void bindResourceOnce(ExternalResourceDescription aRes, String aBindTo, ExternalResourceDescription aNestedRes) Create a binding for the given external resource in the given resource. This method also scans the given external resource for any nested external resources and creates bindings for them as well.NOTE: This method only works on
ExtendedExternalResourceDescription_impl
instances. AnyExternalResourceDescription
instances created with uimaFIT use this implementation. For reasons of convenience, the method signature usesExternalResourceDescription
but will thrown anIllegalArgumentException
if the wrong implementations are provided.- Parameters:
aRes
- the resource to bind toaBindTo
- what key to bind to.aNestedRes
- the resource that should be bound.- Throws:
IllegalArgumentException
- if the given resource description is not an instance ofExtendedExternalResourceDescription_impl
.
-
bindResourceOnce
public static void bindResourceOnce(ResourceCreationSpecifier aDesc, String aBindTo, ExternalResourceDescription aRes) Create a binding for the given external resource in the resource manager configuration of the given resource. If no resource manager configuration exists yet, it will be created. This method also scans the given external resource for any nested external resources and creates bindings for them as well.NOTE:IF you use this method with aggregate analysis engine descriptions because it will not have any effects on the delegate analysis engines of the aggregate. If you want to recursively bind an external resource to the delegates in an aggregate engine, use e.g.
bindResource(ResourceSpecifier, String, ExternalResourceDescription)
.- Parameters:
aDesc
- the specifier to create the binding in.aBindTo
- what key to bind to.aRes
- the resource that should be bound.
-
bindResource
@Deprecated public static void bindResource(ResourceManagerConfiguration aResMgrCfg, String aBindTo, String aRes) Create a binding for the given external resource in the given resource manager configuration. This method does not scan the given external resource for any nested external resources and does not create bindings for them. UsebindResourceOnce(ResourceCreationSpecifier, String, ExternalResourceDescription)
if you wish to bind nested resources as well.NOTE:If you use this method on resource manager configurations of aggregate analysis engine descriptions because it will not have any effects on the delegate analysis engines of the aggregate. If you want to recursively bind an external resource to the delegates in an aggregate engine, use e.g.
bindResource(ResourceSpecifier, String, ExternalResourceDescription)
.- Parameters:
aResMgrCfg
- the resource manager to create the binding in.aBindTo
- what key to bind to.aRes
- the resource that should be bound.
-
bindResourceOnceWithoutNested
public static void bindResourceOnceWithoutNested(ResourceManagerConfiguration aResMgrCfg, String aBindTo, String aRes) Create a binding for the given external resource in the given resource manager configuration. This method does not scan the given external resource for any nested external resources and does not create bindings for them. UsebindResourceOnce(ResourceCreationSpecifier, String, ExternalResourceDescription)
if you wish to bind nested resources as well.NOTE:If you use this method on resource manager configurations of aggregate analysis engine descriptions because it will not have any effects on the delegate analysis engines of the aggregate. If you want to recursively bind an external resource to the delegates in an aggregate engine, use e.g.
bindResource(ResourceSpecifier, String, ExternalResourceDescription)
.- Parameters:
aResMgrCfg
- the resource manager to create the binding in.aBindTo
- what key to bind to.aRes
- the resource that should be bound.
-
bindResourceOnceWithoutNested
public static void bindResourceOnceWithoutNested(ResourceCreationSpecifier aDesc, String aBindTo, String aRes) Create a binding for the given external resource in resource manager configuration of the given resource creation specified. If no resource manager configuration exists yet, it is created. This method does not scan the given external resource for any nested external resources and does not create bindings for them. UsebindResourceOnce(ResourceCreationSpecifier, String, ExternalResourceDescription)
if you wish to bind nested resources as well.NOTE:If you use this method on an aggregate analysis engine description, it will not have any effects on the delegate analysis engines of the aggregate. If you want to recursively bind an external resource to the delegates in an aggregate engine, use e.g.
bindResource(ResourceSpecifier, String, ExternalResourceDescription)
.- Parameters:
aDesc
- the specifier to create the binding in.aBindTo
- what key to bind to.aRes
- the resource that should be bound.
-
getImplementationName
Find the name of the class implementing this resource. The location where this name is stored varies, depending if the resource extendsSharedResourceObject
or implementsResource
.- Parameters:
aDesc
- the external resource description.- Returns:
- the implementation name.
-
extractResourceParameters
protected static Map<String,ExternalResourceDescription> extractResourceParameters(Object[] configurationData) Extracts the external resource from the configuration parameters and nulls out these parameters. Mind that the array passed to this method is modified by the method.- Parameters:
configurationData
- the configuration parameters.- Returns:
- extRes the external resource parameters.
-
createResource
public static <R extends Resource> R createResource(Class<R> resourceClass, Object... params) throws ResourceInitializationException Create an instance of a UIMA shared/external resource class.- Type Parameters:
R
- the resource type.- Parameters:
resourceClass
- the class implementing the resource.params
- parameters passed to the resource when it is created. Each parameter consists of two arguments, the first being the name and the second being the parameter value- Returns:
- the resource instance.
- Throws:
ResourceInitializationException
- if there was a problem instantiating the resource.
-
createResource
public static <R extends Resource> R createResource(Class<R> resourceClass, ResourceManager resMgr, Object... params) throws ResourceInitializationException Create an instance of a UIMA shared/external resource class.- Type Parameters:
R
- the resource type.- Parameters:
resourceClass
- the class implementing the resource.resMgr
- a resource manager (optional).params
- parameters passed to the resource when it is created. Each parameter consists of two arguments, the first being the name and the second being the parameter value- Returns:
- the resource instance.
- Throws:
ResourceInitializationException
- if there was a problem instantiating the resource.
-
bindResourceOnce(ExternalResourceDescription, String, ExternalResourceDescription)