Interface ResetHandlerRegistry<S extends ResetHandlerRegistry<S>>
- Type Parameters:
S- The type of the registry itself, used for fluent interfacing.
- All Known Implementing Classes:
ReplayBlockingEventHandlingComponent,SimpleEventHandlingComponent
public interface ResetHandlerRegistry<S extends ResetHandlerRegistry<S>>
Registry for subscribing
ResetHandler instances.
Components implementing this interface accept reset handler subscriptions, allowing dynamic registration of reset behavior following the same pattern as event handler registration.
Example usage:
ResetHandlerRegistry registry = ...;
registry.subscribe((resetContext, context) -> {
repository.deleteAll();
return MessageStream.empty();
});
- Since:
- 5.1.0
- Author:
- Mateusz Nowak
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionsubscribe(ResetHandler resetHandler) Subscribes a reset handler to this registry.
-
Method Details
-
subscribe
Subscribes a reset handler to this registry. The handler will be invoked when a reset operation is triggered.Multiple handlers can be subscribed, and all will be invoked during reset.
- Parameters:
resetHandler- the reset handler to subscribe, must not benull- Returns:
- This registry instance for method chaining.
-