Package com.tnsai.invariants
Interface InvariantCheckerHandle
public interface InvariantCheckerHandle
SPI handle for invariant checking.
This interface defines the invariant checking contract implemented by
tnsai-quality. The concrete implementation (InvariantChecker)
is discovered via SpiLoader. ActionExecutor
uses it only for explicit @InvariantCheck
state-invariant validation. The pre/postcondition methods are available to
standalone and custom integrations; planner expressions are not runtime
dispatch gates.
When tnsai-quality is not on the classpath, the factory returns null and ActionExecutor skips optional state-invariant checking.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceFactory for creating InvariantCheckerHandle instances. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckPostcondition(Method method) Checks the postcondition of an action.voidcheckPrecondition(Method method) Checks the precondition of an action.voidChecks all @State field invariants.
-
Method Details
-
checkPrecondition
Checks the precondition of an action.- Parameters:
method- the action method- Throws:
InvariantViolationException- if precondition fails
-
checkPostcondition
Checks the postcondition of an action.- Parameters:
method- the action method- Throws:
InvariantViolationException- if postcondition fails
-
checkStateInvariants
void checkStateInvariants()Checks all @State field invariants.- Throws:
InvariantViolationException- if any state invariant fails
-