Class CpeDescriptionImpl
java.lang.Object
org.apache.uima.resource.metadata.impl.MetaDataObject_impl
org.apache.uima.collection.impl.metadata.cpe.CpeDescriptionImpl
- All Implemented Interfaces:
Serializable
,Cloneable
,CpeDescription
,MetaDataObject
,XMLizable
- 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
ConstructorsConstructorDescriptionCpeDescriptionImpl
(XMLInputSource aInput) This is needed for XMLParser.parseCpeDesription() to work. -
Method Summary
Modifier and TypeMethodDescriptionaddCasInitializer
(String aInitializerDescriptorPath) Deprecated.As of v2.0, CAS Initializers are deprecated.void
addCasProcessor
(int index, CpeCasProcessor aCasProcessor) Adds a instance ofCpeCasProcessor
at a specified location in the list of CPE CasProcessors.void
addCasProcessor
(CpeCasProcessor aCasProcessor) Appends a instance ofCpeCasProcessor
to the end of the list containing CPE CasProcessors.addCollectionReader
(String aCollectionReaderPath) Adds a path to the descriptor file containing CollectionReader's configuration.void
addCollectionReader
(CpeCollectionReader aCollectionReader) Returns a list ofCpeCollectionReader
instances representing ALL defined CollectionReaders.Returns aCpeCasProcessors
instance containing processing pipeline spec.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 implementingUimaTimer
interface.Returns ResourceManagerConfiguration instance.protected XmlizationInfo
To be implemented by subclasses to return information describing how to represent this object in XML.protected void
readUnknownPropertyValueFromXMLElement
(Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions, 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
(String aCheckpointFile, int aFrequency) Add checkpoint file and frequency (in millis) of checkpointsvoid
setCpeCasProcessors
(CpeCasProcessors aCasProcessors) void
setCpeConfig
(CpeConfiguration aConfiguration) void
setCpeConfiguration
(CpeConfiguration aConfiguration) void
setCpeResourceManagerConfiguration
(CpeResourceManagerConfiguration aResMgrConfPagth) Defines the path to Resource Manager Configurationvoid
setDeployment
(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
(String aResMgrConfPagth) Defines the path to Resource Manager Configurationvoid
setStartingEntityId
(String aStartEntityId) Defines an id of the first entity to process.void
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, getAdditionalAttributes, getAttributeClass, getAttributeValue, getInfoset, getMatchingNode, getPropertyDescriptors, getPropertyXmlInfo, getRelativePathBase, getSerialContext, getSourceUrl, getSourceUrlString, getWrapperClass, getXMLAttributes, hashCode, isModifiable, listAttributes, readArrayPropertyValueFromXMLElement, readMapPropertyFromXml, readPropertyValueFromXMLElement, resolveSettings, setAttributeValue, setInfoset, setSourceUrl, setSourceUrlIfNull, toString, toXML, 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.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 Details
-
CpeDescriptionImpl
public CpeDescriptionImpl() -
CpeDescriptionImpl
This is needed for XMLParser.parseCpeDesription() to work. Typically users should use CpeDescriptorFactory.produceDescriptor() instead. - APL- Throws:
InvalidXMLException
-
-
Method Details
-
addCollectionReader
public void addCollectionReader(CpeCollectionReader aCollectionReader) throws CpeDescriptorException - Specified by:
addCollectionReader
in interfaceCpeDescription
- Throws:
CpeDescriptorException
-
addCollectionReader
public CpeCollectionReader addCollectionReader(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 interfaceCpeDescription
- Parameters:
aCollectionReaderPath
- - path to the CollectionReader descriptor. A relative path is interpreted as relative to the current working directory.- Returns:
CpeCollectionReader
- Throws:
CpeDescriptorException
- tbd
-
addCasInitializer
@Deprecated public CpeCollectionReaderCasInitializer addCasInitializer(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 interfaceCpeDescription
- Parameters:
aInitializerDescriptorPath
- - path to the CasInitializer descriptor- Returns:
CpeCollectionReaderCasInitializer
- Throws:
CpeDescriptorException
- tbd
-
getAllCollectionCollectionReaders
Description copied from interface:CpeDescription
Returns a list ofCpeCollectionReader
instances representing ALL defined CollectionReaders.- Specified by:
getAllCollectionCollectionReaders
in interfaceCpeDescription
- Returns:
- array of
CpeCollectionReader
instances. - Throws:
CpeDescriptorException
- tbd
-
setAllCollectionCollectionReaders
public void setAllCollectionCollectionReaders(CpeCollectionReader[] areaders) throws CpeDescriptorException - Specified by:
setAllCollectionCollectionReaders
in interfaceCpeDescription
- Throws:
CpeDescriptorException
-
setResourceManagerConfiguration
Description copied from interface:CpeDescription
Defines the path to Resource Manager Configuration- Specified by:
setResourceManagerConfiguration
in interfaceCpeDescription
- Parameters:
aResMgrConfPagth
- - path to Resource Manager Configuration file.
-
setCpeResourceManagerConfiguration
Description copied from interface:CpeDescription
Defines the path to Resource Manager Configuration- Specified by:
setCpeResourceManagerConfiguration
in interfaceCpeDescription
- Parameters:
aResMgrConfPagth
- - path to Resource Manager Configuration file.
-
getCpeResourceManagerConfiguration
-
setInputQueueSize
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 interfaceCpeDescription
- Parameters:
aSize
- - size of the queue- Throws:
CpeDescriptorException
- tbd
-
setProcessingUnitThreadCount
- Specified by:
setProcessingUnitThreadCount
in interfaceCpeDescription
- Parameters:
aSize
- the number of threads- Throws:
CpeDescriptorException
- tbd
-
setOutputQueueSize
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 interfaceCpeDescription
- Parameters:
aSize
- - size of the queue- Throws:
CpeDescriptorException
- tbd
-
setCpeCasProcessors
- Specified by:
setCpeCasProcessors
in interfaceCpeDescription
-
getCpeCasProcessors
Description copied from interface:CpeDescription
Returns aCpeCasProcessors
instance containing processing pipeline spec. This includes:- the size of the InputQueue
- the size of the OutputQueue
- number of processing units to create
- a list of Analysis Engines
- a list of CasConsumers
- Specified by:
getCpeCasProcessors
in interfaceCpeDescription
- Returns:
CpeCasProcessors
- Throws:
CpeDescriptorException
- tbd
-
addCasProcessor
Description copied from interface:CpeDescription
Appends a instance ofCpeCasProcessor
to the end of the list containing CPE CasProcessors. A CasProcessor can either be:- Analysis Engine
- Cas Consumer
- Specified by:
addCasProcessor
in interfaceCpeDescription
- Parameters:
aCasProcessor
- - instance ofCpeCasProcessor
to add.- Throws:
CpeDescriptorException
- tbd
-
addCasProcessor
Description copied from interface:CpeDescription
Adds a instance ofCpeCasProcessor
at a specified location in the list of CPE CasProcessors. If the index is greater than the list size, the newCpeCasProcessor
instance is appended to the list.- Specified by:
addCasProcessor
in interfaceCpeDescription
- Parameters:
index
- - insertion point for theCpeCasProcessor
aCasProcessor
- - CasProcessor to add- Throws:
CpeDescriptorException
- tbd
-
setCpeConfiguration
- Specified by:
setCpeConfiguration
in interfaceCpeDescription
-
getCpeConfiguration
Description copied from interface:CpeDescription
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. - Startup mode for the CPE (immediate, interactive, vinciService)
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 interfaceCpeDescription
- Returns:
CpeConfiguration
- Throws:
CpeDescriptorException
- tbd
-
setCpeConfig
-
getCpeConfig
- Throws:
CpeDescriptorException
-
setCheckpoint
Description copied from interface:CpeDescription
Add checkpoint file and frequency (in millis) of checkpoints- Specified by:
setCheckpoint
in interfaceCpeDescription
- Parameters:
aCheckpointFile
- - path for the checkpoint fileaFrequency
- - frequency in terms of mills for checkpoints
-
setDeployment
Description copied from interface:CpeDescription
Define startup mode for the CPE. The three supported options are:- immediate (DEFAULT), starts the CPE without user interaction
- interactive - allows to the user to control the start, stop, pause, resume of the CPE.
- vinciService - starts the CPM as a Vinci Service
- Specified by:
setDeployment
in interfaceCpeDescription
- 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 interfaceCpeDescription
- Parameters:
aEntityCount
- - entity count
-
setStartingEntityId
Description copied from interface:CpeDescription
Defines an id of the first entity to process.- Specified by:
setStartingEntityId
in interfaceCpeDescription
- Parameters:
aStartEntityId
- - entity id
-
setTimer
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 interfaceCpeDescription
- Parameters:
aTimerClass
- - name of the UimaTimer class
-
getResourceManagerConfiguration
Description copied from interface:CpeDescription
Returns ResourceManagerConfiguration instance.- Specified by:
getResourceManagerConfiguration
in interfaceCpeDescription
- Returns:
CpeResourceManagerConfiguration
-
readUnknownPropertyValueFromXMLElement
protected void readUnknownPropertyValueFromXMLElement(Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions, 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 classMetaDataObject_impl
- Parameters:
aElement
- DOM element to read fromaParser
- parser to use to construct complex valuesaOptions
- -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
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 classMetaDataObject_impl
- Returns:
- information defining this object's XML representation
-