Interface ResourceManagerConfiguration
- All Superinterfaces:
Cloneable
,MetaDataObject
,Serializable
,XMLizable
- All Known Implementing Classes:
ResourceManagerConfiguration_impl
ExternalResourceDependencies
.
Resource Manager Configurations can declare that they import
other Resource
Manager Configurations. At runtime, these imports will be resolved to create a single logical
Resource Manager Configuration..
Note that type system imports are not automatically resolved when a ResourceMangerConfiguration
is deserialized from XML. To resolve the imports, call the resolveImports()
method.
Import resolution is done automatically when the ResourceManager
is initialized (e.g. during AnalysisEngine initialization).
Resource Manager Configurations can optionally be assigned a name
,
description
, vendor
, and version
. It is recommended that these properties be set on any Resource Manager Configuration
that is meant to be shared by (imported by) multiple components.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addExternalResource
(ExternalResourceDescription aExternalResourceDescription) Adds a External Resource to this configurationvoid
addExternalResourceBinding
(ExternalResourceBinding aExternalResourceBinding) Adds a External ResourceBinding to this configurationGets the description of this Resource Manager Configuration.Gets the bindings between an Analysis Engine'sExternalResourceDependencies
and theExternalResourceDescription
objects defined in this configuration.Gets the descriptions of the external resources to be instantiated and managed by the resource manager.Deprecated.Import[]
Gets the imports declared by this Resource Manager Configuration.getName()
Gets the name of this Resource Manager Configuration.Gets the vendor of this Resource Manager Configuration.Gets the version number of this Resource Manager Configuration.void
removeExternalResource
(ExternalResourceDescription aExternalResourceDescription) Removes an ExternalResource from this configuration.void
removeExternalResourceBinding
(ExternalResourceBinding aExternalResourceBinding) Removes an ExternalResourceBinding from this configuration.void
Resolves any import declarations in this resource manager configuration, adding the imported external resources and external resource bindings directly onto this ResourceManagerConfiguration'sexternalResources
andexternalResourceBindings
lists.void
resolveImports
(Collection<String> aAlreadyImportedURLs, ResourceManager aResourceManager) Resolves any import declarations in this resource manager configuration, adding the imported external resources and external resource bindings directly onto this ResourceManagerConfiguration'sexternalResources
andexternalResourceBindings
lists.void
resolveImports
(ResourceManager aResourceManager) Resolves any import declarations in this resource manager configuration, adding the imported external resources and external resource bindings directly onto this ResourceManagerConfiguration'sexternalResources
andexternalResourceBindings
lists.void
setDescription
(String aDescription) Sets the description of this Resource Manager Configuration.void
setExternalResourceBindings
(ExternalResourceBinding[] aBindings) Sets the bindings between an Analysis Engine'sExternalResourceDependencies
and theExternalResourceDescription
objects defined in this configuration.void
setExternalResources
(ExternalResourceDescription[] aDescriptions) Sets the descriptions of the external resources to be instantiated and managed by the resource manager.void
Deprecated.UsesetImports(Import[])
instead.void
setImports
(Import[] aImports) Sets the imports declared by this Resource Manager Configuration.void
Sets the name of this Resource Manager Configuration.void
Sets the vendor of this Resource Manager Configuration.void
setVersion
(String aVersion) Sets the version number of this Resource Manager Configuration.Methods inherited from interface org.apache.uima.resource.metadata.MetaDataObject
clone, equals, getAttributeValue, getSourceUrl, getSourceUrlString, isModifiable, listAttributes, setAttributeValue, setSourceUrl
Methods inherited from interface org.apache.uima.util.XMLizable
buildFromXMLElement, buildFromXMLElement, toXML, toXML, toXML, toXML
-
Method Details
-
getName
String getName()Gets the name of this Resource Manager Configuration.- Returns:
- the name of this Resource Manager Configuration, null if none has been specified.
-
setName
Sets the name of this Resource Manager Configuration.- Parameters:
aName
- the name of this Resource Manager Configuration- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
getVersion
String getVersion()Gets the version number of this Resource Manager Configuration.- Returns:
- the version number of this Resource Manager Configuration, as a String, null if none has been specified.
-
setVersion
Sets the version number of this Resource Manager Configuration.- Parameters:
aVersion
- the version number of this Resource Manager Configuration, as a String- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
getDescription
String getDescription()Gets the description of this Resource Manager Configuration.- Returns:
- the description of this Resource Manager Configuration, null if none has been specified.
-
setDescription
Sets the description of this Resource Manager Configuration.- Parameters:
aDescription
- the description of this Resource Manager Configuration- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
getVendor
String getVendor()Gets the vendor of this Resource Manager Configuration.- Returns:
- the vendor of this Resource Manager Configuration, as a String
-
setVendor
Sets the vendor of this Resource Manager Configuration.- Parameters:
aVendor
- the vendor of this Resource Manager Configuration, as a String, null if none has been specified.- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
getImports
Import[] getImports()Gets the imports declared by this Resource Manager Configuration.- Returns:
- an array of imports declared by this Resource Manager Configuration.
-
setImports
Sets the imports declared by this Resource Manager Configuration.- Parameters:
aImports
- an array of imports declared by this Resource Manager Configuration.
-
getImport
Deprecated.UsegetImports()
instead. There may be many imports; this method only returns the first.Gets the import declared by this Resource Manager Configuration, if any.- Returns:
- an object that defines how to locate an external XML file defining the resource manager configuration. Returns null if there is no import.
-
setImport
Deprecated.UsesetImports(Import[])
instead.Sets the import declared by this Resource Manager Configuration, if any.- Parameters:
aImport
- an object that defines how to locate an external XML file defining the resource manager configuration. Null indicates that there is no import.
-
getExternalResources
ExternalResourceDescription[] getExternalResources()Gets the descriptions of the external resources to be instantiated and managed by the resource manager.- Returns:
- an array of
ExternalResourceDescription
objects that describe the external resources.
-
setExternalResources
Sets the descriptions of the external resources to be instantiated and managed by the resource manager.- Parameters:
aDescriptions
- an array ofExternalResourceDescription
objects that describe the external resources.
-
addExternalResource
Adds a External Resource to this configuration- Parameters:
aExternalResourceDescription
- the ExternalResourceDescription to add- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
removeExternalResource
Removes an ExternalResource from this configuration.- Parameters:
aExternalResourceDescription
- the ExternalResourceDescription to remove (must be == with an ExternalResourceDescription in this collection, or this method will do nothing).- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
getExternalResourceBindings
ExternalResourceBinding[] getExternalResourceBindings()Gets the bindings between an Analysis Engine'sExternalResourceDependencies
and theExternalResourceDescription
objects defined in this configuration.- Returns:
- an array of
ExternalResourceBinding
objects that bind dependencies to resources.
-
setExternalResourceBindings
Sets the bindings between an Analysis Engine'sExternalResourceDependencies
and theExternalResourceDescription
objects defined in this configuration.- Parameters:
aBindings
- an array ofExternalResourceBinding
objects that bind dependencies to resources.
-
addExternalResourceBinding
Adds a External ResourceBinding to this configuration- Parameters:
aExternalResourceBinding
- the ExternalResourceBinding to add- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
removeExternalResourceBinding
Removes an ExternalResourceBinding from this configuration.- Parameters:
aExternalResourceBinding
- the ExternalResourceBinding to remove (must be == with an ExternalResourceBinding in this collection, or this method will do nothing).- Throws:
UIMA_UnsupportedOperationException
- if this object is not modifiable
-
resolveImports
Resolves any import declarations in this resource manager configuration, adding the imported external resources and external resource bindings directly onto this ResourceManagerConfiguration'sexternalResources
andexternalResourceBindings
lists.- Throws:
InvalidXMLException
- if either the import target does not exist or is invalid
-
resolveImports
Resolves any import declarations in this resource manager configuration, adding the imported external resources and external resource bindings directly onto this ResourceManagerConfiguration'sexternalResources
andexternalResourceBindings
lists.- Parameters:
aResourceManager
- the Resource Manager used to locate the XML file imported by name. For example, the path in which to locate the imported files can be set via theResourceManager.setDataPath(String)
method.- Throws:
InvalidXMLException
- if either the import target does not exist or is invalid
-
resolveImports
void resolveImports(Collection<String> aAlreadyImportedURLs, ResourceManager aResourceManager) throws InvalidXMLException Resolves any import declarations in this resource manager configuration, adding the imported external resources and external resource bindings directly onto this ResourceManagerConfiguration'sexternalResources
andexternalResourceBindings
lists.This version is used internally to resolve nested imports.
- Parameters:
aResourceManager
- the Resource Manager used to locate the XML file imported by name. For example, the path in which to locate the imported files can be set via theResourceManager.setDataPath(String)
method.aAlreadyImportedURLs
- names of already imported URLs, so we don't import them again.- Throws:
InvalidXMLException
- if either the import target does not exist or is invalid
-
getImports()
instead.