- java.lang.Object
-
- org.tentackle.session.ModificationListenerAdapter
-
- All Implemented Interfaces:
ModificationListener
public abstract class ModificationListenerAdapter extends java.lang.Object implements ModificationListener
A modification listener adapter.- Author:
- harald
-
-
Constructor Summary
Constructors Constructor Description ModificationListenerAdapter()Creates a listener for any modification.ModificationListenerAdapter(java.lang.String... names)Creates a listener for the given modification names.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]getNames()Gets the names to listen to.intgetPriority()Gets the execution priority.
Determines the order of execution.longgetTimeDelay()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.longgetTimeFrame()Gets the optional execution time frame in milliseconds.
If given, the listener will be executed at a random time within the time frame.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.tentackle.session.ModificationListener
dataChanged
-
-
-
-
Constructor Detail
-
ModificationListenerAdapter
public ModificationListenerAdapter(java.lang.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 Detail
-
getNames
public java.lang.String[] getNames()
Description copied from interface:ModificationListenerGets the names to listen to.- Specified by:
getNamesin interfaceModificationListener- Returns:
- the modification names, null if listen for any change
-
getPriority
public int getPriority()
Description copied from interface:ModificationListenerGets the execution priority.
Determines the order of execution. Lower priority comes first.- Specified by:
getPriorityin interfaceModificationListener- Returns:
- the execution priority
-
getTimeFrame
public long getTimeFrame()
Description copied from interface:ModificationListenerGets 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:
getTimeFramein interfaceModificationListener- Returns:
- the execution time window
-
getTimeDelay
public long getTimeDelay()
Description copied from interface:ModificationListenerGets 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:
getTimeDelayin interfaceModificationListener- Returns:
- the delay in milliseconds, 0 if no delay
-
-