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

java.lang.Object
  extended by org.apache.uima.resource.metadata.impl.MetaDataObject_impl
      extended by org.apache.uima.collection.impl.metadata.cpe.CpeDescriptionImpl
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, CpeDescription, MetaDataObject, XMLizable

public class CpeDescriptionImpl
extends MetaDataObject_impl
implements CpeDescription

See Also:
Serialized Form

Constructor Summary
CpeDescriptionImpl()
           
CpeDescriptionImpl(XMLInputSource aInput)
          This is needed for XMLParser.parseCpeDesription() to work.
 
Method Summary
 CpeCollectionReaderCasInitializer addCasInitializer(java.lang.String aInitializerDescriptorPath)
          Deprecated. As of v2.0, CAS Initializers are deprecated.
 void addCasProcessor(CpeCasProcessor aCasProcessor)
          Appends a instance of CpeCasProcessor to the end of the list containing CPE CasProcessors.
 void addCasProcessor(int index, CpeCasProcessor aCasProcessor)
          Adds a instance of CpeCasProcessor at a specified location in the list of CPE CasProcessors.
 void addCollectionReader(CpeCollectionReader aCollectionReader)
           
 CpeCollectionReader addCollectionReader(java.lang.String aCollectionReaderPath)
          Adds a path to the descriptor file containing CollectionReader's configuration.
 CpeCollectionReader[] getAllCollectionCollectionReaders()
          Returns a list of CpeCollectionReader instances representing ALL defined CollectionReaders.
 CpeCasProcessors getCpeCasProcessors()
          Returns a CpeCasProcessors instance containing processing pipeline spec.
 CpeConfiguration getCpeConfig()
           
 CpeConfiguration getCpeConfiguration()
          Returns the CPE configuration that includes: An ID of the entity to begin processing with (OPTIONAL) Number of entities to process Checkpoint definition (checkpoint file, frequency) A name of the class implementing UimaTimer interface.
 CpeResourceManagerConfiguration getCpeResourceManagerConfiguration()
           
 CpeResourceManagerConfiguration getResourceManagerConfiguration()
          Returns ResourceManagerConfiguration instance.
protected  XmlizationInfo getXmlizationInfo()
          To be implemented by subclasses to return information describing how to represent this object in XML.
protected  void readUnknownPropertyValueFromXMLElement(org.w3c.dom.Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions, java.util.List aKnownPropertyNames)
          Utility method that attempts to read a property value from an XML element even though it is not known to which property the value should be assigned.
 void setAllCollectionCollectionReaders(CpeCollectionReader[] areaders)
           
 void setCheckpoint(java.lang.String aCheckpointFile, int aFrequency)
          Add checkpoint file and frequency (in millis) of checkpoints
 void setCpeCasProcessors(CpeCasProcessors aCasProcessors)
           
 void setCpeConfig(CpeConfiguration aConfiguration)
           
 void setCpeConfiguration(CpeConfiguration aConfiguration)
           
 void setCpeResourceManagerConfiguration(CpeResourceManagerConfiguration aResMgrConfPagth)
          Defines the path to Resource Manager Configuration
 void setDeployment(java.lang.String aDeployMode)
          Define startup mode for the CPE.
 void setInputQueueSize(int aSize)
          Deprecated.  
 void setNumToProcess(long aEntityCount)
          Defines number of entities to process by the CPE.
 void setOutputQueueSize(int aSize)
          Deprecated.  
 void setProcessingUnitThreadCount(int aSize)
           
 void setResourceManagerConfiguration(java.lang.String aResMgrConfPagth)
          Defines the path to Resource Manager Configuration
 void setStartingEntityId(java.lang.String aStartEntityId)
          Defines an id of the first entity to process.
 void setTimer(java.lang.String aTimerClass)
          Add name of the class that implements (@link org.apache.uima.util.UimaTimer} interface.
 
Methods inherited from class org.apache.uima.resource.metadata.impl.MetaDataObject_impl
buildFromXMLElement, buildFromXMLElement, clone, equals, getAttributeClass, getAttributeValue, getPropertyDescriptors, getPropertyXmlInfo, getRelativePathBase, getSourceUrl, getSourceUrlString, getWrapperClass, getXMLAttributes, hashCode, isModifiable, listAttributes, readArrayPropertyValueFromXMLElement, readMapPropertyFromXml, readPropertyValueFromXMLElement, 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.collection.metadata.CpeDescription
toXML
 
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
 

Constructor Detail

CpeDescriptionImpl

public CpeDescriptionImpl()

CpeDescriptionImpl

public CpeDescriptionImpl(XMLInputSource aInput)
                   throws InvalidXMLException
This is needed for XMLParser.parseCpeDesription() to work. Typically users should use CpeDescriptorFactory.produceDescriptor() instead. - APL

Throws:
InvalidXMLException
Method Detail

addCollectionReader

