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 Classes Modifier and Type Class Description protected static classPlugin.Engine.Dispatcher.ForParallelTransformation.EagerWorkAn eager materialization that does not defer processing after preprocessing.static classPlugin.Engine.Dispatcher.ForParallelTransformation.FactoryA factory for a dispatcher that uses a given executor service for parallel dispatching.static classPlugin.Engine.Dispatcher.ForParallelTransformation.WithThrowawayExecutorServiceA 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
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedForParallelTransformation(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(Callable<? extends Callable<? extends Plugin.Engine.Dispatcher.Materializable>> work, boolean eager)Accepts a new work assignment.voidclose()voidcomplete()Completes the work being handled.
-
-
-
Constructor Detail
-
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 Detail
-
accept
public void accept(Callable<? extends Callable<? extends Plugin.Engine.Dispatcher.Materializable>> work, boolean eager)
Accepts a new work assignment.- Specified by:
acceptin interfacePlugin.Engine.Dispatcher- Parameters:
work- The work to handle prefixed by a preprocessing step.eager-trueif the processing does not need to be deferred until all preprocessing is complete.
-
complete
public void complete() throws IOExceptionCompletes the work being handled.- Specified by:
completein interfacePlugin.Engine.Dispatcher- Throws:
IOException- If an I/O exception occurs.
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-