Class TransactionLeaseRenewalConfig

java.lang.Object
org.openspaces.core.transaction.manager.TransactionLeaseRenewalConfig

public class TransactionLeaseRenewalConfig extends Object
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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Sets an optional renew listener to be notified on renew events.
    int
    The pool size value of lease renewal managers (responsible for renewing transactions).
    long
    Controls how often a transaction will be renewed (which should be lower than the transaction timeout).
    long
    Controls the expected round trip time to the server.
    void
    Sets an optional renew listener to be notified on renew events.
    void
    setPoolSize(int poolSize)
    The pool size value of lease renewal managers (responsible for renewing transactions).
    void
    setRenewDuration(long renewDuration)
    Controls how often a transaction will be renewed (which should be lower than the transaction timeout).
    void
    setRenewRTT(long renewRTT)
    Controls the expected round trip time to the server.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public LeaseListener getLeaseListener()
      Sets an optional renew listener to be notified on renew events.
    • setLeaseListener

      public void setLeaseListener(LeaseListener leaseListener)
      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.