public void addCollectionReader(CpeCollectionReader aCollectionReader)
                         throws CpeDescriptorException
Specified by:
addCollectionReader in interface CpeDescription
Throws:
CpeDescriptorException

addCollectionReader

public CpeCollectionReader addCollectionReader(java.lang.String aCollectionReaderPath)
                                        throws CpeDescriptorException
Description copied from interface: CpeDescription
Adds a path to the descriptor file containing CollectionReader's configuration. The CPE supports only one CollectionReader instance.

This method causes the CPE descriptor to use the older <include> syntax. To use the <import> syntax, you must use CpeDescription.addCollectionReader(CpeCollectionReader) instead.

Specified by:
addCollectionReader in interface CpeDescription
Parameters:
aCollectionReaderPath - - path to the CollectionReader descriptor. A relative path is interpreted as relative to the current working directory.
Returns:
CpeCollectionReader
Throws:
CpeDescriptorException

addCasInitializer

@Deprecated
public CpeCollectionReaderCasInitializer addCasInitializer(java.lang.String aInitializerDescriptorPath)
                                                    throws CpeDescriptorException
Deprecated. As of v2.0, CAS Initializers are deprecated.

Description copied from interface: CpeDescription
Adds a path to the descriptor file containing CasInitializer's configuration.

Specified by:
addCasInitializer in interface CpeDescription
Parameters:
aInitializerDescriptorPath - - path to the CasInitializer descriptor
Returns:
CpeCollectionReaderCasInitializer
Throws:
CpeDescriptorException

getAllCollectionCollectionReaders

public CpeCollectionReader[] getAllCollectionCollectionReaders()
                                                        throws CpeDescriptorException
Description copied from interface: CpeDescription
Returns a list of CpeCollectionReader instances representing ALL defined CollectionReaders.

Specified by:
getAllCollectionCollectionReaders in interface CpeDescription
Returns:
array of CpeCollectionReader instances.
Throws:
CpeDescriptorException

setAllCollectionCollectionReaders

public void setAllCollectionCollectionReaders(CpeCollectionReader[] areaders)
                                       throws CpeDescriptorException
Specified by:
setAllCollectionCollectionReaders in interface CpeDescription
Throws:
CpeDescriptorException

setResourceManagerConfiguration

public void setResourceManagerConfiguration(java.lang.String aResMgrConfPagth)
Description copied from interface: CpeDescription
Defines the path to Resource Manager Configuration

Specified by:
setResourceManagerConfiguration in interface CpeDescription
Parameters:
aResMgrConfPagth - - path to Resource Manager Configuration file.

setCpeResourceManagerConfiguration

public void setCpeResourceManagerConfiguration(CpeResourceManagerConfiguration aResMgrConfPagth)
Description copied from interface: CpeDescription
Defines the path to Resource Manager Configuration

Specified by:
setCpeResourceManagerConfiguration in interface CpeDescription
Parameters:
aResMgrConfPagth - - path to Resource Manager Configuration file.

getCpeResourceManagerConfiguration

public CpeResourceManagerConfiguration getCpeResourceManagerConfiguration()

setInputQueueSize

@Deprecated
public void setInputQueueSize(int aSize)
                       throws CpeDescriptorException
Deprecated. 

Description copied from interface: CpeDescription
Defines the size for the InputQueue. This queue is used by the CPE to store bundles of CAS as read by a CollectionReader. The queue is shared between the CollectionReader and ProcessingUnits. The larger the size of this queue the more bundles of CAS are placed in the queue, and the more memory is consumed by the CPE. The right size for this queue depends on number of factors, like the speed of analysis and available memory.

Specified by:
setInputQueueSize in interface CpeDescription
Parameters:
aSize - - size of the queue
Throws:
CpeDescriptorException

setProcessingUnitThreadCount

public void setProcessingUnitThreadCount(int aSize)
                                  throws CpeDescriptorException
Specified by:
setProcessingUnitThreadCount in interface CpeDescription
Throws:
CpeDescriptorException

setOutputQueueSize

@Deprecated
public void setOutputQueueSize(int aSize)
                        throws CpeDescriptorException
Deprecated. 

Description copied from interface: CpeDescription
Defines the size for the OutputQueue. This queue is used by the CPE to store bundles of CAS containing results of analysis. The queue is shared between ProcessingUnits and CasConsumers. The larger the size of this queue the more bundles of CAS are placed in the queue, and the more memory is consumed by the CPE. The right size for this queue depends on number of factors, like the speed in which Cas's are consumed and available memory.

Specified by:
setOutputQueueSize in interface CpeDescription
Parameters:
aSize - - size of the queue
Throws:
CpeDescriptorException

setCpeCasProcessors

public void setCpeCasProcessors(CpeCasProcessors aCasProcessors)
Specified by:
setCpeCasProcessors in interface CpeDescription

getCpeCasProcessors

public CpeCasProcessors getCpeCasProcessors()
                                     throws CpeDescriptorException
