Package com.documents4j.job
Class AggregatingConverter.Builder
- java.lang.Object
-
- com.documents4j.job.AggregatingConverter.Builder
-
- Enclosing class:
- AggregatingConverter
public static class AggregatingConverter.Builder extends Object
A builder for creating anAggregatingConverter.
Note: This builder is not thread safe.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AggregatingConverter.Builderaggregates(IConverter... converters)Registers the given converters for delegation for the built converter.AggregatingConverter.Builderaggregates(Collection<? extends IConverter> converters)Registers the given converters for delegation for the built converter.IAggregatingConverterbuild()Creates the specified converter.IAggregatingConverterbuild(ScheduledExecutorService executorService, long delay, TimeUnit timeUnit)Creates the specified converter and additionally registers a job to regularly investigate any aggregated converter for its functionality.AggregatingConverter.Buildercallback(IConverterFailureCallback converterFailureCallback)Registers a callback that is invoked when a converter is failing.AggregatingConverter.BuilderpropagateShutDown(boolean propagateShutDown)AggregatingConverter.BuilderselectionStrategy(ISelectionStrategy selectionStrategy)Registers a strategy for selecting one of several converters that this instance aggregates.
-
-
-
Method Detail
-
aggregates
public AggregatingConverter.Builder aggregates(IConverter... converters)
Registers the given converters for delegation for the built converter.- Parameters:
converters- The additional converters to delegate to.- Returns:
- This builder instance.
-
aggregates
public AggregatingConverter.Builder aggregates(Collection<? extends IConverter> converters)
Registers the given converters for delegation for the built converter.- Parameters:
converters- The additional converters to delegate to.- Returns:
- This builder instance.
-
callback
public AggregatingConverter.Builder callback(IConverterFailureCallback converterFailureCallback)
Registers a callback that is invoked when a converter is failing. Any previously registered callback is removed.- Parameters:
converterFailureCallback- The callback to notify over failed conversions.- Returns:
- This builder instance.
-
selectionStrategy
public AggregatingConverter.Builder selectionStrategy(ISelectionStrategy selectionStrategy)
Registers a strategy for selecting one of several converters that this instance aggregates. By default, the build converter applies a round-robin aggregation strategy.- Parameters:
selectionStrategy- The selection strategy to apply.- Returns:
- This builder instance.
-
propagateShutDown
public AggregatingConverter.Builder propagateShutDown(boolean propagateShutDown)
- Parameters:
propagateShutDown-trueif shutting down this converter should also shut down any aggregated converters.- Returns:
- This builder instance.
-
build
public IAggregatingConverter build()
Creates the specified converter.- Returns:
- The specified converter.
-
build
public IAggregatingConverter build(ScheduledExecutorService executorService, long delay, TimeUnit timeUnit)
Creates the specified converter and additionally registers a job to regularly investigate any aggregated converter for its functionality. If a converter proves to no longer be operational, it is removed as if a conversion had failed.- Parameters:
executorService- The executor service to run the regular check.delay- The delay between checks.timeUnit- The time unit of the delay.- Returns:
- The specified converter.
-
-