public static class JpaTokenStore.Builder extends Object
JpaTokenStore
.
The claimTimeout
to a 10 seconds duration, and the nodeId
is defaulted to the
ManagementFactory#getRuntimeMXBean#getName
output. 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 |
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
ManagementFactory#getRuntimeMXBean#getName
output as the node id.nodeId
- the id as a String
to identify ownership of the tokenspublic 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–2018. All rights reserved.