Package com.saxonica.ee.config
Class MultithreadingFactory
java.lang.Object
com.saxonica.ee.config.MultithreadingFactory
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
ConstructorsConstructorDescriptionCreate aMultithreadingFactory
-
Method Summary
Modifier and TypeMethodDescriptionmakeExecutorService
(int threads) Make an ExecutorService for a given number of threadsGet an item mapping iterator suitable for multi-threaded execution.makeThread
(Runnable runnable) Make a new ThreadMake a ThreadManager for asynchronous xsl:result-document instructions
-
Constructor Details
-
MultithreadingFactory
Create aMultithreadingFactory
- Parameters:
config
- the Saxon Configuration (must be a Saxon-EE configuration)
-
-
Method Details
-
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 sequenceaction
- mapping function to be applied to each item in the input sequence.- Returns:
- an iterator over the result sequence
- Throws:
XPathException
-
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
Make an ExecutorService for a given number of threads- Parameters:
threads
- the required number of threads
-
makeThread
Make a new Thread- Parameters:
runnable
- the Runnable to be executed by the thread
-