Class TimerFlush

java.lang.Object
com.nt.udc.util.table.TimerFlush
All Implemented Interfaces:
ActionListener, EventListener

public class TimerFlush extends Object implements ActionListener
This class handles all timer related flushing functionality. Currently, this timer flushing class supports the following: - starting/stopping the timer - adding new elements to be flushed by the timer - updating elements' flush time - removing elements that would be flushed by the timer
  • Constructor Details

  • Method Details

    • startFlushTimer

      public void startFlushTimer()
      Starts the flush timer thread.
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      This method is called when the flush timer expires. This method will remove all of the expired records and write them out.
      Specified by:
      actionPerformed in interface ActionListener
    • shutdown

      public void shutdown()
      Shuts down the flushing capabilities, including the flush timer.
    • addRecords

      public void addRecords(Object[] objects)
      Adds a list of records to the flush list.
      Parameters:
      objects - Array of objects to manage.
    • resetFlushTimer

      public void resetFlushTimer(Object key)
      Reset the flush timer for a given entry in the table, as determined by the "FlushTimerSet" configuration setting.
    • addRecord

      public void addRecord(Object key)
      Adds a record to the flush timer's list of records to flush. The flush time of the given record is based off: flush time = current time + flush interval
      Parameters:
      key - Key of the record to be flushed at a later time.
    • isHealthy

      public boolean isHealthy()
      Added for Node Health support. Only checks the internal timer to see if it is healthy.
    • getConfigData

      protected void getConfigData()