org.apache.uima.collection.impl.metadata.cpe
Class CasProcessorCpeObject

java.lang.Object
  extended by org.apache.uima.resource.metadata.impl.MetaDataObject_impl
      extended by org.apache.uima.collection.impl.metadata.cpe.CasProcessorCpeObject
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, CpeCasProcessor, MetaDataObject, XMLizable
Direct Known Subclasses:
CpeIntegratedCasProcessorImpl, CpeLocalCasProcessorImpl, CpeRemoteCasProcessorImpl

public class CasProcessorCpeObject
extends MetaDataObject_impl
implements CpeCasProcessor

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:
Serialized Form

Constructor Summary
CasProcessorCpeObject()
           
 
Method Summary
protected  void addDefaults()
          Adds default configuration shared by CasProcessors
 void addDeployParam(java.lang.String aParamName, java.lang.String aParamValue)
          Adds a given deployment param to the param list.
 void buildFromXMLElement(org.w3c.dom.Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions)
          Overridden to read "name" and "value" attributes.
 java.lang.String getActionOnMaxError()
          Return action associated with CasProcessor error tolerance.
 java.lang.String getActionOnMaxRestart()
          Return action associated with CasProcessor restart tolerance.
 int getBatchSize()
          Returns a batch size associated with this CasProcessor
 java.lang.String getCasProcessorFilter()
          Returns filter string associated with this CasProcessor
 CpeCheckpoint getCheckpoint()
          Returns CpeCheckpoint object containing checkpoint configuration ( checkpoint file, frequency of checkpoints )
 CasProcessorConfigurationParameterSettings getConfigurationParameterSettings()
          Returns configuration parameter settings for this CasProcessor.
 CpeComponentDescriptor getCpeComponentDescriptor()
          Returns the CpeComponentDescriptor instance associated with this Cas Processor.
 java.lang.String getDeployment()
          Returns deployment type associated with this CasProcessor.
 CasProcessorDeploymentParams getDeploymentParameters()
           
 CasProcessorDeploymentParams getDeploymentParams()
          Returns deployment parameters for this CasProcessor.
 java.lang.String getDescriptor()
          Deprecated. Doesn't support the new import syntax. Use getCpeComponentDescriptor().findAbsoluteUrl() instead.
 CasProcessorErrorHandling getErrorHandling()
          Returns CasProcessorErrorHandling object containing strategies to deal with errors that may occur during processing.
 CasProcessorFilter getFilter()
           
 boolean getIsParallelizable()
           
 int getMaxErrorCount()
          Associates a threshold for maximum error tolerance.
 int getMaxErrorSampleSize()
          Returns error sample size.
 int getMaxRestartCount()
          Returns max restart tolerance for this CasProcessor.
 java.lang.String getName()
          Returns a name of this CasProcessor
 Parameter[] getParameters()
           
 ConfigurationParameterSettings getParameterSettings()
           
 CasProcessorRunInSeperateProcess getRunInSeparateProcess()
           
 java.lang.String getSOFA()
          Deprecated. (non-Javadoc)
 CpeSofaMappings getSofaNameMappings()
           
 int getTimeout()
          Returns max millis to wait for CasProcessor response
protected  org.xml.sax.helpers.AttributesImpl getXMLAttributes()
          Overridden to handle "name" and "value" attributes.
protected  XmlizationInfo getXmlizationInfo()
          To be implemented by subclasses to return information describing how to represent this object in XML.
 void setActionOnMaxError(java.lang.String aAction)
          Associates action in the event the errors exceed max tolerance.
 void setActionOnMaxRestart(java.lang.String aAction)
          Associates action in the event CasProcessor restarts exceed max tolerance.
 void setBatchSize(int aBatchSize)
          Associates a batch size with this CasProcessor.
 void setCasProcessorFilter(CasProcessorFilter aFilter)
           
 void setCasProcessorFilter(java.lang.String aFilterExpression)
          Associates a filter string with this CasProcessor.
 void setCheckpoint(CpeCheckpoint checkpoint)
           
 void setConfigurationParameterSettings(CasProcessorConfigurationParameterSettings settings)
          Sets configuration parameter settings for this CasProcessor.
 void setCpeComponentDescriptor(CpeComponentDescriptor aDescriptor)
          Sets the CpeComponentDescriptor instance associated with this Cas Processor.
 void setDeployment(java.lang.String aDeployMode)
          Associates deployment type with for this CasProcessor.
 void setDeploymentParameters(CasProcessorDeploymentParams parameters)
           
