Class ModificationListenerAdapter

java.lang.Object
org.tentackle.session.ModificationListenerAdapter
All Implemented Interfaces:
ModificationListener

public abstract class ModificationListenerAdapter extends Object implements ModificationListener
A modification listener adapter.
Author:
harald
  • Constructor Details

    • ModificationListenerAdapter

      public ModificationListenerAdapter(String... names)
      Creates a listener for the given modification names.
      Parameters:
      names - the names, null if any modification
    • ModificationListenerAdapter

      public ModificationListenerAdapter()
      Creates a listener for any modification.
  • Method Details

    • getNames

      public String[] getNames()
      Description copied from interface: ModificationListener
      Gets the names to listen to.
      Specified by:
      getNames in interface ModificationListener
      Returns:
      the modification names, null if listen for any change
    • getPriority

      public int getPriority()
      Description copied from interface: ModificationListener
      Gets the execution priority.
      Determines the order of execution. Lower priority comes first.
      Specified by:
      getPriority in interface ModificationListener
      Returns:
      the execution priority
    • getTimeFrame

      public long getTimeFrame()
      Description copied from interface: ModificationListener
      Gets the optional execution time frame in milliseconds.
      If given, the listener will be executed at a random time within the time frame. The priority will have no effect in such a case.
      The same listener is only fired once even if the corresponding event occurs again before the listener gets invoked.
      Specified by:
      getTimeFrame in interface ModificationListener
      Returns:
      the execution time window
    • getTimeDelay

      public long getTimeDelay()
      Description copied from interface: ModificationListener
      Gets the optional delay to fire the event.
      Allows to collect events for multiple names within an interval.
      If both timeFrame and timeDelay are given, the delay is treated as an offset to the frame.
      Specified by:
      getTimeDelay in interface ModificationListener
      Returns:
      the delay in milliseconds, 0 if no delay