Class CasProcessorCpeObject
java.lang.Object
org.apache.uima.resource.metadata.impl.MetaDataObject_impl
org.apache.uima.collection.impl.metadata.cpe.CasProcessorCpeObject
- All Implemented Interfaces:
Serializable,Cloneable,CpeCasProcessor,MetaDataObject,XMLizable
- Direct Known Subclasses:
CpeIntegratedCasProcessorImpl,CpeLocalCasProcessorImpl,CpeRemoteCasProcessorImpl
Base class for all CpeCasProcessor objects in the reference implementation. Provides support for
getting and setting common configuration settings shared by all CpeCasProcessor objects
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.uima.resource.metadata.impl.MetaDataObject_impl
MetaDataObject_impl.MetaDataAttr, MetaDataObject_impl.SerialContext, MetaDataObject_impl.Serializer -
Field Summary
Fields inherited from class org.apache.uima.resource.metadata.impl.MetaDataObject_impl
serialContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdds default configuration shared by CasProcessors.voidaddDeployParam(String aParamName, String aParamValue) Adds a given deployment param to the param list.voidbuildFromXMLElement(Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions) Overridden to read "name" and "value" attributes.Return action associated with CasProcessor error tolerance.Return action associated with CasProcessor restart tolerance.intReturns a batch size associated with this CasProcessor.Returns filter string associated with this CasProcessor.Gets the checkpoint.Returns configuration parameter settings for this CasProcessor.Returns theCpeComponentDescriptorinstance associated with this Cas Processor.Returns deployment type associated with this CasProcessor.Gets the deployment parameters.Returns deployment parameters for this CasProcessor.Deprecated.Doesn't support the new import syntax.ReturnsCasProcessorErrorHandlingobject containing strategies to deal with errors that may occur during processing.Gets the filter.booleanintAssociates a threshold for maximum error tolerance.intReturns error sample size.intReturns max restart tolerance for this CasProcessor.getName()Returns a name of this CasProcessor.Gets the parameters.Gets the parameter settings.Gets the run in separate process.getSOFA()Deprecated.(non-Javadoc)Gets the sofa name mappings.intReturns max millis to wait for CasProcessor response.protected AttributesImplOverridden to handle "name" and "value" attributes.protected XmlizationInfoTo be implemented by subclasses to return information describing how to represent this object in XML.voidsetActionOnMaxError(String aAction) Associates action in the event the errors exceed max tolerance.voidsetActionOnMaxRestart(String aAction) Associates action in the event CasProcessor restarts exceed max tolerance.voidsetBatchSize(int aBatchSize) Associates a batch size with this CasProcessor.voidsetCasProcessorFilter(String aFilterExpression) Associates a filter string with this CasProcessor.voidsetCasProcessorFilter(CasProcessorFilter aFilter) Sets the cas processor filter.voidsetCheckpoint(CpeCheckpoint checkpoint) Sets the checkpoint.voidSets configuration parameter settings for this CasProcessor.voidsetCpeComponentDescriptor(CpeComponentDescriptor aDescriptor) Sets theCpeComponentDescriptorinstance associated with this Cas Processor.voidsetDeployment(String aDeployMode) Associates deployment type with for this CasProcessor.voidsetDeploymentParameters(CasProcessorDeploymentParams parameters) Sets the deployment parameters.protected voidSets the deployment params.voidsetDescriptor(String aDescriptorPath) Associates a given descriptor path with this CasProcessor.voidsetErrorHandling(CasProcessorErrorHandling aErrorHandling) Sets the error handling.voidsetFilter(CasProcessorFilter aFilter) Sets the filter.voidsetIsParallelizable(boolean isP) voidsetMaxErrorCount(int aErrorCount) Associates a threshold for maximum error tolerance.voidsetMaxErrorSampleSize(int aErrorSampleSize) Associates a threshold for maximum error tolerance.voidsetMaxRestartCount(int aRestartCount) Associates max tolerance for CasProcessor restarts.voidAssociates a name with this CasProcessor.voidsetParameters(Parameter[] aparameters) Sets the parameters.voidSets the parameter settings.voidSets the run in separate process.voidDeprecated.voidsetSofaNameMappings(CpeSofaMappings mappings) Sets the sofa name mappings.voidsetTimeout(int aTimeoutValue) Associates timeout in terms of ms, with this CasProcessor.Methods inherited from class org.apache.uima.resource.metadata.impl.MetaDataObject_impl
buildFromXMLElement, clone, equals, getAdditionalAttributes, getAttributeClass, getAttributeValue, getInfoset, getMatchingNode, getPropertyDescriptors, getPropertyXmlInfo, getRelativePathBase, getSerialContext, getSourceUrl, getSourceUrlString, getWrapperClass, hashCode, isModifiable, listAttributes, readArrayPropertyValueFromXMLElement, readMapPropertyFromXml, readPropertyValueFromXMLElement, readUnknownPropertyValueFromXMLElement, resolveSettings, setAttributeValue, setInfoset, setSourceUrl, setSourceUrlIfNull, toString, toXML, toXML, toXML, toXML, valueIsNullOrEmptyArray, writeArrayPropertyAsElement, writeMapPropertyToXml, writePropertyAsElementMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.uima.resource.metadata.MetaDataObject
clone, equals, getAttributeValue, getSourceUrl, getSourceUrlString, isModifiable, listAttributes, setAttributeValue, setSourceUrl
-
Constructor Details
-
CasProcessorCpeObject
public CasProcessorCpeObject()
-
-
Method Details
-
setDeployment
Associates deployment type with for this CasProcessor. Three types are currently supported:- integrated - CasProcessor is collocated with the CPM
- local - CasProcessor runs on the same machine as the CPM however in a different process
- remote - CasProcessor runs on remote machine
- Parameters:
aDeployMode- - String identifying deployment type- Throws:
CpeDescriptorException- - if invalid deployment type is provided
-
getDeployment
Returns deployment type associated with this CasProcessor.- Specified by:
getDeploymentin interfaceCpeCasProcessor- Returns:
- String - deployment type
-
setDescriptor
Associates a given descriptor path with this CasProcessor.- Specified by:
setDescriptorin interfaceCpeCasProcessor- Parameters:
aDescriptorPath- - path to the descriptor- Throws:
CpeDescriptorException- tbd
-
getDescriptor
Deprecated.Doesn't support the new import syntax. Use getCpeComponentDescriptor().findAbsoluteUrl() instead.Returns a descriptor path associated with this CasProcessor.- Specified by:
getDescriptorin interfaceCpeCasProcessor- Returns:
- String - descriptor path
-
getCpeComponentDescriptor
Returns theCpeComponentDescriptorinstance associated with this Cas Processor. That object contains a path to the component descriptor.- Specified by:
getCpeComponentDescriptorin interfaceCpeCasProcessor- Returns:
CpeComponentDescriptorinstance
-
setCasProcessorFilter
Associates a filter string with this CasProcessor. A filter provides a mechanism that facilitates efficient routing of Cas's to the CasProcessor.- Specified by:
setCasProcessorFilterin interfaceCpeCasProcessor- Parameters:
aFilterExpression- - String containing a filter
-
getCasProcessorFilter
Returns filter string associated with this CasProcessor.- Specified by:
getCasProcessorFilterin interfaceCpeCasProcessor- Returns:
- String - a filter string
-
addDefaults
Adds default configuration shared by CasProcessors.- Throws:
CpeDescriptorException- tbd
-
setBatchSize
public void setBatchSize(int aBatchSize) Associates a batch size with this CasProcessor.- Specified by:
setBatchSizein interfaceCpeCasProcessor- Parameters:
aBatchSize- - batch size of this CasProcessor
-
getBatchSize
public int getBatchSize()Returns a batch size associated with this CasProcessor.- Specified by:
getBatchSizein interfaceCpeCasProcessor- Returns:
- - batch size as int, 0 if not defined.
-
addDeployParam
Adds a given deployment param to the param list. If a param with a given name exists in the list its value will be over-written.- Specified by:
addDeployParamin interfaceCpeCasProcessor- Parameters:
aParamName- - name of the new parameteraParamValue- - value of the new parameter- Throws:
CpeDescriptorException- tbd
-
setDeploymentParams
protected void setDeploymentParams(CasProcessorDeploymentParams aParams) throws CpeDescriptorException Sets the deployment params.- Parameters:
aParams- the new deployment params- Throws:
CpeDescriptorException- tbd
-
getDeploymentParams
Returns deployment parameters for this CasProcessor.- Specified by:
getDeploymentParamsin interfaceCpeCasProcessor- Returns:
- the deployment parameters
- See Also:
-
setName
Associates a name with this CasProcessor.- Specified by:
setNamein interfaceCpeCasProcessor- Parameters:
aName- - name as string- Throws:
CpeDescriptorException- tbd
-
getName
Returns a name of this CasProcessor.- Specified by:
getNamein interfaceCpeCasProcessor- Returns:
- - CasProcessor name as string, null if name undefined
-
setSOFA
Deprecated.Sets the sofa.- Specified by:
setSOFAin interfaceCpeCasProcessor- Parameters:
aSoFa- the new sofa- Throws:
CpeDescriptorException- tbd
-
getSOFA
Deprecated.(non-Javadoc)Gets the sofa.- Specified by:
getSOFAin interfaceCpeCasProcessor- Returns:
- the sofa
- See Also:
-
setCpeComponentDescriptor
public void setCpeComponentDescriptor(CpeComponentDescriptor aDescriptor) throws CpeDescriptorException Description copied from interface:CpeCasProcessorSets theCpeComponentDescriptorinstance associated with this Cas Processor. That object contains a path to the component descriptor.- Specified by:
setCpeComponentDescriptorin interfaceCpeCasProcessor- Parameters:
aDescriptor-CpeComponentDescriptorinstance- Throws:
CpeDescriptorException- tbd
-
setCasProcessorFilter
Sets the cas processor filter.- Parameters:
aFilter- the new cas processor filter- Throws:
CpeDescriptorException- the cpe descriptor exception
-
setErrorHandling
public void setErrorHandling(CasProcessorErrorHandling aErrorHandling) throws CpeDescriptorException Sets the error handling.- Parameters:
aErrorHandling- the new error handling- Throws:
CpeDescriptorException- the cpe descriptor exception
-
getErrorHandling
Description copied from interface:CpeCasProcessorReturnsCasProcessorErrorHandlingobject containing strategies to deal with errors that may occur during processing. This object provides the means of modifying error thresholds and actions to take when error thresholds are exceeded.- Specified by:
getErrorHandlingin interfaceCpeCasProcessor- Returns:
CasProcessorErrorHandling
-
setMaxErrorCount
public void setMaxErrorCount(int aErrorCount) Associates a threshold for maximum error tolerance. Errors are defined in terms as a quotient. For example, 4/1000 which means max 4 errors per thousand (sample size) CAS's processed. The sample size is defined seperately.- Specified by:
setMaxErrorCountin interfaceCpeCasProcessor- Parameters:
aErrorCount- - max error tolerance
-
getMaxErrorCount
public int getMaxErrorCount()Associates a threshold for maximum error tolerance. Errors are defined in terms as a quotient. For example, 4/1000 which means max 4 errors per thousand (sample size) CAS's processed. The sample size is defined seperately.- Specified by:
getMaxErrorCountin interfaceCpeCasProcessor- Returns:
- max error tolerance
-
setMaxErrorSampleSize
public void setMaxErrorSampleSize(int aErrorSampleSize) Associates a threshold for maximum error tolerance. Errors are defined in terms as a quotient. For example, 4/1000 which means max 4 errors per thousand (sample size) CAS's processed. The sample size is defined seperately.- Specified by:
setMaxErrorSampleSizein interfaceCpeCasProcessor- Parameters:
aErrorSampleSize- - max error tolerance
-
getMaxErrorSampleSize
public int getMaxErrorSampleSize()Returns error sample size. The value is used to determine the max error tolerance for this CasProcessor. Error thresholds are defines as quotients. Error Count / Sample Size for example, 3/1000, which means 3 errors per thousand.- Specified by:
getMaxErrorSampleSizein interfaceCpeCasProcessor- Returns:
- - the sample size
-
setActionOnMaxError
Associates action in the event the errors exceed max tolerance. In such case, the action determines appropriate strategy ( terminate, continue, disable).- Specified by:
setActionOnMaxErrorin interfaceCpeCasProcessor- Parameters:
aAction- - action string
-
getActionOnMaxError
Return action associated with CasProcessor error tolerance.- Specified by:
getActionOnMaxErrorin interfaceCpeCasProcessor- Returns:
- - action as string ( terminate, continue, disable), null when not defined
-
setActionOnMaxRestart
Associates action in the event CasProcessor restarts exceed max tolerance. In such case, the action determines appropriate strategy ( terminate, continue, disable).- Specified by:
setActionOnMaxRestartin interfaceCpeCasProcessor- Parameters:
aAction- - action string
-
getActionOnMaxRestart
Return action associated with CasProcessor restart tolerance.- Specified by:
getActionOnMaxRestartin interfaceCpeCasProcessor- Returns:
- - action as string ( terminate, continue, disable), null when not defined
-
setMaxRestartCount
public void setMaxRestartCount(int aRestartCount) Associates max tolerance for CasProcessor restarts.- Specified by:
setMaxRestartCountin interfaceCpeCasProcessor- Parameters:
aRestartCount- - max number of restarts
-
getMaxRestartCount
public int getMaxRestartCount()Returns max restart tolerance for this CasProcessor.- Specified by:
getMaxRestartCountin interfaceCpeCasProcessor- Returns:
- - restart count as int, 0 if not defined
-
setTimeout
public void setTimeout(int aTimeoutValue) Associates timeout in terms of ms, with this CasProcessor. It is the max number of millis to wait for response.- Specified by:
setTimeoutin interfaceCpeCasProcessor- Parameters:
aTimeoutValue- - millis to wait for response
-
getTimeout
public int getTimeout()Returns max millis to wait for CasProcessor response.- Specified by:
getTimeoutin interfaceCpeCasProcessor- Returns:
- - millis, 0 if not defined
-
setConfigurationParameterSettings
public void setConfigurationParameterSettings(CasProcessorConfigurationParameterSettings settings) throws CpeDescriptorException Sets configuration parameter settings for this CasProcessor.- Specified by:
setConfigurationParameterSettingsin interfaceCpeCasProcessor- Parameters:
settings- the new configuration parameter settings- Throws:
CpeDescriptorException- the cpe descriptor exception
-
getConfigurationParameterSettings
Returns configuration parameter settings for this CasProcessor.- Specified by:
getConfigurationParameterSettingsin interfaceCpeCasProcessor- Returns:
- the configuration parameter settings
-
setParameterSettings
Sets the parameter settings.- Parameters:
settings- the new parameter settings
-
getParameterSettings
Gets the parameter settings.- Returns:
- configuration parameter settings
-
getParameters
Gets the parameters.- Returns:
- parameters
-
getFilter
Gets the filter.- Returns:
- filter
-
setCheckpoint
Sets the checkpoint.- Parameters:
checkpoint- the new checkpoint
-
setParameters
Sets the parameters.- Parameters:
aparameters- the new parameters
-
setFilter
Sets the filter.- Parameters:
aFilter- the new filter
-
getRunInSeparateProcess
Gets the run in separate process.- Specified by:
getRunInSeparateProcessin interfaceCpeCasProcessor- Returns:
- container with configuration info for running CasProcessor in separate process
-
setRunInSeparateProcess
Sets the run in separate process.- Parameters:
process- container with configuration info for running CasProcessor in separate process
-
getDeploymentParameters
Gets the deployment parameters.- Returns:
- deployment parameters
-
setDeploymentParameters
Sets the deployment parameters.- Parameters:
parameters- deployment parameters
-
buildFromXMLElement
public void buildFromXMLElement(Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions) throws InvalidXMLException Overridden to read "name" and "value" attributes.- Specified by:
buildFromXMLElementin interfaceXMLizable- Overrides:
buildFromXMLElementin classMetaDataObject_impl- Parameters:
aElement- the a elementaParser- the a parseraOptions- the a options- Throws:
InvalidXMLException- the invalid XML exception- See Also:
-
getXMLAttributes
Overridden to handle "name" and "value" attributes.- Overrides:
getXMLAttributesin classMetaDataObject_impl- Returns:
- the XML attributes
- See Also:
-
getXmlizationInfo
Description copied from class:MetaDataObject_implTo be implemented by subclasses to return information describing how to represent this object in XML.- Specified by:
getXmlizationInfoin classMetaDataObject_impl- Returns:
- information defining this object's XML representation
-
getCheckpoint
Gets the checkpoint.- Specified by:
getCheckpointin interfaceCpeCasProcessor- Returns:
- configuration for a checkpoint
-
getSofaNameMappings
Gets the sofa name mappings.- Specified by:
getSofaNameMappingsin interfaceCpeCasProcessor- Returns:
- sofa name mappings
-
setSofaNameMappings
Sets the sofa name mappings.- Specified by:
setSofaNameMappingsin interfaceCpeCasProcessor- Parameters:
mappings- sofa name mappings
-
setIsParallelizable
public void setIsParallelizable(boolean isP) - Specified by:
setIsParallelizablein interfaceCpeCasProcessor
-
getIsParallelizable
public boolean getIsParallelizable()- Specified by:
getIsParallelizablein interfaceCpeCasProcessor
-