java.lang.Object
org.tentackle.session.ModificationListenerAdapter
- All Implemented Interfaces:
ModificationListener
A modification listener adapter.
- Author:
- harald
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a listener for any modification.ModificationListenerAdapter(String... names) Creates a listener for the given modification names. -
Method Summary
Modifier and TypeMethodDescriptionString[]getNames()Gets the names to listen to.intGets the execution priority.
Determines the order of execution.longGets 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.longGets 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, waitMethods inherited from interface org.tentackle.session.ModificationListener
dataChanged
-
Constructor Details
-
ModificationListenerAdapter
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
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
-