Package org.apache.uima.resource
Interface ResourceCreationSpecifier
-
- All Superinterfaces:
java.lang.Cloneable,MetaDataObject,ResourceSpecifier,java.io.Serializable,XMLizable
- All Known Subinterfaces:
AnalysisEngineDescription,CasConsumerDescription,CasInitializerDescription,CollectionReaderDescription,FlowControllerDescription,TaeDescription
- All Known Implementing Classes:
AnalysisEngineDescription_impl,CasConsumerDescription_impl,CasInitializerDescription_impl,CollectionReaderDescription_impl,FlowControllerDescription_impl,ResourceCreationSpecifier_impl,TaeDescription_impl
public interface ResourceCreationSpecifier extends ResourceSpecifier
AResourceCreationSpecifieris the supertype ofAnalysisEngineDescription,CasConsumerDescription,CollectionReaderDescription, andCasInitializerDescription.All Resource Creation Specifiers must the following:
frameworkImplementation: The name of the UIMA framework in which the component executes. The name for this implementation is given byConstants.JAVA_FRAMEWORK_NAME. A component that runs in the C++ enablement layer needs to have the framework name given byConstants.CPP_FRAMEWORK_NAME.implementationName: The fully-qualified Java class name of the user's component (Annotator, CAS Consumer, Collection Reader, or CAS Initializer).metaData: theResourceMetaDatadescribing the resource
- A set of
ExternalResourceDependencyobjects that define this resource's dependencies on other resources. - A set of
ExternalResourceDescriptionobjects that satisfy the dependencies.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddoFullValidation()Does full validation of thisResourceCreationSpecifier.voiddoFullValidation(ResourceManager aResourceManager)Does full validation of thisResourceCreationSpecifier.ExternalResourceDependency[]getExternalResourceDependencies()Retrieves descriptions of thisResourceCreationSpecifier's dependencies on external resources.ExternalResourceDependencygetExternalResourceDependency(java.lang.String aKey)Gets the external resource dependency with the given key.java.lang.StringgetFrameworkImplementation()Gets the name of the AE framework implementation within which the Resource executes.java.lang.StringgetImplementationName()Retrieves the name of thisResourceCreationSpecifier's implementation.ResourceMetaDatagetMetaData()Retrieves theResourceMetaDatato assign to the newly constructedResourceCreationSpecifier.ResourceManagerConfigurationgetResourceManagerConfiguration()Retrieves the Resource Manager configuration, which declares the resources that satisfy the dependencies defined bygetExternalResourceDependencies().voidsetExternalResourceDependencies(ExternalResourceDependency[] aDependencies)Sets the descriptions of thisResourceCreationSpecifier's dependencies on external resources.voidsetFrameworkImplementation(java.lang.String aFrameworkImplementation)Sets the name of the AE framework implementation within which theResourceCreationSpecifierexecutes.voidsetImplementationName(java.lang.String aImplementationName)Sets the name of thisResourceCreationSpecifier's implementation.voidsetMetaData(ResourceMetaData aMetaData)Sets the MetaData for thisResourceCreationSpecifier.voidsetResourceManagerConfiguration(ResourceManagerConfiguration aResourceManagerConfiguration)Sets the Resource Manager configuration, which declares the resources that satisfy the dependencies defined bygetExternalResourceDependencies().voidvalidate()Checks that thisResourceCreationSpecifieris valid.voidvalidate(ResourceManager aResourceManager)Checks that thisResourceCreationSpecifieris valid.-
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
-
getFrameworkImplementation
java.lang.String getFrameworkImplementation()
Gets the name of the AE framework implementation within which the Resource executes. The framework name for this implementation is given byConstants.JAVA_FRAMEWORK_NAME..- Returns:
- the framework implementation name
-
setFrameworkImplementation
void setFrameworkImplementation(java.lang.String aFrameworkImplementation)
Sets the name of the AE framework implementation within which theResourceCreationSpecifierexecutes. The framework name for this implementation is given byConstants.JAVA_FRAMEWORK_NAME..- Parameters:
aFrameworkImplementation- the framework implementation name
-
getImplementationName
java.lang.String getImplementationName()
Retrieves the name of thisResourceCreationSpecifier's implementation. This must be a fully qualified Java class name.- Returns:
- the implementation name of the CasConsumer
-
setImplementationName
void setImplementationName(java.lang.String aImplementationName)
Sets the name of thisResourceCreationSpecifier's implementation. This must be a fully qualified Java class name.- Parameters:
aImplementationName- the implementation name of the CasConsumer
-
getMetaData
ResourceMetaData getMetaData()
Retrieves theResourceMetaDatato assign to the newly constructedResourceCreationSpecifier.- Returns:
- the metadata for the new resource. This will always be modifiable.
-
setMetaData
void setMetaData(ResourceMetaData aMetaData)
Sets the MetaData for thisResourceCreationSpecifier.- Parameters:
aMetaData- metadata to assign
-
getExternalResourceDependencies
ExternalResourceDependency[] getExternalResourceDependencies()
Retrieves descriptions of thisResourceCreationSpecifier's dependencies on external resources. Each required external resource is assigned a String identifier. This is the identifier that thisResourceCreationSpecifiercan use to locate the Resource (using theAnnotatorContext.getResourceObject(String)method).- Returns:
- an array of
ExternalResourceDependencyobjects that describe this AnalysisEngine's resource dependencies.
-
setExternalResourceDependencies
void setExternalResourceDependencies(ExternalResourceDependency[] aDependencies)
Sets the descriptions of thisResourceCreationSpecifier's dependencies on external resources.- Parameters:
aDependencies- an array ofExternalResourceDependencyobjects that describe thisResourceCreationSpecifier's resource dependencies.
-
getExternalResourceDependency
ExternalResourceDependency getExternalResourceDependency(java.lang.String aKey)
Gets the external resource dependency with the given key.- Parameters:
aKey- the key of the external resource dependency to get- Returns:
- the resource dependency with the specified key,
nullif none.
-
getResourceManagerConfiguration
ResourceManagerConfiguration getResourceManagerConfiguration()
Retrieves the Resource Manager configuration, which declares the resources that satisfy the dependencies defined bygetExternalResourceDependencies().- Returns:
- the Resource Manager configuration that describes how external resource dependencies are bound to actual resources.
-
setResourceManagerConfiguration
void setResourceManagerConfiguration(ResourceManagerConfiguration aResourceManagerConfiguration)
Sets the Resource Manager configuration, which declares the resources that satisfy the dependencies defined bygetExternalResourceDependencies().- Parameters:
aResourceManagerConfiguration- the Resource Manager configuration that describes how external resource dependencies are bound to actual resources.
-
validate
void validate() throws ResourceInitializationException, ResourceConfigurationExceptionChecks that thisResourceCreationSpecifieris valid. An exception is thrown if it is not valid. This only does fairly lightweight checking. To do a more complete but more expensive check, usedoFullValidation().- Throws:
ResourceInitializationException- ifaDescis invalidResourceConfigurationException- if the configuration parameter settings inaDescare invalid
-
validate
void validate(ResourceManager aResourceManager) throws ResourceInitializationException, ResourceConfigurationException
Checks that thisResourceCreationSpecifieris valid. An exception is thrown if it is not valid. This only does fairly lightweight checking. To do a more complete but more expensive check, usedoFullValidation().- Parameters:
aResourceManager- a ResourceManager instance to use to resolve imports by name.- Throws:
ResourceInitializationException- ifaDescis invalidResourceConfigurationException- if the configuration parameter settings inaDescare invalid
-
doFullValidation
void doFullValidation() throws ResourceInitializationExceptionDoes full validation of thisResourceCreationSpecifier. This essentially performs all operations necessary to instantiate a Resource except that it does not actually instantiate the implementation class. If appropriate, this method will also attempt to create a CAS based on the descriptor, in order to do full type system verification. If any operations fail, an exception will be thrown.- Throws:
ResourceInitializationException- if validation failed
-
doFullValidation
void doFullValidation(ResourceManager aResourceManager) throws ResourceInitializationException
Does full validation of thisResourceCreationSpecifier. This essentially performs all operations necessary to instantiate a Resource except that it does not actually instantiate the implementation class. If appropriate, this method will also attempt to create a CAS based on the descriptor, in order to do full type system verification. If any operations fail, an exception will be thrown.- Parameters:
aResourceManager- a ResourceManager instance to use to load annotator classes, external resource classes, and resolve imports by name.- Throws:
ResourceInitializationException- if validation failed
-
-