Package org.apache.uima.resource
Interface Resource
-
- All Known Subinterfaces:
AnalysisEngine
,ASB
,BaseCollectionReader
,CasConsumer
,CasDataCollectionReader
,CasDataConsumer
,CasDataInitializer
,CasInitializer
,CollectionReader
,ConfigurableResource
,DataResource
,ParameterizedDataResource
,TextAnalysisEngine
- All Known Implementing Classes:
AggregateAnalysisEngine_impl
,AnalysisEngineImplBase
,AnalysisEngineProcessorAdapter
,AnalysisEngineServiceAdapter
,ASB_impl
,ASB_impl.DummyAnalysisEngine
,CasConsumer_ImplBase
,CasDataCollectionReader_ImplBase
,CasDataConsumer_ImplBase
,CasDataInitializer_ImplBase
,CasInitializer_ImplBase
,CasProcessorAnnotator
,CollectionReader_ImplBase
,ConfigurableDataResource_impl
,ConfigurableResource_ImplBase
,DataResource_impl
,FileLanguageResource_impl
,FileSystemCollectionReader
,FlowControllerContainer
,InlineXmlCasConsumer
,JCasProcessorAnnotator
,MultiprocessingAnalysisEngine_impl
,PearAnalysisEngineWrapper
,PrimitiveAnalysisEngine_impl
,ProcessingContainer
,ProcessingContainer_Impl
,Resource_ImplBase
,ResourceCreationSpecifier_impl.DummyResource
,ResourceServiceAdapter
,UimacppAnalysisEngineImpl
,VinciAnalysisEngineServiceAdapter
,XCasWriterCasConsumer
,XmiWriterCasConsumer
public interface Resource
Resource
is the general term for all UIMA components that can be acquired and used by an application (or by other resources).Resource
s may be co-located with their client or distributed as services. This is made transparent to the client.A
ResourceSpecifier
contains information that can be used acquire a reference to aResource
, whether that is done by instantiating the resource locally or locating an existing resource available as a service.The
ResourceFactory
takes aResourceSpecifier
and returns an instance of the specifiedResource
. Again, this can be done by creating the instance or by locating an existing instance.Most applications will not need to deal with this abstract
Resource
interface. UIMA Developers who need to introduce new types of Resources, however, will need to implement this interface.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PARAM_AGGREGATE_SOFA_MAPPINGS
Used to pass the sofa mappings to the ASBstatic java.lang.String
PARAM_CONFIG_MANAGER
Key to specify a pre-existingConfigurationManager
object.static java.lang.String
PARAM_CONFIG_PARAM_SETTINGS
Key for the initialization parameter whose value is aConfigurationParameterSettings
object that holds configuration settings that will be used to configure this Resource, overriding any conflicting settings specified in this Resource's Descriptor.static java.lang.String
PARAM_EXTERNAL_OVERRIDE_SETTINGS
Key for the initialization parameter whose value is aSettings
object that holds the external override settings.static java.lang.String
PARAM_PERFORMANCE_TUNING_SETTINGS
Key for the initialization parameter whose value is aProperties
object that holds settings that tune the performance of the framework.static java.lang.String
PARAM_RESOURCE_MANAGER
Key for the initialization parameter whose value is a reference to theResourceManager
that this Resource should use to locate and access other Resources.static java.lang.String
PARAM_UIMA_CONTEXT
Key for the initialization parameter whose value is a reference to theUimaContext
that is to be used by this Resource to access its external resource and configuration parameters.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
destroy()
Releases all resources held by thisResource
.Logger
getLogger()
Gets the Logger that this Resource is currently using.ResourceMetaData
getMetaData()
Gets the metadata that describes thisResource
.ResourceManager
getResourceManager()
Gets theResourceManager
that this Resource uses to locate other Resources.UimaContext
getUimaContext()
Gets the UIMA Context for this Resource.UimaContextAdmin
getUimaContextAdmin()
Gets the Administrative interface to the UIMA Context.boolean
initialize(ResourceSpecifier aSpecifier, java.util.Map<java.lang.String,java.lang.Object> aAdditionalParams)
Initializes thisResource
from aResourceSpecifier
.void
setLogger(Logger aLogger)
Sets the Logger that this Resource will use.
-
-
-
Field Detail
-
PARAM_UIMA_CONTEXT
static final java.lang.String PARAM_UIMA_CONTEXT
Key for the initialization parameter whose value is a reference to theUimaContext
that is to be used by this Resource to access its external resource and configuration parameters. This value is used as a key in theaAdditionalParams
Map that is passed to theinitialize(ResourceSpecifier,Map)
method.- See Also:
- Constant Field Values
-
PARAM_RESOURCE_MANAGER
static final java.lang.String PARAM_RESOURCE_MANAGER
Key for the initialization parameter whose value is a reference to theResourceManager
that this Resource should use to locate and access other Resources. This value is used as a key in theaAdditionalParams
Map that is passed to theinitialize(ResourceSpecifier,Map)
method.- See Also:
- Constant Field Values
-
PARAM_CONFIG_PARAM_SETTINGS
static final java.lang.String PARAM_CONFIG_PARAM_SETTINGS
Key for the initialization parameter whose value is aConfigurationParameterSettings
object that holds configuration settings that will be used to configure this Resource, overriding any conflicting settings specified in this Resource's Descriptor. This value is used as a key in theaAdditionalParams
Map that is passed to theinitialize(ResourceSpecifier,Map)
method.- See Also:
- Constant Field Values
-
PARAM_EXTERNAL_OVERRIDE_SETTINGS
static final java.lang.String PARAM_EXTERNAL_OVERRIDE_SETTINGS
Key for the initialization parameter whose value is aSettings
object that holds the external override settings. This will replace any prior settings. If omitted the value in the parent UIMA Context is inherited. If there is no parent (i.e. at the root or top-level context) then the files in the system property UimaExternalOverrides are used. This value is used as a key in theaAdditionalParams
Map that is passed to theinitialize(ResourceSpecifier,Map)
method.- See Also:
- Constant Field Values
-
PARAM_PERFORMANCE_TUNING_SETTINGS
static final java.lang.String PARAM_PERFORMANCE_TUNING_SETTINGS
Key for the initialization parameter whose value is aProperties
object that holds settings that tune the performance of the framework. This value is used as a key in theaAdditionalParams
Map that is passed to theinitialize(ResourceSpecifier,Map)
method.
-
PARAM_AGGREGATE_SOFA_MAPPINGS
static final java.lang.String PARAM_AGGREGATE_SOFA_MAPPINGS
Used to pass the sofa mappings to the ASB- See Also:
- Constant Field Values
-
PARAM_CONFIG_MANAGER
static final java.lang.String PARAM_CONFIG_MANAGER
Key to specify a pre-existingConfigurationManager
object. If specified, this object is used when initializing the UimaContext associated with this Resource, instead of creating a new instance. This value is used as a key in theaAdditionalParams
Map that is passed to theinitialize(ResourceSpecifier,Map)
method.- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
boolean initialize(ResourceSpecifier aSpecifier, java.util.Map<java.lang.String,java.lang.Object> aAdditionalParams) throws ResourceInitializationException
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.- 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.UIMA_IllegalStateException
- if this method is called more than once on a single Resource instance.
-
getMetaData
ResourceMetaData getMetaData()
Gets the metadata that describes thisResource
.- Returns:
- an object containing all metadata for this resource.
-
getResourceManager
ResourceManager getResourceManager()
Gets theResourceManager
that this Resource uses to locate other Resources.- Returns:
- the ResourceManager
-
getLogger
Logger getLogger()
Gets the Logger that this Resource is currently using.- Returns:
- this Resource's logger
-
setLogger
void setLogger(Logger aLogger)
Sets the Logger that this Resource will use. If this method is not called, the default logger (UIMAFramework.getLogger()
) will be used.- Parameters:
aLogger
- the logger for this Resource to use
-
destroy
void destroy()
Releases all resources held by thisResource
.
-
getUimaContext
UimaContext getUimaContext()
Gets the UIMA Context for this Resource. This can be used to access external resources or facilities such as the Logger.- Returns:
- the UimaContext for use by this Resource
-
getUimaContextAdmin
UimaContextAdmin getUimaContextAdmin()
Gets the Administrative interface to the UIMA Context. This can be used by deployment wrappers to modify the UimaContext (for example, by setting the Session object).- Returns:
- the administrative interface to this Resource's UimaContext
-
-