- All Known Implementing Classes:
public interface NCLifecycleLifecycle component.
This interface defines lifecycle hooks for user-defined components that are instantiated by NLPCraft like probe components, custom NER parsers and value loaders. This hooks can be used to integrated with various IoC frameworks, control lifecycle of external libraries and systems, perform initialization and cleanup operations, etc.
Note that probe lifecycle components are configured via
nlpcraft.probe.lifecycleprobe configuration property that accept list of fully qualified class names where each class should implement this interface. See documentation on how to configure a data probe.
default void onInit()Called before lifecycle component is used and just after its creation. This method is guaranteed to be called. Default implementation is no-op.
default void onDiscard()Called after lifecycle components is no longer needed. Unlike
onInit()method this call is optional and not guaranteed. Default implementation is a no-op.