Description copied from interface: CpeDescription
Returns a CpeCasProcessors instance containing processing pipeline spec. This includes:

Specified by:
getCpeCasProcessors in interface CpeDescription
Returns:
CpeCasProcessors
Throws:
CpeDescriptorException

addCasProcessor

public void addCasProcessor(CpeCasProcessor aCasProcessor)
                     throws CpeDescriptorException
Description copied from interface: CpeDescription
Appends a instance of CpeCasProcessor to the end of the list containing CPE CasProcessors. A CasProcessor can either be:

Specified by:
addCasProcessor in interface CpeDescription
Parameters:
aCasProcessor - - instance of CpeCasProcessor to add.
Throws:
CpeDescriptorException

addCasProcessor

public void addCasProcessor(int index,
                            CpeCasProcessor aCasProcessor)
                     throws CpeDescriptorException
Description copied from interface: CpeDescription
Adds a instance of CpeCasProcessor at a specified location in the list of CPE CasProcessors. If the index is greater than the list size, the new CpeCasProcessor instance is appended to the list.

Specified by:
addCasProcessor in interface CpeDescription
Parameters:
index - - insertion point for the CpeCasProcessor
aCasProcessor - - CasProcessor to add
Throws:
CpeDescriptorException

setCpeConfiguration

public void setCpeConfiguration(CpeConfiguration aConfiguration)
Specified by:
setCpeConfiguration in interface CpeDescription

getCpeConfiguration

public CpeConfiguration getCpeConfiguration()
                                     throws CpeDescriptorException
Description copied from interface: CpeDescription
Returns the CPE configuration that includes:

Using an instance of CpeConfiguration the client may change behavior of the CPE and corresponding to each of the elements in the above list.

Specified by:
getCpeConfiguration in interface CpeDescription
Returns:
CpeConfiguration
Throws:
CpeDescriptorException

setCpeConfig

public void setCpeConfig(CpeConfiguration aConfiguration)

getCpeConfig

public CpeConfiguration getCpeConfig()
                              throws CpeDescriptorException
Throws:
CpeDescriptorException

setCheckpoint

public void setCheckpoint(java.lang.String aCheckpointFile,
                          int aFrequency)
Description copied from interface: CpeDescription
Add checkpoint file and frequency (in millis) of checkpoints

Specified by:
setCheckpoint in interface CpeDescription
Parameters:
aCheckpointFile - - path for the checkpoint file
aFrequency - - frequency in terms of mills for checkpoints

setDeployment

public void setDeployment(java.lang.String aDeployMode)
Description copied from interface: CpeDescription
Define startup mode for the CPE. The three supported options are:

Specified by:
setDeployment in interface CpeDescription
Parameters:
aDeployMode - - CPM deployment mode

setNumToProcess

public void setNumToProcess(long aEntityCount)
Description copied from interface: CpeDescription
Defines number of entities to process by the CPE.

Specified by:
setNumToProcess in interface CpeDescription
Parameters:
aEntityCount - - entity count

setStartingEntityId

public void setStartingEntityId(java.lang.String aStartEntityId)
Description copied from interface: CpeDescription
Defines an id of the first entity to process.

Specified by:
setStartingEntityId in interface CpeDescription
Parameters:
aStartEntityId - - entity id

setTimer

public void setTimer(java.lang.String aTimerClass)
Description copied from interface: CpeDescription
Add name of the class that implements (@link org.apache.uima.util.UimaTimer} interface. This timer will be used by the CPE to time events.

Specified by:
setTimer in interface CpeDescription
Parameters:
aTimerClass - - name of the UimaTimer class

getResourceManagerConfiguration

public CpeResourceManagerConfiguration getResourceManagerConfiguration()
Description copied from interface: CpeDescription
Returns ResourceManagerConfiguration instance.

Specified by:
getResourceManagerConfiguration in interface CpeDescription
Returns:
CpeResourceManagerConfiguration

readUnknownPropertyValueFromXMLElement

protected void readUnknownPropertyValueFromXMLElement(org.w3c.dom.Element aElement,
                                                      XMLParser aParser,
                                                      XMLParser.ParsingOptions aOptions,
                                                      java.util.List aKnownPropertyNames)
                                               throws InvalidXMLException
Description copied from class: MetaDataObject_impl
Utility method that attempts to read a property value from an XML element even though it is not known to which property the value should be assigned. If an object can be constructed from the XML element, it will be assigned to any unasigned property that can accept it.

Overrides:
readUnknownPropertyValueFromXMLElement in class MetaDataObject_impl
Parameters:
aElement - DOM element to read from
aParser - parser to use to construct complex values
aKnownPropertyNames - List of propertiees that we've already values for (these values will not be overwritten)
Throws:
InvalidXMLException - if no acceptable object is described by aElement

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


Copyright © 2010 The Apache Software Foundation. All Rights Reserved.