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

java.lang.Object
  extended by org.apache.uima.resource.metadata.impl.MetaDataObject_impl
      extended by 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

See Also:
Serialized Form

Constructor Summary
CpeCasProcessorsImpl()
           
 
Method Summary
 void addCpeCasProcessor(CpeCasProcessor aCasProcessor)
          Appends new CasProcessor to existing list of CasProcessors
 void addCpeCasProcessor(CpeCasProcessor aCasProcessor, int aInsertPosition)
          Inserts a new CasProcessor at an indicated position.
 void buildFromXMLElement(org.w3c.dom.Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions)
          Overridden to read Cas Processor attributes.
 CpeCasProcessor[] getAllCpeCasProcessors()
          Returns ALL CpeCasProcessor objects in processing pipeline.
 int getCasPoolSize()
           
 int getConcurrentPUCount()
          Returns number of ProcessingUnits.
 CpeCasProcessor getCpeCasProcessor(int aPosition)
          Returns CpeCasProcessor found at given position.
 boolean getDropCasOnException()
           
 int getInputQueueSize()
          Returns size of the InputQueue.
 int getOutputQueueSize()
          Returns the size of the OutputQueue.
 int getPoolSize()
           
protected  org.xml.sax.helpers.AttributesImpl getXMLAttributes()
          Overridden to handle Cas Processor attributes.
protected  XmlizationInfo getXmlizationInfo()
          To be implemented by subclasses to return information describing how to represent this object in XML.
 boolean isDropCasOnException()
           
 void removeAllCpeCasProcessors()
          Removes ALL CpeCasProcessor objects from processing pipeline.
 void removeCpeCasProcessor(int aPosition)
          Removes CpeCasProcessor object from processing pipeline from a given position.
 CpeCasProcessor[] removeCpeCasProcessor(int aPosition, boolean flag)
          New API 01/06/2006
 void setAllCpeCasProcessors(CpeCasProcessor[] aCpeProcessors)
           
 void setConcurrentPUCount(int aConcurrentPUCount)
          Sets ProcessingUnit replication.
 void setDropCasOnException(boolean aDropCasOnException)
           
 void setInputQueueSize(int aInputQueueSize)
          Sets the size of the InputQueue.
 void setOutputQueueSize(int aOutputQueueSize)
          Sets the size of the OutputQueue.
 void setPoolSize(int aPoolSize)
           
 void toXML(org.xml.sax.ContentHandler aContentHandler, boolean aWriteDefaultNamespaceAttribute)
          Writes this object's XML representation by making calls on a SAX ContentHandler.
 
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, 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
 

Constructor Detail

CpeCasProcessorsImpl

public CpeCasProcessorsImpl()
Method Detail

setOutputQueueSize

public void setOutputQueueSize(int aOutputQueueSize)
                        throws CpeDescriptorException
Description copied from interface: CpeCasProcessors
Sets 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:
setOutputQueueSize in interface CpeCasProcessors
Parameters:
aOutputQueueSize - - Output queue size
Throws:
CpeDescriptorException

getOutputQueueSize

public int getOutputQueueSize()
Description copied from interface: CpeCasProcessors
Returns 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:
getOutputQueueSize in interface CpeCasProcessors
Returns:
- output queue size

setInputQueueSize

public void setInputQueueSize(int aInputQueueSize)
                       throws CpeDescriptorException
Description copied from interface: CpeCasProcessors
Sets 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:
setInputQueueSize in interface CpeCasProcessors
Parameters:
aInputQueueSize - - queue size
Throws:
CpeDescriptorException

getInputQueueSize

public int getInputQueueSize()
Description copied from interface: CpeCasProcessors
Returns 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:
getInputQueueSize in interface CpeCasProcessors
Returns:
- queue size

setConcurrentPUCount

public void setConcurrentPUCount(int aConcurrentPUCount)
                          throws CpeDescriptorException
Description copied from interface: CpeCasProcessors
Sets 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:
setConcurrentPUCount in interface CpeCasProcessors
Parameters:
aConcurrentPUCount - - number of ProcessingUnits(processing threads)
Throws:
CpeDescriptorException

getConcurrentPUCount

public int getConcurrentPUCount()
Description copied from interface: CpeCasProcessors
Returns 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:
getConcurrentPUCount in interface CpeCasProcessors
Returns:
- number of ProcessingUnits(processing threads)

addCpeCasProcessor

public void addCpeCasProcessor(CpeCasProcessor aCasProcessor,
                               int aInsertPosition)
                        throws CpeDescriptorException
