Package org.axonframework.eventsourcing
Class DefaultSnapshotterSpanFactory.Builder
java.lang.Object
org.axonframework.eventsourcing.DefaultSnapshotterSpanFactory.Builder
- Enclosing class:
DefaultSnapshotterSpanFactory
Builder class to instantiate a
DefaultSnapshotterSpanFactory.
The default values are:
separateTracedefaults totrueaggregateTypeInSpanNamedefaults totrue
spanFactory is a required field and should be provided.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaggregateTypeInSpanName(boolean aggregateTypeInSpanName) Whether the aggregate type should be included in the span name.build()Initializes aDefaultSnapshotterSpanFactoryas specified through this Builder.separateTrace(boolean separateTrace) Sets whether the creation of the snapshot should be represented by a separate trace.spanFactory(SpanFactory spanFactory) Sets theSpanFactoryto use to create the spans.protected voidvalidate()Validates whether the fields contained in this Builder are set accordingly.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
spanFactory
Sets theSpanFactoryto use to create the spans. This is a required field.- Parameters:
spanFactory- TheSpanFactoryto use to create the spans.- Returns:
- The current Builder instance, for fluent interfacing.
-
separateTrace
Sets whether the creation of the snapshot should be represented by a separate trace. Defaults tofalse.By default, the creation of the snapshot is part of the same trace as the scheduling of the snapshot. This happens by default in the framework as well, as snapshots are created after command invocation in the current thread. If you configure the
Snapshotterto create snapshots in a separate thread, you might want to set this totrue. The new root trace will be linked to the parent trace so it can be correlated.- Parameters:
separateTrace- Whether the creation of the snapshot should be represented by a separate trace.- Returns:
- The current Builder instance, for fluent interfacing.
-
aggregateTypeInSpanName
public DefaultSnapshotterSpanFactory.Builder aggregateTypeInSpanName(boolean aggregateTypeInSpanName) Whether the aggregate type should be included in the span name. Defaults totrue.- Parameters:
aggregateTypeInSpanName- Whether the aggregate type should be included in the span name.- Returns:
- The current Builder instance, for fluent interfacing.
-
validate
protected void validate()Validates whether the fields contained in this Builder are set accordingly. -
build
Initializes aDefaultSnapshotterSpanFactoryas specified through this Builder.- Returns:
- The
DefaultSnapshotterSpanFactoryas specified through this Builder.
-