T
- a generic specifying the Saga type managed by this implementationpublic abstract static class AbstractSagaManager.Builder<T> extends Object
AbstractSagaManager
implementations.
The sagaFactory
is defaulted to a sagaType.newInstance()
call throwing a
SagaInstantiationException
if it fails, the ListenerInvocationErrorHandler
is defaulted to a
LoggingErrorHandler
and the SagaManagerSpanFactory
defaults to a
DefaultSagaManagerSpanFactory
backed by a NoOpSpanFactory
. The SagaRepository
and
sagaType
are hard requirements and as such should be provided.
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
AbstractSagaManager.Builder<T> |
listenerInvocationErrorHandler(ListenerInvocationErrorHandler listenerInvocationErrorHandler)
Sets the
ListenerInvocationErrorHandler invoked when an error occurs. |
AbstractSagaManager.Builder<T> |
sagaFactory(Supplier<T> sagaFactory)
Sets the
sagaFactory of type Supplier responsible for creating new Saga instances. |
AbstractSagaManager.Builder<T> |
sagaRepository(SagaRepository<T> sagaRepository)
Sets the
SagaRepository of generic type T used to save and load Saga instances. |
AbstractSagaManager.Builder<T> |
sagaType(Class<T> sagaType)
Sets the
sagaType as a Class managed by this instance. |
AbstractSagaManager.Builder<T> |
spanFactory(SagaManagerSpanFactory spanFactory)
Sets the
SagaManagerSpanFactory implementation to use for providing tracing capabilities. |
AbstractSagaManager.Builder<T> |
spanFactory(SpanFactory spanFactory)
Deprecated.
Use {@link #spanFactory(SagaManagerSpanFactory) instead as it provides more configuration options.
|
protected void |
validate()
Validates whether the fields contained in this Builder are set accordingly.
|
public AbstractSagaManager.Builder<T> sagaRepository(SagaRepository<T> sagaRepository)
SagaRepository
of generic type T
used to save and load Saga instances.sagaRepository
- a SagaRepository
of generic type T
used to save and load Saga instancespublic AbstractSagaManager.Builder<T> sagaType(Class<T> sagaType)
sagaType
as a Class
managed by this instance.sagaType
- the Class
specifying the type of Saga managed by this instancepublic AbstractSagaManager.Builder<T> sagaFactory(Supplier<T> sagaFactory)
sagaFactory
of type Supplier
responsible for creating new Saga instances.
Defaults to a sagaType.newInstance()
call throwing a SagaInstantiationException
if it fails.sagaFactory
- a Supplier
of Saga type T
responsible for creating new Saga instancespublic AbstractSagaManager.Builder<T> listenerInvocationErrorHandler(ListenerInvocationErrorHandler listenerInvocationErrorHandler)
ListenerInvocationErrorHandler
invoked when an error occurs. Defaults to a
LoggingErrorHandler
.listenerInvocationErrorHandler
- a ListenerInvocationErrorHandler
invoked when an error occurs@Deprecated public AbstractSagaManager.Builder<T> spanFactory(SpanFactory spanFactory)
SpanFactory
implementation to use for providing tracing capabilities. Defaults to a
NoOpSpanFactory
, which provides no tracing capabilities.spanFactory
- The SpanFactory
implementationpublic AbstractSagaManager.Builder<T> spanFactory(SagaManagerSpanFactory spanFactory)
SagaManagerSpanFactory
implementation to use for providing tracing capabilities. Defaults to
a DefaultSagaManagerSpanFactory
backed by a NoOpSpanFactory
by default, which provides no
tracing capabilities.spanFactory
- The SagaManagerSpanFactory
implementationprotected void validate() throws AxonConfigurationException
AxonConfigurationException
- if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2024. All rights reserved.