public abstract class Resource_ImplBase extends Object implements Resource
Resource
s. Provides access to
resource metadata and the UIMA Context, which in turn provides access to framework facilities
such as logging and resource management.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 and Description |
---|
Resource_ImplBase() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Releases all resources held by this
Resource . |
CasManager |
getCasManager()
Get the CasManager for this Resource.
|
Logger |
getLogger()
Get the logger for this UIMA framework class.
|
ResourceMetaData |
getMetaData()
Gets the metadata that describes this
Resource . |
RelativePathResolver |
getRelativePathResolver(Map<String,Object> aAdditionalParams) |
ResourceManager |
getResourceManager()
Gets the
ResourceManager that this Resource uses to locate other Resources. |
UimaContext |
getUimaContext()
Gets the UIMA Context for this Resource.
|
UimaContextAdmin |
getUimaContextAdmin()
Gets the Admin interface to this Resource's UimaContext.
|
boolean |
initialize(ResourceSpecifier aSpecifier,
Map<String,Object> aAdditionalParams)
Initializes this
Resource from a ResourceSpecifier . |
void |
setLogger(Logger aLogger)
Set the logger in the current UimaContext for use by user annotators.
|
protected void |
setMetaData(ResourceMetaData aMetaData)
Sets the
ResourceMetaData object associated with this Resource . |
public boolean initialize(ResourceSpecifier aSpecifier, Map<String,Object> aAdditionalParams) throws ResourceInitializationException
Resource
Resource
from a ResourceSpecifier
. Applications
do not need to call this method. It is called automatically by the ResourceFactory
and cannot be called a second time.initialize
in interface Resource
aSpecifier
- specifies how to create a resource or locate an existing resource service.aAdditionalParams
- a Map containing additional parameters. May be null
if there are no
parameters. Each class that implements this interface can decide what additional
parameters it supports.ResourceSpecifier
is not of an appropriate type for this Resource. If
the ResourceSpecifier
is of an appropriate type but is invalid or if
some other failure occurs, an exception should be thrown.ResourceInitializationException
- if a failure occurs during initialization.multi-thread safe, given that each instance of this class is only called on one thread, once.
The critical parts that update shared information (in shared uima context) are inside a synchronize block
public void destroy()
Resource
Resource
.destroy
in interface Resource
Resource.destroy()
public ResourceMetaData getMetaData()
Resource
Resource
.getMetaData
in interface Resource
Resource.getMetaData()
protected void setMetaData(ResourceMetaData aMetaData)
ResourceMetaData
object associated with this Resource
.
Any previously existing metadata will be replaced.
Resource subclasses should call this method during initialization in order to set the metadata
before any calls to getMetaData()
are made.
aMetaData
- metadata to assign to this Resource
public Logger getLogger()
public void setLogger(Logger aLogger)
public ResourceManager getResourceManager()
Resource
ResourceManager
that this Resource uses to locate other Resources.getResourceManager
in interface Resource
Resource.getResourceManager()
public UimaContext getUimaContext()
Resource
getUimaContext
in interface Resource
public UimaContextAdmin getUimaContextAdmin()
getUimaContextAdmin
in interface Resource
public CasManager getCasManager()
public RelativePathResolver getRelativePathResolver(Map<String,Object> aAdditionalParams)
Copyright © 2006–2017 The Apache Software Foundation. All rights reserved.