public static class JdbcSagaStore.Builder extends Object
JdbcSagaStore
.
The SagaSqlSchema
is defaulted to an GenericSagaSqlSchema
.
The ConnectionProvider
and Serializer
are hard requirements and as such should be
provided.
You can choose to provide a DataSource
instead of a ConnectionProvider, but in that case the used
ConnectionProvider will be a DataSourceConnectionProvider
wrapped by a UnitOfWorkAwareConnectionProviderWrapper
.
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
JdbcSagaStore |
build()
Initializes a
JdbcSagaStore as specified through this Builder. |
JdbcSagaStore.Builder |
connectionProvider(ConnectionProvider connectionProvider)
Sets the
ConnectionProvider which provides access to a JDBC connection. |
JdbcSagaStore.Builder |
dataSource(DataSource dataSource)
Sets the
ConnectionProvider by providing a DataSource . |
JdbcSagaStore.Builder |
serializer(Serializer serializer)
Sets the
Serializer used to de-/serialize a Saga instance. |
JdbcSagaStore.Builder |
sqlSchema(SagaSqlSchema sqlSchema)
Sets the
SagaSqlSchema defining the SQL operations to execute for this SagaStore
implementation. |
protected void |
validate()
Validates whether the fields contained in this Builder are set accordingly.
|
public JdbcSagaStore.Builder connectionProvider(ConnectionProvider connectionProvider)
ConnectionProvider
which provides access to a JDBC connection.connectionProvider
- a ConnectionProvider
which provides access to a JDBC connectionpublic JdbcSagaStore.Builder dataSource(DataSource dataSource)
ConnectionProvider
by providing a DataSource
. The given dataSource
in turn
will added to a DataSourceConnectionProvider
, which is wrapped by a
UnitOfWorkAwareConnectionProviderWrapper
. This will provide access to a JDBC connection for this
SagaStore
implementation.dataSource
- a DataSource
which ends up in a DataSourceConnectionProvider
, wrapped by a
UnitOfWorkAwareConnectionProviderWrapper
as the ConnectionProvider
for this
SagaStore
implementationpublic JdbcSagaStore.Builder sqlSchema(SagaSqlSchema sqlSchema)
SagaSqlSchema
defining the SQL operations to execute for this SagaStore
implementation. Defaults to a GenericSagaSqlSchema
.sqlSchema
- the SagaSqlSchema
defining the SQL operations to execute for this SagaStore
implementationpublic JdbcSagaStore.Builder serializer(Serializer serializer)
Serializer
used to de-/serialize a Saga instance.serializer
- a Serializer
used to de-/serialize a Saga instancepublic JdbcSagaStore build()
JdbcSagaStore
as specified through this Builder.JdbcSagaStore
as specified through this Builderprotected void validate() throws AxonConfigurationException
AxonConfigurationException
- if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2023. All rights reserved.