Description copied from interface: CpeCasProcessors
Inserts a new CasProcessor at an indicated position.

Specified by:
addCpeCasProcessor in interface CpeCasProcessors
Parameters:
aCasProcessor - - CasProcessor to add
aInsertPosition - - position where to insert the CasProcessor
Throws:
CpeDescriptorException

addCpeCasProcessor

public void addCpeCasProcessor(CpeCasProcessor aCasProcessor)
                        throws CpeDescriptorException
Description copied from interface: CpeCasProcessors
Appends new CasProcessor to existing list of CasProcessors

Specified by:
addCpeCasProcessor in interface CpeCasProcessors
Parameters:
aCasProcessor - - CasProcessor to add
Throws:
CpeDescriptorException

getCpeCasProcessor

public CpeCasProcessor getCpeCasProcessor(int aPosition)
                                   throws CpeDescriptorException
Description copied from interface: CpeCasProcessors
Returns CpeCasProcessor found at given position.

Specified by:
getCpeCasProcessor in interface CpeCasProcessors
Parameters:
aPosition - - position of the CasProcessor
Returns:
- CpeCasProcessor
Throws:
CpeDescriptorException

getAllCpeCasProcessors

public CpeCasProcessor[] getAllCpeCasProcessors()
                                         throws CpeDescriptorException
Description copied from interface: CpeCasProcessors
Returns ALL CpeCasProcessor objects in processing pipeline.

Specified by:
getAllCpeCasProcessors in interface CpeCasProcessors
Returns:
array of CpeCasProcessor
Throws:
CpeDescriptorException

setAllCpeCasProcessors

public void setAllCpeCasProcessors(CpeCasProcessor[] aCpeProcessors)
                            throws CpeDescriptorException
Throws:
CpeDescriptorException

removeCpeCasProcessor

public void removeCpeCasProcessor(int aPosition)
                           throws CpeDescriptorException
Description copied from interface: CpeCasProcessors
Removes CpeCasProcessor object from processing pipeline from a given position.

Specified by:
removeCpeCasProcessor in interface CpeCasProcessors
Parameters:
aPosition - - position of the CasProcessor in the pipeline
Throws:
CpeDescriptorException

removeCpeCasProcessor

public CpeCasProcessor[] removeCpeCasProcessor(int aPosition,
                                               boolean flag)
                                        throws CpeDescriptorException
New API 01/06/2006

Throws:
CpeDescriptorException

removeAllCpeCasProcessors

public void removeAllCpeCasProcessors()
                               throws CpeDescriptorException
Description copied from interface: CpeCasProcessors
Removes ALL CpeCasProcessor objects from processing pipeline.

Specified by:
removeAllCpeCasProcessors in interface CpeCasProcessors
Throws:
CpeDescriptorException

setPoolSize

public void setPoolSize(int aPoolSize)
                 throws CpeDescriptorException
Specified by:
setPoolSize in interface CpeCasProcessors
Throws:
CpeDescriptorException

getPoolSize

public int getPoolSize()
                throws CpeDescriptorException
Throws:
CpeDescriptorException

setDropCasOnException

public void setDropCasOnException(boolean aDropCasOnException)
                           throws CpeDescriptorException
Throws:
CpeDescriptorException

getDropCasOnException

public boolean getDropCasOnException()
Specified by:
getDropCasOnException in interface CpeCasProcessors

buildFromXMLElement

public void buildFromXMLElement(org.w3c.dom.Element aElement,
                                XMLParser aParser,
                                XMLParser.ParsingOptions aOptions)
                         throws InvalidXMLException
Overridden to read Cas Processor 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)

toXML

public void toXML(org.xml.sax.ContentHandler aContentHandler,
                  boolean aWriteDefaultNamespaceAttribute)
           throws org.xml.sax.SAXException
Description copied from interface: XMLizable
Writes this object's XML representation by making calls on a SAX ContentHandler.

Specified by:
toXML in interface XMLizable
Overrides:
toXML in class MetaDataObject_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
See Also:
XMLizable.toXML(org.xml.sax.ContentHandler, boolean)

getXMLAttributes

protected org.xml.sax.helpers.AttributesImpl getXMLAttributes()
Overridden to handle Cas Processor 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

getCasPoolSize

public int getCasPoolSize()
Specified by:
getCasPoolSize in interface CpeCasProcessors

isDropCasOnException

public boolean isDropCasOnException()


Copyright © 2013. All Rights Reserved.