Class CpeDescriptionImpl
- java.lang.Object
-
- org.apache.uima.resource.metadata.impl.MetaDataObject_impl
-
- 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
The Class CpeDescriptionImpl.- 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 CpeCasProcessorscasProcessorsThe cas processors.private CpeCollectionReadercollectionReaderThe collection reader.private CpeConfigurationcpeConfigurationThe cpe configuration.private CpeResourceManagerConfigurationresourceMgrConfigThe resource mgr config.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 CpeDescriptionImpl()Instantiates a new cpe description impl.CpeDescriptionImpl(XMLInputSource aInput)Instantiates a new cpe description impl.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CpeCollectionReaderCasInitializeraddCasInitializer(java.lang.String aInitializerDescriptorPath)Deprecated.As of v2.0, CAS Initializers are deprecated.voidaddCasProcessor(int index, CpeCasProcessor aCasProcessor)Adds a instance ofCpeCasProcessorat a specified location in the list of CPE CasProcessors.voidaddCasProcessor(CpeCasProcessor aCasProcessor)Appends a instance ofCpeCasProcessorto the end of the list containing CPE CasProcessors.CpeCollectionReaderaddCollectionReader(java.lang.String aCollectionReaderPath)Adds a path to the descriptor file containing CollectionReader's configuration.voidaddCollectionReader(CpeCollectionReader aCollectionReader)CpeCollectionReader[]getAllCollectionCollectionReaders()Returns a list ofCpeCollectionReaderinstances representing ALL defined CollectionReaders.CpeCasProcessorsgetCpeCasProcessors()Returns aCpeCasProcessorsinstance containing processing pipeline spec.CpeConfigurationgetCpeConfig()Gets the cpe config.CpeConfigurationgetCpeConfiguration()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 implementingUimaTimerinterface.CpeResourceManagerConfigurationgetCpeResourceManagerConfiguration()Gets the cpe resource manager configuration.CpeResourceManagerConfigurationgetResourceManagerConfiguration()Returns ResourceManagerConfiguration instance.protected XmlizationInfogetXmlizationInfo()To be implemented by subclasses to return information describing how to represent this object in XML.protected voidreadUnknownPropertyValueFromXMLElement(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.voidsetAllCollectionCollectionReaders(CpeCollectionReader[] areaders)voidsetCheckpoint(java.lang.String aCheckpointFile, int aFrequency)Add checkpoint file and frequency (in millis) of checkpointsvoidsetCpeCasProcessors(CpeCasProcessors aCasProcessors)voidsetCpeConfig(CpeConfiguration aConfiguration)Sets the cpe config.voidsetCpeConfiguration(CpeConfiguration aConfiguration)voidsetCpeResourceManagerConfiguration(CpeResourceManagerConfiguration aResMgrConfPagth)Defines the path to Resource Manager ConfigurationvoidsetDeployment(java.lang.String aDeployMode)Define startup mode for the CPE.voidsetInputQueueSize(int aSize)Deprecated.voidsetNumToProcess(long aEntityCount)Defines number of entities to process by the CPE.voidsetOutputQueueSize(int aSize)Deprecated.voidsetProcessingUnitThreadCount(int aSize)voidsetResourceManagerConfiguration(java.lang.String aResMgrConfPagth)Defines the path to Resource Manager ConfigurationvoidsetStartingEntityId(java.lang.String aStartEntityId)Defines an id of the first entity to process.voidsetTimer(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, 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
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
The Constant serialVersionUID.- See Also:
- Constant Field Values
-
collectionReader
private CpeCollectionReader collectionReader
The collection reader.
-
casProcessors
private CpeCasProcessors casProcessors
The cas processors.
-
cpeConfiguration
private CpeConfiguration cpeConfiguration
The cpe configuration.
-
resourceMgrConfig
private CpeResourceManagerConfiguration resourceMgrConfig
The resource mgr config.
-
XMLIZATION_INFO
private static final XmlizationInfo XMLIZATION_INFO
The Constant XMLIZATION_INFO.
-
-
Constructor Detail
-
CpeDescriptionImpl
public CpeDescriptionImpl()
Instantiates a new cpe description impl.
-
CpeDescriptionImpl
public CpeDescriptionImpl(XMLInputSource aInput) throws InvalidXMLException
Instantiates a new cpe description impl.- Parameters:
aInput- the a input- Throws:
InvalidXMLException- the invalid XML exception
-
-
Method Detail
-
addCollectionReader
public void addCollectionReader(CpeCollectionReader aCollectionReader) throws CpeDescriptorException
- Specified by:
addCollectionReaderin interfaceCpeDescription- Throws:
CpeDescriptorException
-
addCollectionReader
public CpeCollectionReader addCollectionReader(java.lang.String aCollectionReaderPath) throws CpeDescriptorException
Description copied from interface:CpeDescriptionAdds 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:
addCollectionReaderin 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(java.lang.String aInitializerDescriptorPath) throws CpeDescriptorException
Deprecated.As of v2.0, CAS Initializers are deprecated.Adds the cas initializer.- Specified by:
addCasInitializerin interfaceCpeDescription- Parameters:
aInitializerDescriptorPath- the a initializer descriptor path- Returns:
- the cpe collection reader cas initializer
- Throws:
CpeDescriptorException- the cpe descriptor exception
-
getAllCollectionCollectionReaders
public CpeCollectionReader[] getAllCollectionCollectionReaders() throws CpeDescriptorException
Description copied from interface:CpeDescriptionReturns a list ofCpeCollectionReaderinstances representing ALL defined CollectionReaders.- Specified by:
getAllCollectionCollectionReadersin interfaceCpeDescription- Returns:
- array of
CpeCollectionReaderinstances. - Throws:
CpeDescriptorException- tbd
-
setAllCollectionCollectionReaders
public void setAllCollectionCollectionReaders(CpeCollectionReader[] areaders) throws CpeDescriptorException
- Specified by:
setAllCollectionCollectionReadersin interfaceCpeDescription- Throws:
CpeDescriptorException
-
setResourceManagerConfiguration
public void setResourceManagerConfiguration(java.lang.String aResMgrConfPagth)
Description copied from interface:CpeDescriptionDefines the path to Resource Manager Configuration- Specified by:
setResourceManagerConfigurationin interfaceCpeDescription- Parameters:
aResMgrConfPagth- - path to Resource Manager Configuration file.
-
setCpeResourceManagerConfiguration
public void setCpeResourceManagerConfiguration(CpeResourceManagerConfiguration aResMgrConfPagth)
Description copied from interface:CpeDescriptionDefines the path to Resource Manager Configuration- Specified by:
setCpeResourceManagerConfigurationin interfaceCpeDescription- Parameters:
aResMgrConfPagth- - path to Resource Manager Configuration file.
-
getCpeResourceManagerConfiguration
public CpeResourceManagerConfiguration getCpeResourceManagerConfiguration()
Gets the cpe resource manager configuration.- Returns:
- the cpe resource manager configuration
-
setInputQueueSize
@Deprecated public void setInputQueueSize(int aSize) throws CpeDescriptorExceptionDeprecated.Sets the input queue size.- Specified by:
setInputQueueSizein interfaceCpeDescription- Parameters:
aSize- the new input queue size- Throws:
CpeDescriptorException- the cpe descriptor exception
-
setProcessingUnitThreadCount
public void setProcessingUnitThreadCount(int aSize) throws CpeDescriptorException- Specified by:
setProcessingUnitThreadCountin interfaceCpeDescription- Parameters:
aSize- the number of threads- Throws:
CpeDescriptorException- tbd
-
setOutputQueueSize
@Deprecated public void setOutputQueueSize(int aSize) throws CpeDescriptorExceptionDeprecated.Sets the output queue size.- Specified by:
setOutputQueueSizein interfaceCpeDescription- Parameters:
aSize- the new output queue size- Throws:
CpeDescriptorException- the cpe descriptor exception
-
setCpeCasProcessors
public void setCpeCasProcessors(CpeCasProcessors aCasProcessors)
- Specified by:
setCpeCasProcessorsin interfaceCpeDescription
-
getCpeCasProcessors
public CpeCasProcessors getCpeCasProcessors() throws CpeDescriptorException
Description copied from interface:CpeDescriptionReturns aCpeCasProcessorsinstance 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:
getCpeCasProcessorsin interfaceCpeDescription- Returns:
CpeCasProcessors- Throws:
CpeDescriptorException- tbd
-
addCasProcessor
public void addCasProcessor(CpeCasProcessor aCasProcessor) throws CpeDescriptorException
Description copied from interface:CpeDescriptionAppends a instance ofCpeCasProcessorto the end of the list containing CPE CasProcessors. A CasProcessor can either be:- Analysis Engine
- Cas Consumer
- Specified by:
addCasProcessorin interfaceCpeDescription- Parameters:
aCasProcessor- - instance ofCpeCasProcessorto add.- Throws:
CpeDescriptorException- tbd
-
addCasProcessor
public void addCasProcessor(int index, CpeCasProcessor aCasProcessor) throws CpeDescriptorExceptionDescription copied from interface:CpeDescriptionAdds a instance ofCpeCasProcessorat a specified location in the list of CPE CasProcessors. If the index is greater than the list size, the newCpeCasProcessorinstance is appended to the list.- Specified by:
addCasProcessorin interfaceCpeDescription- Parameters:
index- - insertion point for theCpeCasProcessoraCasProcessor- - CasProcessor to add- Throws:
CpeDescriptorException- tbd
-
setCpeConfiguration
public void setCpeConfiguration(CpeConfiguration aConfiguration)
- Specified by:
setCpeConfigurationin interfaceCpeDescription
-
getCpeConfiguration
public CpeConfiguration getCpeConfiguration() throws CpeDescriptorException
Description copied from interface:CpeDescriptionReturns 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
UimaTimerinterface. - Startup mode for the CPE (immediate, interactive, vinciService)
Using an instance of
CpeConfigurationthe client may change behavior of the CPE and corresponding to each of the elements in the above list.- Specified by:
getCpeConfigurationin interfaceCpeDescription- Returns:
CpeConfiguration- Throws:
CpeDescriptorException- tbd
-
setCpeConfig
public void setCpeConfig(CpeConfiguration aConfiguration)
Sets the cpe config.- Parameters:
aConfiguration- the new cpe config
-
getCpeConfig
public CpeConfiguration getCpeConfig() throws CpeDescriptorException
Gets the cpe config.- Returns:
- the cpe config
- Throws:
CpeDescriptorException- the cpe descriptor exception
-
setCheckpoint
public void setCheckpoint(java.lang.String aCheckpointFile, int aFrequency)Description copied from interface:CpeDescriptionAdd checkpoint file and frequency (in millis) of checkpoints- Specified by:
setCheckpointin interfaceCpeDescription- Parameters:
aCheckpointFile- - path for the checkpoint fileaFrequency- - frequency in terms of mills for checkpoints
-
setDeployment
public void setDeployment(java.lang.String aDeployMode)
Description copied from interface:CpeDescriptionDefine 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:
setDeploymentin interfaceCpeDescription- Parameters:
aDeployMode- - CPM deployment mode
-
setNumToProcess
public void setNumToProcess(long aEntityCount)
Description copied from interface:CpeDescriptionDefines number of entities to process by the CPE.- Specified by:
setNumToProcessin interfaceCpeDescription- Parameters:
aEntityCount- - entity count
-
setStartingEntityId
public void setStartingEntityId(java.lang.String aStartEntityId)
Description copied from interface:CpeDescriptionDefines an id of the first entity to process.- Specified by:
setStartingEntityIdin interfaceCpeDescription- Parameters:
aStartEntityId- - entity id
-
setTimer
public void setTimer(java.lang.String aTimerClass)
Description copied from interface:CpeDescriptionAdd 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:
setTimerin interfaceCpeDescription- Parameters:
aTimerClass- - name of the UimaTimer class
-
getResourceManagerConfiguration
public CpeResourceManagerConfiguration getResourceManagerConfiguration()
Description copied from interface:CpeDescriptionReturns ResourceManagerConfiguration instance.- Specified by:
getResourceManagerConfigurationin interfaceCpeDescription- Returns:
CpeResourceManagerConfiguration
-
readUnknownPropertyValueFromXMLElement
protected void readUnknownPropertyValueFromXMLElement(org.w3c.dom.Element aElement, XMLParser aParser, XMLParser.ParsingOptions aOptions, java.util.List aKnownPropertyNames) throws InvalidXMLExceptionDescription copied from class:MetaDataObject_implUtility 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:
readUnknownPropertyValueFromXMLElementin 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
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
-
-