Package org.apache.nlpcraft.model
Interface NCLifecycle
-
- All Known Subinterfaces:
NCCustomParser
,NCModel
,NCValueLoader
- All Known Implementing Classes:
NCBaseTraceExporter
,NCJaegerExporter
,NCModelAdapter
,NCModelFileAdapter
,NCPrometheusExporter
,NCStackdriverStatsExporter
,NCStackdriverTraceExporter
,NCZipkinExporter
public interface NCLifecycle
NLPCraft lifecycle 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.lifecycle
probe 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.
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default void
onDiscard()
Called after lifecycle components is no longer needed.default void
onInit()
Called before lifecycle component is used and just after its creation.
-
-
-
Method Detail
-
onInit
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.
-
onDiscard
default void onDiscard()
Called after lifecycle components is no longer needed. UnlikeonInit()
method this call is optional and not guaranteed. Default implementation is a no-op.
-
-