public abstract class NavigationProcessors
extends java.lang.Object
NavigationProcessor
s and NavigationDirectory
.Constructor and Description |
---|
NavigationProcessors() |
Modifier and Type | Method and Description |
---|---|
static <O extends AbstractOperation> |
execute(java.util.concurrent.ExecutorService executor,
NavigationProcessor<O> processor)
Executes a given
NavigationProcessor either asynchronously using ExecutorService
if the processor implements AsynchronousNavigationProcessor or sequentially. |
static <O extends AbstractOperation> |
executeAsync(java.util.concurrent.ExecutorService executor,
AsynchronousNavigationProcessor<? extends O> processor)
Executes a given
AsynchronousNavigationProcessor using ExecutorService . |
static NavigationProcessor<?> |
getNavigationProcessor(java.lang.Object navigationDirectory,
AbstractOperation operation)
Returns the
NavigationDirectory.getNavigationProcessor(messif.operations.AbstractOperation)
with type casts. |
public static NavigationProcessor<?> getNavigationProcessor(java.lang.Object navigationDirectory, AbstractOperation operation)
NavigationDirectory.getNavigationProcessor(messif.operations.AbstractOperation)
with type casts. If the navigationDirectory is not instance of NavigationDirectory
or
the operation is not compatible, null is returned.navigationDirectory
- an instance of NavigationDirectory
as plain Object
operation
- an instance of operation compatible with the NavigationDirectory
NavigationDirectory.getNavigationProcessor(messif.operations.AbstractOperation)
or null if the objects are not compatiblepublic static <O extends AbstractOperation> void executeAsync(java.util.concurrent.ExecutorService executor, AsynchronousNavigationProcessor<? extends O> processor) throws java.lang.InterruptedException, AlgorithmMethodException
AsynchronousNavigationProcessor
using ExecutorService
.
The navigation processor will be asked for all the asynchronous
processing steps
that are submitted one-by-one to the executor. One no more processing steps are available,
this method will wait for all the started processing steps to finish.
Note that the processor can block on providing additional processing steps until some currently running steps are finished.
O
- the type of operation processed by the processorexecutor
- the executor service that provides the worker threads (depends on the executor implementation)processor
- the asynchronous navigation processor that provides the processing stepsjava.lang.InterruptedException
- if the processing thread is interrupted during the processingAlgorithmMethodException
- if there was an error during the processingpublic static <O extends AbstractOperation> void execute(java.util.concurrent.ExecutorService executor, NavigationProcessor<O> processor) throws java.lang.InterruptedException, AlgorithmMethodException, java.lang.CloneNotSupportedException
NavigationProcessor
either asynchronously using ExecutorService
if the processor implements AsynchronousNavigationProcessor
or sequentially.O
- the type of operation processed by the processorexecutor
- the executor service that provides the worker threads for asynchronous executionprocessor
- the asynchronous navigation processor that provides the processing stepsjava.lang.InterruptedException
- if the processing thread is interrupted during the processingAlgorithmMethodException
- if there was an error during the processingjava.lang.CloneNotSupportedException
- if there was a need for cloning (due to asynchronous access) but cloning was not supported