public static class JpaTokenStore.Builder extends Object
JpaTokenStore
.
The claimTimeout
to a 10 seconds duration, and nodeId
is defaulted to the name of the managed
bean for the runtime system of the Java virtual machine. The EntityManagerProvider
and Serializer
are a hard requirements and as such should be provided.
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
JpaTokenStore |
build()
Initializes a
JpaTokenStore as specified through this Builder. |
JpaTokenStore.Builder |
claimTimeout(TemporalAmount claimTimeout)
Sets the
claimTimeout specifying the amount of time this process will wait after which this process
will force a claim of a TrackingToken . |
JpaTokenStore.Builder |
entityManagerProvider(EntityManagerProvider entityManagerProvider)
Sets the
EntityManagerProvider which provides the EntityManager used to access the
underlying database. |
JpaTokenStore.Builder |
loadingLockMode(javax.persistence.LockModeType loadingLockMode)
The
LockModeType to use when loading tokens from the underlying database. |
JpaTokenStore.Builder |
nodeId(String nodeId)
Sets the
nodeId to identify ownership of the tokens. |
JpaTokenStore.Builder |
serializer(Serializer serializer)
Sets the
Serializer used to de-/serialize TrackingToken s with. |
protected void |
validate()
Validates whether the fields contained in this Builder are set accordingly.
|
public JpaTokenStore.Builder entityManagerProvider(EntityManagerProvider entityManagerProvider)
EntityManagerProvider
which provides the EntityManager
used to access the
underlying database.entityManagerProvider
- a EntityManagerProvider
which provides the EntityManager
used to
access the underlying databasepublic JpaTokenStore.Builder serializer(Serializer serializer)
Serializer
used to de-/serialize TrackingToken
s with.serializer
- a Serializer
used to de-/serialize TrackingToken
s withpublic JpaTokenStore.Builder claimTimeout(TemporalAmount claimTimeout)
claimTimeout
specifying the amount of time this process will wait after which this process
will force a claim of a TrackingToken
. Thus if a claim has not been updated for the given
claimTimeout
, this process will 'steal' the claim. Defaults to a duration of 10 seconds.claimTimeout
- a timeout specifying the time after which this process will force a claimpublic JpaTokenStore.Builder nodeId(String nodeId)
nodeId
to identify ownership of the tokens. Defaults to the name of the managed bean for
the runtime system of the Java virtual machinenodeId
- the id as a String
to identify ownership of the tokenspublic JpaTokenStore.Builder loadingLockMode(javax.persistence.LockModeType loadingLockMode)
LockModeType
to use when loading tokens from the underlying database. Defaults to
LockModeType.PESSIMISTIC_WRITE
, to force a write lock, which prevents lock upgrading and potential
resulting deadlocks.loadingLockMode
- The lock mode to use when retrieving tokens from the underlying storepublic JpaTokenStore build()
JpaTokenStore
as specified through this Builder.JpaTokenStore
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.