Interface ResourceManagerConfiguration
-
- All Superinterfaces:
java.lang.Cloneable,MetaDataObject,java.io.Serializable,XMLizable
- All Known Implementing Classes:
ResourceManagerConfiguration_impl
public interface ResourceManagerConfiguration extends MetaDataObject
Defines a set of external resources and their bindings toExternalResourceDependencies.Resource Manager Configurations can declare that they
importother 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 theResourceManageris initialized (e.g. during AnalysisEngine initialization).Resource Manager Configurations can optionally be assigned a
name,description,vendor, andversion. 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
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaddExternalResource(ExternalResourceDescription aExternalResourceDescription)Adds a External Resource to this configurationvoidaddExternalResourceBinding(ExternalResourceBinding aExternalResourceBinding)Adds a External ResourceBinding to this configurationjava.lang.StringgetDescription()Gets the description of this Resource Manager Configuration.ExternalResourceBinding[]getExternalResourceBindings()Gets the bindings between an Analysis Engine'sExternalResourceDependenciesand theExternalResourceDescriptionobjects defined in this configuration.ExternalResourceDescription[]getExternalResources()Gets the descriptions of the external resources to be instantiated and managed by the resource manager.ImportgetImport()Deprecated.UsegetImports()instead.Import[]getImports()Gets the imports declared by this Resource Manager Configuration.java.lang.StringgetName()Gets the name of this Resource Manager Configuration.java.lang.StringgetVendor()Gets the vendor of this Resource Manager Configuration.java.lang.StringgetVersion()Gets the version number of this Resource Manager Configuration.voidremoveExternalResource(ExternalResourceDescription aExternalResourceDescription)Removes an ExternalResource from this configuration.voidremoveExternalResourceBinding(ExternalResourceBinding aExternalResourceBinding)Removes an ExternalResourceBinding from this configuration.voidresolveImports()Resolves any import declarations in this resource manager configuration, adding the imported external resources and external resource bindings directly onto this ResourceManagerConfiguration'sexternalResourcesandexternalResourceBindingslists.voidresolveImports(java.util.Collection<java.lang.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'sexternalResourcesandexternalResourceBindingslists.voidresolveImports(ResourceManager aResourceManager)Resolves any import declarations in this resource manager configuration, adding the imported external resources and external resource bindings directly onto this ResourceManagerConfiguration'sexternalResourcesandexternalResourceBindingslists.voidsetDescription(java.lang.String aDescription)Sets the description of this Resource Manager Configuration.voidsetExternalResourceBindings(ExternalResourceBinding[] aBindings)Sets the bindings between an Analysis Engine'sExternalResourceDependenciesand theExternalResourceDescriptionobjects defined in this configuration.voidsetExternalResources(ExternalResourceDescription[] aDescriptions)Sets the descriptions of the external resources to be instantiated and managed by the resource manager.voidsetImport(Import aImport)Deprecated.UsesetImports(Import[])instead.voidsetImports(Import[] aImports)Sets the imports declared by this Resource Manager Configuration.voidsetName(java.lang.String aName)Sets the name of this Resource Manager Configuration.voidsetVendor(java.lang.String aVendor)Sets the vendor of this Resource Manager Configuration.voidsetVersion(java.lang.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 Detail
-
getName
java.lang.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
void setName(java.lang.String aName)
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
java.lang.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
void setVersion(java.lang.String aVersion)
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
java.lang.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
void setDescription(java.lang.String aDescription)
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
java.lang.String getVendor()
Gets the vendor of this Resource Manager Configuration.- Returns:
- the vendor of this Resource Manager Configuration, as a String
-
setVendor
void setVendor(java.lang.String aVendor)
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
void setImports(Import[] aImports)
Sets the imports declared by this Resource Manager Configuration.- Parameters:
aImports- an array of imports declared by this Resource Manager Configuration.
-
getImport
@Deprecated Import 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 void setImport(Import aImport)
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
ExternalResourceDescriptionobjects that describe the external resources.
-
setExternalResources
void setExternalResources(ExternalResourceDescription[] aDescriptions)
Sets the descriptions of the external resources to be instantiated and managed by the resource manager.- Parameters:
aDescriptions- an array ofExternalResourceDescriptionobjects that describe the external resources.
-
addExternalResource
void addExternalResource(ExternalResourceDescription aExternalResourceDescription)
Adds a External Resource to this configuration- Parameters:
aExternalResourceDescription- the ExternalResourceDescription to add- Throws:
UIMA_UnsupportedOperationException- if this object is not modifiable
-
removeExternalResource
void removeExternalResource(ExternalResourceDescription aExternalResourceDescription)
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'sExternalResourceDependenciesand theExternalResourceDescriptionobjects defined in this configuration.- Returns:
- an array of
ExternalResourceBindingobjects that bind dependencies to resources.
-
setExternalResourceBindings
void setExternalResourceBindings(ExternalResourceBinding[] aBindings)
Sets the bindings between an Analysis Engine'sExternalResourceDependenciesand theExternalResourceDescriptionobjects defined in this configuration.- Parameters:
aBindings- an array ofExternalResourceBindingobjects that bind dependencies to resources.
-
addExternalResourceBinding
void addExternalResourceBinding(ExternalResourceBinding aExternalResourceBinding)
Adds a External ResourceBinding to this configuration- Parameters:
aExternalResourceBinding- the ExternalResourceBinding to add- Throws:
UIMA_UnsupportedOperationException- if this object is not modifiable
-
removeExternalResourceBinding
void removeExternalResourceBinding(ExternalResourceBinding aExternalResourceBinding)
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
void resolveImports() throws InvalidXMLExceptionResolves any import declarations in this resource manager configuration, adding the imported external resources and external resource bindings directly onto this ResourceManagerConfiguration'sexternalResourcesandexternalResourceBindingslists.- Throws:
InvalidXMLException- if either the import target does not exist or is invalid
-
resolveImports
void resolveImports(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'sexternalResourcesandexternalResourceBindingslists.- 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(java.util.Collection<java.lang.String> aAlreadyImportedURLs, ResourceManager aResourceManager) throws InvalidXMLExceptionResolves any import declarations in this resource manager configuration, adding the imported external resources and external resource bindings directly onto this ResourceManagerConfiguration'sexternalResourcesandexternalResourceBindingslists.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
-
-