Class TransactionLeaseRenewalConfig
java.lang.Object
org.openspaces.core.transaction.manager.TransactionLeaseRenewalConfig
Allows to configure transactions to be renewed automatically when using
AbstractJiniTransactionManager and its different sub-classes.
Will cause a transaction to be renewed each setRenewDuration(long) (which should be
lower than the transaction timeout). Defaults to 2 seconds.
Allows also to set the setRenewRTT(long) which controls the expected round trip time
to the server. Should be lower than the then the renew duration. Defaults to 1 second.
The transaction renewal also allows to configure the pool size of renewal managers that will be used to renew transactions. It defaults to 1 and under heavy load of transactions with renewals should probably be higher.
- Author:
- kimchy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets an optional renew listener to be notified on renew events.intThe pool size value of lease renewal managers (responsible for renewing transactions).longControls how often a transaction will be renewed (which should be lower than the transaction timeout).longControls the expected round trip time to the server.voidsetLeaseListener(LeaseListener leaseListener) Sets an optional renew listener to be notified on renew events.voidsetPoolSize(int poolSize) The pool size value of lease renewal managers (responsible for renewing transactions).voidsetRenewDuration(long renewDuration) Controls how often a transaction will be renewed (which should be lower than the transaction timeout).voidsetRenewRTT(long renewRTT) Controls the expected round trip time to the server.
-
Constructor Details
-
TransactionLeaseRenewalConfig
public TransactionLeaseRenewalConfig()
-
-
Method Details
-
getRenewDuration
public long getRenewDuration()Controls how often a transaction will be renewed (which should be lower than the transaction timeout). This value is set in milliseconds and defaults to 2 seconds. -
setRenewDuration
public void setRenewDuration(long renewDuration) Controls how often a transaction will be renewed (which should be lower than the transaction timeout). This value is set in milliseconds and defaults to 2 seconds. -
getRenewRTT
public long getRenewRTT()Controls the expected round trip time to the server. This value is set in milliseconds and defaults to 1 second. The value should be lower than the renew duration. -
setRenewRTT
public void setRenewRTT(long renewRTT) Controls the expected round trip time to the server. This value is set in milliseconds and defaults to 1 second. The value should be lower than the renew duration. -
getLeaseListener
Sets an optional renew listener to be notified on renew events. -
setLeaseListener
Sets an optional renew listener to be notified on renew events. -
getPoolSize
public int getPoolSize()The pool size value of lease renewal managers (responsible for renewing transactions). Defaults to 1 and under heavy load should be higher. -
setPoolSize
public void setPoolSize(int poolSize) The pool size value of lease renewal managers (responsible for renewing transactions). Defaults to 1 and under heavy load should be higher.
-