javadoc and debug log tweaks for ST2

This commit is contained in:
zzz
2015-04-20 13:09:48 +00:00
parent c31d6b1ac1
commit ecfb3e94c8

View File

@@ -128,8 +128,12 @@ public class SimpleTimer2 {
/**
* Queue up the given event to be fired no sooner than timeoutMs from now.
*
* @param event
* @param timeoutMs
* For transition from SimpleScheduler. Uncancellable.
* New code should use SimpleTimer2.TimedEvent.
*
* @param event to be run once
* @param timeoutMs run after this delay
* @since 0.9.20
*/
public void addEvent(final SimpleTimer.TimedEvent event, final long timeoutMs) {
if (event == null)
@@ -140,19 +144,27 @@ public class SimpleTimer2 {
public void timeReached() {
event.timeReached();
}
@Override
public String toString() {
return event.toString();
}
};
}
/**
* Schedule periodic event
*
*
* The TimedEvent must not do its own rescheduling.
* As all Exceptions are caught in run(), these will not prevent
* subsequent executions (unlike SimpleTimer, where the TimedEvent does
* its own rescheduling).
*
* For transition from SimpleScheduler. Uncancellable.
* New code should use SimpleTimer2.TimedEvent.
*
* @since 0.9.20
* @param timeoutMs run subsequent iterations of this event every timeoutMs ms
* @param timeoutMs run first and subsequent iterations of this event every timeoutMs ms
*/
public void addPeriodicEvent(final SimpleTimer.TimedEvent event, final long timeoutMs) {
addPeriodicEvent(event, timeoutMs, timeoutMs);
@@ -166,6 +178,9 @@ public class SimpleTimer2 {
* subsequent executions (unlike SimpleTimer, where the TimedEvent does
* its own rescheduling).
*
* For transition from SimpleScheduler. Uncancellable.
* New code should use SimpleTimer2.TimedEvent.
*
* @since 0.9.20
* @param delay run the first iteration of this event after delay ms
* @param timeoutMs run subsequent iterations of this event every timeoutMs ms
@@ -177,6 +192,11 @@ public class SimpleTimer2 {
public void timeReached() {
event.timeReached();
}
@Override
public String toString() {
return event.toString();
}
};
}
@@ -459,7 +479,11 @@ public class SimpleTimer2 {
" Queued: " + _executor.getQueue().size();
}
public static abstract class PeriodicTimedEvent extends TimedEvent {
/**
* For transition from SimpleScheduler.
* @since 0.9.20
*/
private static abstract class PeriodicTimedEvent extends TimedEvent {
private long _timeoutMs;
/**