Class CheckpointingProgressStrategyFactory
- All Implemented Interfaces:
SegmentProgressStrategyFactory
SegmentProgressStrategyFactory that produces a CheckpointingProgressStrategy for every segment of a
processor whose components include one or more self-checkpointing Checkpointing units. It carries the
processor-scoped participants and the auto/deferred mode, and creates one strategy per work package.
Use detecting() to obtain the component-driven selector: given a processor's
EventHandlingComponents it inspects them for Checkpointing units (via
EventHandlingComponent.unwrap(Class)) and returns either this checkpointing factory (when any participate) or
the default token-storing factory (when none do).
Internal API. This class is marked Internal: it is part of the self-checkpointing support, intended
primarily for internal and advanced use, and its shape may change in a minor or patch release.
- Since:
- 5.3.0
- Author:
- Allard Buijze
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCheckpointingProgressStrategyFactory(List<Checkpointing> participants, boolean autoCheckpointing) Constructs aCheckpointingProgressStrategyFactoryfor the givenparticipants. -
Method Summary
Modifier and TypeMethodDescriptioncreate(SegmentProgressContext context) Creates theSegmentProgressStrategyfor the segment owning the givencontext.Returns the component-driven selector used to pick aSegmentProgressStrategyFactoryfor a processor: aCheckpointingProgressStrategyFactorywhen its components include self-checkpointingCheckpointingunits, otherwise the defaulttoken-storingfactory.
-
Constructor Details
-
CheckpointingProgressStrategyFactory
public CheckpointingProgressStrategyFactory(List<Checkpointing> participants, boolean autoCheckpointing) Constructs aCheckpointingProgressStrategyFactoryfor the givenparticipants.- Parameters:
participants- the self-checkpointing units of the processor; must not be emptyautoCheckpointing-truewhen an ordinary handler is co-located (auto mode),falsewhen every handler is self-checkpointing (fully-deferred)
-
-
Method Details
-
detecting
Returns the component-driven selector used to pick aSegmentProgressStrategyFactoryfor a processor: aCheckpointingProgressStrategyFactorywhen its components include self-checkpointingCheckpointingunits, otherwise the defaulttoken-storingfactory.A component is self-checkpointing iff it (or the POJO it wraps)
resolvesto aCheckpointingunit. The processor runs in auto mode unless every component is self-checkpointing (fully-deferred); a mixed processor is logged, since the self-checkpointing components cannot then defer the stored token.- Returns:
- a function mapping a processor's components to the appropriate progress-strategy factory
-
create
Description copied from interface:SegmentProgressStrategyFactoryCreates theSegmentProgressStrategyfor the segment owning the givencontext.The
contextis bound to a singlesegment; the returned strategy should retain it to observe and persist that segment's progress.- Specified by:
createin interfaceSegmentProgressStrategyFactory- Parameters:
context- the progress context to bind the strategy to- Returns:
- a strategy bound to
context
-