org.apache.uima.fit.cpe

## Class CpeBuilder

- java.lang.Object
- - org.apache.uima.fit.cpe.CpeBuilder

-     public class CpeBuilder
      extends Object

  Build a Collection Processing Engine from a `CollectionReaderDescription` and a `AnalysisEngineDescription`. If an aggregate analysis engine description is used, the builder will add each child of the aggregate engine as one processor to the engine. This works only for aggregate analysis engines using a `FixedFlow`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CpeBuilder()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `CollectionProcessingEngine` | `createCpe(StatusCallbackListener aListener)`
    `CpeDescription` | `getCpeDescription()`
    `void` | `setAnalysisEngine(AnalysisEngineDescription aDesc)` Set the analysis engine used by the CPE.
    `void` | `setMaxProcessingUnitThreadCount(int aMaxProcessingUnitThreadCount)` Set the maximum number of threads the CPE may use.
    `void` | `setReader(CollectionReaderDescription aDesc)` Set the reader used by the CPE.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CpeBuilder

          public CpeBuilder()

  - ### Method Detail

    - #### setMaxProcessingUnitThreadCount

          public void setMaxProcessingUnitThreadCount(int aMaxProcessingUnitThreadCount)

      Set the maximum number of threads the CPE may use.
      Parameters:
        `aMaxProcessingUnitThreadCount` - the maximum number of threads the CPE may use.

    - #### setReader

          public void setReader(CollectionReaderDescription aDesc)
                         throws IOException,
                                SAXException,
                                CpeDescriptorException

      Set the reader used by the CPE.
      Parameters:
        `aDesc` - the reader description.
      Throws:
        `IOException` - if the descriptor cannot be written to the temporary space from where it is imported by the CPE.
        `SAXException` - if the reader descriptor cannot be serialized to XML.
        `CpeDescriptorException` - if there was a problem adding the reader to the CPE.

    - #### setAnalysisEngine

          public void setAnalysisEngine(AnalysisEngineDescription aDesc)
                                 throws IOException,
                                        SAXException,
                                        CpeDescriptorException,
                                        InvalidXMLException

      Set the analysis engine used by the CPE. If this is an aggregate analysis engine, it will be disassembled and each delegate becomes one CPE CAS processor.
      Parameters:
        `aDesc` - the analysis engine description.
      Throws:
        `IOException` - if the descriptor cannot be written to the temporary space from where it is imported by the CPE.
        `SAXException` - if the analysis engine descriptor cannot be serialized to XML.
        `CpeDescriptorException` - if there was a problem adding the analysis engine to the CPE.
        `InvalidXMLException` - if import resolution failed

    - #### getCpeDescription

          public CpeDescription getCpeDescription()

    - #### createCpe

          public CollectionProcessingEngine createCpe(StatusCallbackListener aListener)
                                               throws ResourceInitializationException,
                                                      CpeDescriptorException

      Throws:
        `ResourceInitializationException`
        `CpeDescriptorException`

Copyright © 2012–2021 The Apache Software Foundation. All rights reserved.