Interface BehaviorAnnotationExtension

All Known Implementing Classes:
ExtBehaviorAnnotationExtension

public interface BehaviorAnnotationExtension
Optional @Behavior extension covering behavior types whose implementation classes live outside agenor-runtime (CONDITIONAL, THROTTLED, BATCH, RETRY, SEQUENTIAL, PARALLEL, FSM — all in agenor-runtime-ext), discovered via ServiceLoader.

agenor-runtime's core annotation processor handles ONE_SHOT, CYCLIC, WAKER, EVENT_DRIVEN, and CUSTOM directly, with no optional-module dependency, and delegates every other BehaviorType to this extension when present. Unlike other ADR-027 SPI seams, absence of this extension is not a silent no-op: a @Behavior annotation names its required type explicitly and is always known at registration time, so using an ext-only type without agenor-runtime-ext on the classpath fails loudly with an IllegalStateException instead.

Since:
0.25.0
  • Method Details

    • supports

      boolean supports(BehaviorType type)
      Reports whether this extension can build a behavior for type.
      Parameters:
      type - the behavior type requested by a @Behavior annotation
      Returns:
      true if this extension supports type
    • createBehavior

      Behavior createBehavior(Agent agent, Method method, Behavior annotation)
      Builds the behavior for a @Behavior-annotated method whose type this extension supports(BehaviorType).
      Parameters:
      agent - the agent instance being processed; never null
      method - the annotated method; never null
      annotation - the annotation itself; never null
      Returns:
      the constructed behavior, or null if construction was skipped (e.g. a required annotation attribute was left empty)