Class NestingSpanFactory.Builder

java.lang.Object
org.axonframework.tracing.NestingSpanFactory.Builder
Enclosing class:
NestingSpanFactory

public static class NestingSpanFactory.Builder extends Object
Creates a builder that will create a NestingSpanFactory.

Requires the delegate SpanFactory to be configured.

The Clock defaults to the system utc time and the timeLimit Duration defaults to two minutes.

  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • delegate

      public NestingSpanFactory.Builder delegate(@Nonnull SpanFactory spanFactory)
      Defines the delegate SpanFactory to use, which actually provides the spans. This delegate is required for the builder to be built correctly.
      Parameters:
      spanFactory - The SpanFactory to configure for use.
      Returns:
      The current Builder instance, for fluent interfacing.
    • timeLimit

      public NestingSpanFactory.Builder timeLimit(@Nonnull Duration timeLimit)
      Configures the Duration since original publishing of an event or deadline during which it should be considered a nested span. After that duration, it will become its own separate trace.

      The time limit defaults to two minutes if not configured otherwise.

      Parameters:
      timeLimit - The amount of time before handling of an event should be considered a separate trace.
      Returns:
      The current Builder instance, for fluent interfacing.
    • clock

      public NestingSpanFactory.Builder clock(@Nonnull Clock clock)
      Configures the Clock to use when determining the time passed since publication of an event and the current time.

      The clock defaults to system utc time if not configured otherwise.

      Parameters:
      clock - The Clock to use when determining the time passed since publication of an event and the current time.
      Returns:
      The current Builder instance, for fluent interfacing.
    • build

      public NestingSpanFactory build()
      Executes the builder's configuration, creating the NestingSpanFactory.
      Returns:
      The span factory.
    • validate

      protected void validate()
      Validates whether the fields contained in this Builder are set accordingly.
      Throws:
      AxonConfigurationException - if one field is asserted to be incorrect, according to the Builder's specifications