Package com.saxonica.ee.config

## Class MultithreadingFactory

- java.lang.Object
- - com.saxonica.ee.config.MultithreadingFactory

-     public class MultithreadingFactory
      extends java.lang.Object

  This class defines a number of methods that support the use of multi-threading in Saxon. By subclassing `MultithreadingFactory` and registering the subclass with the configuration using the method `EnterpriseConfiguration.setMultithreadingFactory(MultithreadingFactory)`, it is possible to customize Saxon's multithreading behavior.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `MultithreadingFactory​(EnterpriseConfiguration config)` | Create a `MultithreadingFactory`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.util.concurrent.ExecutorService` | `makeExecutorService​(int threads)` | Make an ExecutorService for a given number of threads
    `SequenceIterator` | `makeMultithreadedItemMappingIterator​(SequenceIterator base, ItemMappingFunction action)` | Get an item mapping iterator suitable for multi-threaded execution.
    `java.lang.Thread` | `makeThread​(java.lang.Runnable runnable)` | Make a new Thread
    `XPathContextMajor.ThreadManager` | `makeThreadManager()` | Make a ThreadManager for asynchronous xsl:result-document instructions

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

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

- - ### Constructor Detail

    - #### MultithreadingFactory

          public MultithreadingFactory​(EnterpriseConfiguration config)

      Create a `MultithreadingFactory`
      Parameters:
        `config` - the Saxon Configuration (must be a Saxon-EE configuration)

  - ### Method Detail

    - #### makeMultithreadedItemMappingIterator

          public SequenceIterator makeMultithreadedItemMappingIterator​(SequenceIterator base,
                                                                       ItemMappingFunction action)
                                                                throws XPathException

      Get an item mapping iterator suitable for multi-threaded execution. The returned iterator delivers the result of applying a mapping function to each item in an input sequence. The result sequence respects the ordering of the input sequence, but the order of processing (the timing of the executions of the mapping function) is implementation-defined.
      Parameters:
        `base` - iterator over the input sequence
        `action` - mapping function to be applied to each item in the input sequence.
      Returns:
        an iterator over the result sequence
      Throws:
        `XPathException`

    - #### makeThreadManager

          public XPathContextMajor.ThreadManager makeThreadManager()

      Make a ThreadManager for asynchronous xsl:result-document instructions
      Returns:
        a new ThreadManager (or null in the case of Saxon-HE, or if multithreading is disabled)

    - #### makeExecutorService

          public java.util.concurrent.ExecutorService makeExecutorService​(int threads)

      Make an ExecutorService for a given number of threads
      Parameters:
        `threads` - the required number of threads

    - #### makeThread

          public java.lang.Thread makeThread​(java.lang.Runnable runnable)

      Make a new Thread
      Parameters:
        `runnable` - the Runnable to be executed by the thread