Class ScheduledStatisticsHolder

java.lang.Object
org.openspaces.admin.internal.statistics.ScheduledStatisticsHolder

public class ScheduledStatisticsHolder extends Object
Holds the statics monitor future and lock mechanism. Created by moran on 12/9/17.
Since:
12.3
  • Constructor Details

    • ScheduledStatisticsHolder

      public ScheduledStatisticsHolder()
  • Method Details

    • getStatisticsInterval

      public long getStatisticsInterval()
      Returns:
      the statistics interval (volatile access).
    • updateStatisticsInterval

      public void updateStatisticsInterval(long interval, TimeUnit timeUnit)
      Should be called under lock. Updates the interval.
    • getStatisticsHistorySize

      public int getStatisticsHistorySize()
      Returns:
      the statistics history size (volatile access).
    • updateStatisticsHistorySize

      public void updateStatisticsHistorySize(int statisticsHistorySize)
      Should be called under lock. Updates the history size.
    • cancelMonitor

      public void cancelMonitor(boolean mayInterruptIfRunning)
      Should be called under lock. Cancels the monitor
    • updateMonitor

      public void updateMonitor(ScheduledFuture<?> scheduledFuture)
      Should be called under lock. Updates the monitor
    • getAndIncrementRefCount

      public int getAndIncrementRefCount()
      Should be called under lock. Increments by 1 and returns the old value.
      Returns:
      the value before increment.
    • decrementAndGetRefCount

      public int decrementAndGetRefCount()
      Should be called under lock. Decrements by 1 and returns the new value.
      Returns:
      the value after decrement or zero. Never negative.
    • isMonitoring

      public boolean isMonitoring()
      Should be called under lock.
      Returns:
      true if there is a scheduled monitor present.