protected  void setDeploymentParams(CasProcessorDeploymentParams aParams)
           
 void setDescriptor(java.lang.String aDescriptorPath)
          Associates a given descriptor path with this CasProcessor
 void setErrorHandling(CasProcessorErrorHandling aErrorHandling)
           
 void setFilter(CasProcessorFilter aFilter)
           
 void setIsParallelizable(boolean isP)
           
 void setMaxErrorCount(int aErrorCount)
          Associates a threshold for maximum error tolerance.
 void setMaxErrorSampleSize(int aErrorSampleSize)
          Associates a threshold for maximum error tolerance.
 void setMaxRestartCount(int aRestartCount)
          Associates max tolerance for CasProcessor restarts.
 void setName(java.lang.String aName)
          Associates a name with this CasProcessor
 void setParameters(Parameter[] aparameters)
           
 void setParameterSettings(ConfigurationParameterSettings settings)
           
 void setRunInSeparateProcess(CasProcessorRunInSeperateProcess process)
           
 void setSOFA(java.lang.String aSoFa)
          Deprecated.  
 void setSofaNameMappings(CpeSofaMappings mappings)
           
 void setTimeout(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, getAttributeClass, getAttributeValue, getPropertyDescriptors, getPropertyXmlInfo, getRelativePathBase, getSourceUrl, getSourceUrlString, getWrapperClass, hashCode, isModifiable, listAttributes, readArrayPropertyValueFromXMLElement, readMapPropertyFromXml, readPropertyValueFromXMLElement, readUnknownPropertyValueFromXMLElement, setAttributeValue, setSourceUrl, setSourceUrlIfNull, toString, toXML, toXML, toXML, toXML, writeArrayPropertyAsElement, writeMapPropertyToXml, writePropertyAsElement
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
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, toXML, toXML, toXML, toXML
 

Constructor Detail

CasProcessorCpeObject

public CasProcessorCpeObject()
Method Detail

setDeployment

public void setDeployment(java.lang.String aDeployMode)
                   throws CpeDescriptorException
Associates deployment type with for this CasProcessor. Three types are currently supported:

Parameters:
aDeployMode - - String identifying deployment type
Throws:
CpeDescriptorException - - if invalid deployment type is provided

getDeployment

public java.lang.String getDeployment()
Returns deployment type associated with this CasProcessor.

Specified by:
getDeployment in interface CpeCasProcessor
Returns:
String - deployment type

setDescriptor

public void setDescriptor(java.lang.String aDescriptorPath)
                   throws CpeDescriptorException
Associates a given descriptor path with this CasProcessor

Specified by:
setDescriptor in interface CpeCasProcessor
Parameters:
aDescriptorPath - - path to the descriptor
Throws:
CpeDescriptorException

getDescriptor

@Deprecated
public java.lang.String getDescriptor()
Deprecated. Doesn't support the new import syntax. Use getCpeComponentDescriptor().findAbsoluteUrl() instead.

Returns a descriptor path associated with this CasProcessor

Specified by:
getDescriptor in interface CpeCasProcessor
Returns:
String - descriptor path

getCpeComponentDescriptor

public CpeComponentDescriptor getCpeComponentDescriptor()
Returns the CpeComponentDescriptor instance associated with this Cas Processor. That object contains a path to the component descriptor.

Specified by:
getCpeComponentDescriptor in interface CpeCasProcessor
Returns:
CpeComponentDescriptor instance

setCasProcessorFilter

public void setCasProcessorFilter(java.lang.String aFilterExpression)
Associates a filter string with this CasProcessor. A filter provides a mechanism that facilitates efficient routing of Cas's to the CasProcessor.

Specified by:
setCasProcessorFilter in interface CpeCasProcessor
Parameters:
aFilterExpression - - String containing a filter

getCasProcessorFilter

public java.lang.String getCasProcessorFilter()
Returns filter string associated with this CasProcessor

Specified by:
getCasProcessorFilter in interface CpeCasProcessor
Returns:
String - a filter string

addDefaults

protected void addDefaults()
                    throws CpeDescriptorException
Adds default configuration shared by CasProcessors

Throws:
CpeDescriptorException

setBatchSize

public void setBatchSize(int aBatchSize)
Associates a batch size with this CasProcessor.

Specified by:
setBatchSize in interface CpeCasProcessor
Parameters:
aBatchSize - - batch size of this CasProcessor

getBatchSize

public int getBatchSize()
Returns a batch size associated with this CasProcessor

Specified by:
getBatchSize in interface CpeCasProcessor
Returns:
- batch size as int, 0 if not defined.

addDeployParam

public void addDeployParam(java.lang.String aParamName,
                           java.lang.String aParamValue)
                    throws CpeDescriptorException
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:
addDeployParam in interface CpeCasProcessor
Parameters:
aParamName - - name of the new parameter
aParamValue - - value of the new parameter
Throws:
CpeDescriptorException

setDeploymentParams

protected void setDeploymentParams(CasProcessorDeploymentParams aParams)
                            throws CpeDescriptorException
Parameters:
aParams -
Throws:
CpeDescriptorException

getDeploymentParams

public CasProcessorDeploymentParams getDeploymentParams()
Returns deployment parameters for this CasProcessor.

Specified by:
getDeploymentParams in interface CpeCasProcessor
Returns:
See Also:
instance

setName

public void setName(java.lang.String aName)
             throws CpeDescriptorException
Associates a name with this CasProcessor

Specified by:
setName in interface CpeCasProcessor
Parameters:
aName - - name as string
Throws:
CpeDescriptorException

getName

public java.lang.String getName()
Returns a name of this CasProcessor

Specified by:
getName in interface CpeCasProcessor
Returns:
- CasProcessor name as string, null if name undefined

setSOFA

@Deprecated
public void setSOFA(java.lang.String aSoFa)
             throws CpeDescriptorException
Deprecated. 

Specified by:
setSOFA in interface CpeCasProcessor
Parameters:
aSoFa -
Throws:
CpeDescriptorException

getSOFA

@Deprecated
public java.lang.String getSOFA()
Deprecated. (non-Javadoc)

Specified by:
getSOFA in interface CpeCasProcessor
See Also:
CpeCasProcessor.getSOFA()

setCpeComponentDescriptor

public void setCpeComponentDescriptor(CpeComponentDescriptor aDescriptor)
                               throws CpeDescriptorException
Description copied from interface: CpeCasProcessor
Sets the CpeComponentDescriptor instance associated with this Cas Processor. That object contains a path to the component descriptor.

Specified by:
setCpeComponentDescriptor in interface CpeCasProcessor
Parameters:
aDescriptor - CpeComponentDescriptor instance
Throws:
CpeDescriptorException

setCasProcessorFilter

public void setCasProcessorFilter(CasProcessorFilter aFilter)
                           throws CpeDescriptorException
Throws:
CpeDescriptorException

setErrorHandling

public void setErrorHandling(CasProcessorErrorHandling aErrorHandling)
                      throws CpeDescriptorException
Throws:
CpeDescriptorException

getErrorHandling

public CasProcessorErrorHandling getErrorHandling()
Description copied from interface: CpeCasProcessor
Returns CasProcessorErrorHandling object 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:
getErrorHandling in interface CpeCasProcessor
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:
setMaxErrorCount in interface CpeCasProcessor
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:
getMaxErrorCount in interface CpeCasProcessor
Parameters:
aErrorCount - - max error tolerance
Returns:
- max error threshold

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:
setMaxErrorSampleSize in interface CpeCasProcessor
Parameters:
aErrorCount - - 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:
getMaxErrorSampleSize in interface CpeCasProcessor
Returns:
- the sample size

setActionOnMaxError

public void setActionOnMaxError(java.lang.String aAction)
Associates action in the event the errors exceed max tolerance. In such case, the action determines appropriate strategy ( terminate, continue, disable).

Specified by:
setActionOnMaxError in interface CpeCasProcessor
Parameters:
aAction - - action string

getActionOnMaxError

public java.lang.String getActionOnMaxError()
Return action associated with CasProcessor error tolerance.

Specified by:
getActionOnMaxError in interface CpeCasProcessor
Returns:
- action as string ( terminate, continue, disable), null when not defined

setActionOnMaxRestart

public void setActionOnMaxRestart(java.lang.String aAction)
Associates action in the event CasProcessor restarts exceed max tolerance. In such case, the action determines appropriate strategy ( terminate, continue, disable).

Specified by:
setActionOnMaxRestart in interface CpeCasProcessor
Parameters:
aAction - - action string

getActionOnMaxRestart

public java.lang.String getActionOnMaxRestart()
Return action associated with CasProcessor restart tolerance.

Specified by:
getActionOnMaxRestart in interface CpeCasProcessor
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:
setMaxRestartCount in interface CpeCasProcessor
Parameters:
aRestartCount - - max number of restarts

getMaxRestartCount

public int getMaxRestartCount()
Returns max restart tolerance for this CasProcessor.

Specified by:
getMaxRestartCount in interface CpeCasProcessor
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:
setTimeout in interface CpeCasProcessor
Parameters:
aTimeoutValue - - millis to wait for response

getTimeout

public int getTimeout()
Returns max millis to wait for CasProcessor response

Specified by:
getTimeout in interface CpeCasProcessor
Returns:
- millis, 0 if not defined

setConfigurationParameterSettings

public void setConfigurationParameterSettings(CasProcessorConfigurationParameterSettings settings)
                                       throws CpeDescriptorException
Sets configuration parameter settings for this CasProcessor.

Specified by:
setConfigurationParameterSettings in interface CpeCasProcessor
Parameters:
settings - object containing parameter setting overrides
Throws:
CpeDescriptorException

getConfigurationParameterSettings

public CasProcessorConfigurationParameterSettings getConfigurationParameterSettings()
Returns configuration parameter settings for this CasProcessor.

Specified by:
getConfigurationParameterSettings in interface CpeCasProcessor
Returns:
- object containing parameter setting overrides

setParameterSettings

public void setParameterSettings(ConfigurationParameterSettings settings)
Parameters:
settings -

getParameterSettings

public ConfigurationParameterSettings getParameterSettings()
Parameters:
settings -

getParameters

public Parameter[] getParameters()
Returns:

getFilter

public CasProcessorFilter getFilter()
Returns:

setCheckpoint

public void setCheckpoint(CpeCheckpoint checkpoint)
Parameters:
checkpoint -

setParameters

public void setParameters(Parameter[] aparameters)
Parameters:
parameters -

setFilter

public void setFilter(CasProcessorFilter aFilter)
Parameters:
string -

getRunInSeparateProcess

public CasProcessorRunInSeperateProcess getRunInSeparateProcess()
Specified by:
getRunInSeparateProcess in interface CpeCasProcessor
Returns:

setRunInSeparateProcess

public void setRunInSeparateProcess(CasProcessorRunInSeperateProcess process)
Parameters:
process -

getDeploymentParameters

public CasProcessorDeploymentParams getDeploymentParameters()
Returns:

setDeploymentParameters

public void setDeploymentParameters(CasProcessorDeploymentParams parameters)
Parameters:
parameters -

buildFromXMLElement

public void buildFromXMLElement(org.w3c.dom.Element aElement,
                                XMLParser aParser,
                                XMLParser.ParsingOptions aOptions)
                         throws InvalidXMLException
Overridden to read "name" and "value" attributes.

Specified by:
buildFromXMLElement in interface XMLizable
Overrides:
buildFromXMLElement in class MetaDataObject_impl
Parameters:
aElement - the XML element that represents this object.
aParser - a reference to the UIMA XMLParser. The XMLParser.buildObject(Element) method can be used to construct sub-objects.
aOptions - option settings
Throws:
InvalidXMLException - if the input XML element does not specify a valid object
See Also:
MetaDataObject_impl.buildFromXMLElement(org.w3c.dom.Element, org.apache.uima.util.XMLParser, org.apache.uima.util.XMLParser.ParsingOptions)

getXMLAttributes

protected org.xml.sax.helpers.AttributesImpl getXMLAttributes()
Overridden to handle "name" and "value" attributes.

Overrides:
getXMLAttributes in class MetaDataObject_impl
Returns:
an object defining the attributes to be written to the XML
See Also:
MetaDataObject_impl.getXMLAttributes()

getXmlizationInfo

protected XmlizationInfo getXmlizationInfo()
Description copied from class: MetaDataObject_impl
To be implemented by subclasses to return information describing how to represent this object in XML.

Specified by:
getXmlizationInfo in class MetaDataObject_impl
Returns:
information defining this object's XML representation

getCheckpoint

public CpeCheckpoint getCheckpoint()
Description copied from interface: CpeCasProcessor
Returns CpeCheckpoint object containing checkpoint configuration ( checkpoint file, frequency of checkpoints )

Specified by:
getCheckpoint in interface CpeCasProcessor
Returns:

getSofaNameMappings

public CpeSofaMappings getSofaNameMappings()
Specified by:
getSofaNameMappings in interface CpeCasProcessor
Returns:

setSofaNameMappings

public void setSofaNameMappings(CpeSofaMappings mappings)
Specified by:
setSofaNameMappings in interface CpeCasProcessor
Parameters:
mappings -

setIsParallelizable

public void setIsParallelizable(boolean isP)
Specified by:
setIsParallelizable in interface CpeCasProcessor

getIsParallelizable

public boolean getIsParallelizable()
Specified by:
getIsParallelizable in interface CpeCasProcessor


Copyright © 2013. All Rights Reserved.