- All Known Implementing Classes:
ModificationListenerAdapter
public interface ModificationListener
Listener for modifications.
Modifications are named. The names usually correspond to a database tablename, but may be any application-specific name as well.
- Author:
- harald
-
Method Summary
Modifier and TypeMethodDescriptionvoidInvoked whenever an instance of given class has changed.String[]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.
-
Method Details
-
getNames
String[] getNames()Gets the names to listen to.- Returns:
- the modification names, null if listen for any change
-
getPriority
int getPriority()Gets the execution priority.
Determines the order of execution. Lower priority comes first.- Returns:
- the execution priority
-
getTimeFrame
long getTimeFrame()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.- Returns:
- the execution time window
-
getTimeDelay
long getTimeDelay()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.- Returns:
- the delay in milliseconds, 0 if no delay
-
dataChanged
Invoked whenever an instance of given class has changed.- Parameters:
ev- the modification event
-