Package org.apache.uima.fit.component
Class Resource_ImplBase
java.lang.Object
org.apache.uima.resource.Resource_ImplBase
org.apache.uima.fit.component.Resource_ImplBase
- All Implemented Interfaces:
ExternalResourceAware
,Resource
- Direct Known Subclasses:
ExternalResourceExample3.ChainableResource
,JndiResourceLocator
,ResourceList
Base class for external resources which initializes itself based on annotations.
-
Field Summary
Fields inherited from interface org.apache.uima.resource.Resource
PARAM_AGGREGATE_SOFA_MAPPINGS, PARAM_CONFIG_MANAGER, PARAM_CONFIG_PARAM_SETTINGS, PARAM_EXTERNAL_OVERRIDE_SETTINGS, PARAM_PERFORMANCE_TUNING_SETTINGS, PARAM_RESOURCE_MANAGER, PARAM_UIMA_CONTEXT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Called after the external resources have been initialized.Get the name of the resource.boolean
initialize
(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) Initializes thisResource
from aResourceSpecifier
.Methods inherited from class org.apache.uima.resource.Resource_ImplBase
destroy, getCasManager, getLogger, getMetaData, getRelativePathResolver, getResourceManager, getUimaContext, getUimaContextAdmin, loadUserClass, loadUserClassOrThrow, setContextHolder, setContextHolderX, setLogger, setMetaData, withContextHolder
-
Constructor Details
-
Resource_ImplBase
public Resource_ImplBase()
-
-
Method Details
-
initialize
public boolean initialize(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) throws ResourceInitializationExceptionDescription copied from interface:Resource
Initializes thisResource
from aResourceSpecifier
. Applications do not need to call this method. It is called automatically by theResourceFactory
and cannot be called a second time.- Specified by:
initialize
in interfaceResource
- Overrides:
initialize
in classResource_ImplBase
- Parameters:
aSpecifier
- specifies how to create a resource or locate an existing resource service.aAdditionalParams
- a Map containing additional parameters. May benull
if there are no parameters. Each class that implements this interface can decide what additional parameters it supports.- Returns:
- true if and only if initialization completed successfully. Returns false if the given
ResourceSpecifier
is not of an appropriate type for this Resource. If theResourceSpecifier
is of an appropriate type but is invalid or if some other failure occurs, an exception should be thrown. - Throws:
ResourceInitializationException
- if a failure occurs during initialization.
-
getResourceName
Description copied from interface:ExternalResourceAware
Get the name of the resource. This is set by the different variations ofExternalResourceFactory.bindResourceOnce(org.apache.uima.resource.metadata.ResourceManagerConfiguration, java.lang.String, org.apache.uima.resource.ExternalResourceDescription)
which internally callExternalResourceFactory.bindNestedResources(...)
to set the parameterPARAM_RESOURCE_NAME
.
It is mandatory that any resource implementing this interface declares the configuration parameterPARAM_RESOURCE_NAME
.- Specified by:
getResourceName
in interfaceExternalResourceAware
- Returns:
- the resource name.
-
afterResourcesInitialized
Description copied from interface:ExternalResourceAware
Called after the external resources have been initialized.- Specified by:
afterResourcesInitialized
in interfaceExternalResourceAware
- Throws:
ResourceInitializationException
- if an problem occurs in the late initialization.
-