Package net.bytebuddy.build
Class Plugin.Engine.Dispatcher.ForParallelTransformation
java.lang.Object
net.bytebuddy.build.Plugin.Engine.Dispatcher.ForParallelTransformation
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Plugin.Engine.Dispatcher
- Direct Known Subclasses:
Plugin.Engine.Dispatcher.ForParallelTransformation.WithThrowawayExecutorService
- Enclosing interface:
Plugin.Engine.Dispatcher
public static class Plugin.Engine.Dispatcher.ForParallelTransformation
extends Object
implements Plugin.Engine.Dispatcher
A dispatcher that applies transformations within one or more threads in parallel to the default transformer.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
An eager materialization that does not defer processing after preprocessing.static class
A factory for a dispatcher that uses a given executor service for parallel dispatching.static class
A parallel dispatcher that shuts down its executor service upon completion of a plugin engine's application.Nested classes/interfaces inherited from interface net.bytebuddy.build.Plugin.Engine.Dispatcher
Plugin.Engine.Dispatcher.ForParallelTransformation, Plugin.Engine.Dispatcher.ForSerialTransformation, Plugin.Engine.Dispatcher.Materializable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
A count of deferred processings.private final Map
<TypeDescription, List<Throwable>> A mapping of all types that failed during transformation to the exceptions that explain the failure.A collection of futures that are currently scheduled.private final CompletionService
<Plugin.Engine.Dispatcher.Materializable> A completion service for all materializers.private final CompletionService
<Callable<Plugin.Engine.Dispatcher.Materializable>> A completion service for all preprocessings.private final Plugin.Engine.Target.Sink
The target sink.private final List
<TypeDescription> A list of all types that are transformed.A list of type names that could not be resolved. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ForParallelTransformation
(Executor executor, Plugin.Engine.Target.Sink sink, List<TypeDescription> transformed, Map<TypeDescription, List<Throwable>> failed, List<String> unresolved) Creates a new dispatcher that applies transformations in parallel. -
Method Summary
-
Field Details
-
sink
The target sink. -
transformed
A list of all types that are transformed. -
failed
A mapping of all types that failed during transformation to the exceptions that explain the failure. -
unresolved
A list of type names that could not be resolved. -
preprocessings
A completion service for all preprocessings. -
materializers
A completion service for all materializers. -
deferred
private int deferredA count of deferred processings. -
futures
A collection of futures that are currently scheduled.
-
-
Constructor Details
-
ForParallelTransformation
protected ForParallelTransformation(Executor executor, Plugin.Engine.Target.Sink sink, List<TypeDescription> transformed, Map<TypeDescription, List<Throwable>> failed, List<String> unresolved) Creates a new dispatcher that applies transformations in parallel.- Parameters:
executor
- The executor to delegate any work to.sink
- The target sink.transformed
- A list of all types that are transformed.failed
- A mapping of all types that failed during transformation to the exceptions that explain the failure.unresolved
- A list of type names that could not be resolved.
-
-
Method Details
-
accept
public void accept(Callable<? extends Callable<? extends Plugin.Engine.Dispatcher.Materializable>> work, boolean eager) Accepts a new work assignment.- Specified by:
accept
in interfacePlugin.Engine.Dispatcher
- Parameters:
work
- The work to handle prefixed by a preprocessing step.eager
-true
if the processing does not need to be deferred until all preprocessing is complete.
-
complete
Completes the work being handled.- Specified by:
complete
in interfacePlugin.Engine.Dispatcher
- Throws:
IOException
- If an I/O exception occurs.
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-