Class CpeCasProcessorsImpl
- java.lang.Object
-
- org.apache.uima.resource.metadata.impl.MetaDataObject_impl
-
- org.apache.uima.collection.impl.metadata.cpe.CpeCasProcessorsImpl
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,CpeCasProcessors,MetaDataObject,XMLizable
public class CpeCasProcessorsImpl extends MetaDataObject_impl implements CpeCasProcessors
The Class CpeCasProcessorsImpl.- See Also:
- Serialized Form
-
-
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 Modifier and Type Field Description private intcasPoolSizeThe cas pool size.private java.util.ArrayListcasProcessorsThe cas processors.private static intDEFAULT_POOL_SIZEThe Constant DEFAULT_POOL_SIZE.private booleandropCasOnExceptionThe drop cas on exception.private intinputQueueSizeThe input queue size.private intoutputQueueSizeThe output queue size.private intprocessingUnitThreadCountThe processing unit thread count.private static longserialVersionUIDThe Constant serialVersionUID.private static XmlizationInfoXMLIZATION_INFOThe Constant XMLIZATION_INFO.-
Fields inherited from class org.apache.uima.resource.metadata.impl.MetaDataObject_impl
serialContext
-
-
Constructor Summary
Constructors Constructor Description CpeCasProcessorsImpl()Instantiates a new cpe cas processors impl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCpeCasProcessor(CpeCasProcessor aCasProcessor)Appends new CasProcessor to existing list of CasProcessorsvoidaddCpeCasProcessor(CpeCasProcessor aCasProcessor, int aInsertPosition)Inserts a new CasProcessor at an indicated position.voidbuildFromXMLElement(org.w3c.dom.Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions)Overridden to read Cas Processor attributes.CpeCasProcessor[]getAllCpeCasProcessors()Returns ALLCpeCasProcessorobjects in processing pipeline.intgetCasPoolSize()intgetConcurrentPUCount()Returns number of ProcessingUnits.CpeCasProcessorgetCpeCasProcessor(int aPosition)ReturnsCpeCasProcessorfound at given position.booleangetDropCasOnException()intgetInputQueueSize()Returns size of the InputQueue.intgetOutputQueueSize()Returns the size of the OutputQueue.intgetPoolSize()Gets the pool size.protected org.xml.sax.helpers.AttributesImplgetXMLAttributes()Overridden to handle Cas Processor attributes.protected XmlizationInfogetXmlizationInfo()To be implemented by subclasses to return information describing how to represent this object in XML.booleanisDropCasOnException()Checks if is drop cas on exception.voidremoveAllCpeCasProcessors()Removes ALLCpeCasProcessorobjects from processing pipeline.voidremoveCpeCasProcessor(int aPosition)RemovesCpeCasProcessorobject from processing pipeline from a given position.CpeCasProcessor[]removeCpeCasProcessor(int aPosition, boolean flag)New API 01/06/2006.voidsetAllCpeCasProcessors(CpeCasProcessor[] aCpeProcessors)Sets the all cpe cas processors.voidsetConcurrentPUCount(int aConcurrentPUCount)Sets ProcessingUnit replication.voidsetDropCasOnException(boolean aDropCasOnException)Sets the drop cas on exception.voidsetInputQueueSize(int aInputQueueSize)Sets the size of the InputQueue.voidsetOutputQueueSize(int aOutputQueueSize)Sets the size of the OutputQueue.voidsetPoolSize(int aPoolSize)voidtoXML(org.xml.sax.ContentHandler aContentHandler, boolean aWriteDefaultNamespaceAttribute)Writes this object's XML representation by making calls on a SAXContentHandler.-
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, valueIsNullOrEmptyArray, 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
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
The Constant serialVersionUID.- See Also:
- Constant Field Values
-
DEFAULT_POOL_SIZE
private static final int DEFAULT_POOL_SIZE
The Constant DEFAULT_POOL_SIZE.- See Also:
- Constant Field Values
-
casProcessors
private java.util.ArrayList casProcessors
The cas processors.
-
dropCasOnException
private boolean dropCasOnException
The drop cas on exception.
-
casPoolSize
private int casPoolSize
The cas pool size.
-
processingUnitThreadCount
private int processingUnitThreadCount
The processing unit thread count.
-
inputQueueSize
private int inputQueueSize
The input queue size.
-
outputQueueSize
private int outputQueueSize
The output queue size.
-
XMLIZATION_INFO
private static final XmlizationInfo XMLIZATION_INFO
The Constant XMLIZATION_INFO.
-
-
Method Detail
-
setOutputQueueSize
public void setOutputQueueSize(int aOutputQueueSize) throws CpeDescriptorExceptionDescription copied from interface:CpeCasProcessorsSets the size of the OutputQueue. This queue is shared among Processing Units and CasConsumers and contains bundles of CAS. Processing Units add bundles to the queue while CasConsumers consume them. The best size for this queue is determined by overall performance of the ProcessingUnit ( how fast it deposits bundles onto the queue) and memory availability. The larger the queue the more bundles (hence memory) is used.- Specified by:
setOutputQueueSizein interfaceCpeCasProcessors- Parameters:
aOutputQueueSize- - Output queue size- Throws:
CpeDescriptorException- tbd
-
getOutputQueueSize
public int getOutputQueueSize()
Description copied from interface:CpeCasProcessorsReturns the size of the OutputQueue. This queue is shared among Processing Units and CasConsumers and contains bundles of CAS. Processing Units add bundles to the queue while CasConsumers consume them. The best size for this queue is determined by overall performance of the ProcessingUnit ( how fast it deposits bundles onto the queue) and memory availability. The larger the queue the more bundles (hence memory) is used.- Specified by:
getOutputQueueSizein interfaceCpeCasProcessors- Returns:
- - output queue size
-
setInputQueueSize
public void setInputQueueSize(int aInputQueueSize) throws CpeDescriptorExceptionDescription copied from interface:CpeCasProcessorsSets the size of the InputQueue. This queue is shared among CollectionReader and Processing Units and contains bundles of CAS. CollectionReader adds bundles to the queue while Processing Unit consume them. The best size for this queue is determined by overall performance of the ProcessingUnit ( how fast it takes bundles off the queue) and memory availability. The larger the queue the more bundles (hence memory) is used.- Specified by:
setInputQueueSizein interfaceCpeCasProcessors- Parameters:
aInputQueueSize- - queue size- Throws:
CpeDescriptorException- tbd
-
getInputQueueSize
public int getInputQueueSize()
Description copied from interface:CpeCasProcessorsReturns size of the InputQueue. This queue is shared among CollectionReader and Processing Units and contains bundles of CAS. CollectionReader adds bundles to the queue while Processing Unit consume them. The best size for this queue is determined by overall performance of the ProcessingUnit ( how fast it takes bundles off the queue) and memory availability. The larger the queue the more bundles (hence memory) is used.- Specified by:
getInputQueueSizein interfaceCpeCasProcessors- Returns:
- - queue size
-
setConcurrentPUCount
public void setConcurrentPUCount(int aConcurrentPUCount) throws CpeDescriptorExceptionDescription copied from interface:CpeCasProcessorsSets ProcessingUnit replication. Each ProcessingUnit contains the same sequence of CasProcessors and runs in a seperate thread. On platforms containing more than one CPU, replicating ProcessingUnit may result in better performance.- Specified by:
setConcurrentPUCountin interfaceCpeCasProcessors- Parameters:
aConcurrentPUCount- - number of ProcessingUnits(processing threads)- Throws:
CpeDescriptorException- tbd
-
getConcurrentPUCount
public int getConcurrentPUCount()
Description copied from interface:CpeCasProcessorsReturns number of ProcessingUnits. Each ProcessingUnit contains the same sequence of CasProcessors and runs in a seperate thread. On platforms containing more than one CPU, replicating ProcessingUnit may result in better performance.- Specified by:
getConcurrentPUCountin interfaceCpeCasProcessors- Returns:
- - number of ProcessingUnits(processing threads)
-
addCpeCasProcessor
public void addCpeCasProcessor(CpeCasProcessor aCasProcessor, int aInsertPosition) throws CpeDescriptorException
Description copied from interface:CpeCasProcessorsInserts a new CasProcessor at an indicated position.- Specified by:
addCpeCasProcessorin interfaceCpeCasProcessors- Parameters:
aCasProcessor- - CasProcessor to addaInsertPosition- - position where to insert the CasProcessor- Throws:
CpeDescriptorException- tbd
-
addCpeCasProcessor
public void addCpeCasProcessor(CpeCasProcessor aCasProcessor) throws CpeDescriptorException
Description copied from interface:CpeCasProcessorsAppends new CasProcessor to existing list of CasProcessors- Specified by:
addCpeCasProcessorin interfaceCpeCasProcessors- Parameters:
aCasProcessor- - CasProcessor to add- Throws:
CpeDescriptorException- tbd
-
getCpeCasProcessor
public CpeCasProcessor getCpeCasProcessor(int aPosition) throws CpeDescriptorException
Description copied from interface:CpeCasProcessorsReturnsCpeCasProcessorfound at given position.- Specified by:
getCpeCasProcessorin interfaceCpeCasProcessors- Parameters:
aPosition- - position of the CasProcessor- Returns:
- -
CpeCasProcessor - Throws:
CpeDescriptorException- tbd
-
getAllCpeCasProcessors
public CpeCasProcessor[] getAllCpeCasProcessors() throws CpeDescriptorException
Description copied from interface:CpeCasProcessorsReturns ALLCpeCasProcessorobjects in processing pipeline.- Specified by:
getAllCpeCasProcessorsin interfaceCpeCasProcessors- Returns:
- array of
CpeCasProcessor - Throws:
CpeDescriptorException- tbd
-
setAllCpeCasProcessors
public void setAllCpeCasProcessors(CpeCasProcessor[] aCpeProcessors) throws CpeDescriptorException
Sets the all cpe cas processors.- Parameters:
aCpeProcessors- the new all cpe cas processors- Throws:
CpeDescriptorException- the cpe descriptor exception
-
removeCpeCasProcessor
public void removeCpeCasProcessor(int aPosition) throws CpeDescriptorExceptionDescription copied from interface:CpeCasProcessorsRemovesCpeCasProcessorobject from processing pipeline from a given position.- Specified by:
removeCpeCasProcessorin interfaceCpeCasProcessors- Parameters:
aPosition- - position of the CasProcessor in the pipeline- Throws:
CpeDescriptorException- tbd
-
removeCpeCasProcessor
public CpeCasProcessor[] removeCpeCasProcessor(int aPosition, boolean flag) throws CpeDescriptorException
New API 01/06/2006.- Parameters:
aPosition- the a positionflag- the flag- Returns:
- the cpe cas processor[]
- Throws:
CpeDescriptorException- the cpe descriptor exception
-
removeAllCpeCasProcessors
public void removeAllCpeCasProcessors() throws CpeDescriptorExceptionDescription copied from interface:CpeCasProcessorsRemoves ALLCpeCasProcessorobjects from processing pipeline.- Specified by:
removeAllCpeCasProcessorsin interfaceCpeCasProcessors- Throws:
CpeDescriptorException- tbd
-
setPoolSize
public void setPoolSize(int aPoolSize) throws CpeDescriptorException- Specified by:
setPoolSizein interfaceCpeCasProcessors- Throws:
CpeDescriptorException
-
getPoolSize
public int getPoolSize() throws CpeDescriptorExceptionGets the pool size.- Returns:
- the pool size
- Throws:
CpeDescriptorException- the cpe descriptor exception
-
setDropCasOnException
public void setDropCasOnException(boolean aDropCasOnException) throws CpeDescriptorExceptionSets the drop cas on exception.- Parameters:
aDropCasOnException- the new drop cas on exception- Throws:
CpeDescriptorException- the cpe descriptor exception
-
getDropCasOnException
public boolean getDropCasOnException()
- Specified by:
getDropCasOnExceptionin interfaceCpeCasProcessors
-
buildFromXMLElement
public void buildFromXMLElement(org.w3c.dom.Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions) throws InvalidXMLExceptionOverridden to read Cas Processor 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:
MetaDataObject_impl.buildFromXMLElement(org.w3c.dom.Element, org.apache.uima.util.XMLParser, org.apache.uima.util.XMLParser.ParsingOptions)
-
toXML
public void toXML(org.xml.sax.ContentHandler aContentHandler, boolean aWriteDefaultNamespaceAttribute) throws org.xml.sax.SAXExceptionDescription copied from interface:XMLizableWrites this object's XML representation by making calls on a SAXContentHandler.- Specified by:
toXMLin interfaceXMLizable- Overrides:
toXMLin classMetaDataObject_impl- Parameters:
aContentHandler- the content handler to which this object will write events that describe its XML representation.aWriteDefaultNamespaceAttribute- whether the namespace of this element should be written as the default namespace. This should be done only for the root element, and it defaults to false.- Throws:
org.xml.sax.SAXException- pass thru- See Also:
This is called internally, also for JSon serialization If this is the first call to serialize, create a serialContext (and clean up afterwards) Other callers (e.g. JSON) must set the serialContext first before calling
-
getXMLAttributes
protected org.xml.sax.helpers.AttributesImpl getXMLAttributes()
Overridden to handle Cas Processor attributes.- Overrides:
getXMLAttributesin classMetaDataObject_impl- Returns:
- the XML attributes
- See Also:
MetaDataObject_impl.getXMLAttributes()
-
getXmlizationInfo
protected XmlizationInfo 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
-
getCasPoolSize
public int getCasPoolSize()
- Specified by:
getCasPoolSizein interfaceCpeCasProcessors
-
isDropCasOnException
public boolean isDropCasOnException()
Checks if is drop cas on exception.- Returns:
- true, if is drop cas on exception
-
-