#1069: Improved patch according to ticket feedback

This commit is contained in:
dev
2015-04-08 17:47:27 +00:00
parent e44fe98c7e
commit 44f8154f07
2 changed files with 6 additions and 14 deletions

View File

@ -30,7 +30,7 @@ public class SimpleScheduler {
/**
* If you have a context, use context.simpleScheduler() instead
* @deprecated in 0.9.19
* @deprecated in 0.9.20, replaced by SimpleTimer2
*/
public static SimpleScheduler getInstance() {
return I2PAppContext.getGlobalContext().simpleScheduler();
@ -47,7 +47,7 @@ public class SimpleScheduler {
/**
* To be instantiated by the context.
* Others should use context.simpleTimer() instead
* @deprecated in 0.9.19
* @deprecated in 0.9.20, replaced by SimpleTimer2
*/
public SimpleScheduler(I2PAppContext context) {
this(context, "SimpleScheduler");
@ -56,7 +56,7 @@ public class SimpleScheduler {
/**
* To be instantiated by the context.
* Others should use context.simpleTimer() instead
* @deprecated in 0.9.19
* @deprecated in 0.9.20, replaced by SimpleTimer2
*/
private SimpleScheduler(I2PAppContext context, String name) {
_log = context.logManager().getLog(SimpleScheduler.class);

View File

@ -151,12 +151,13 @@ public class SimpleTimer2 {
* subsequent executions (unlike SimpleTimer, where the TimedEvent does
* its own rescheduling).
*
* @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
*/
public void addPeriodicEvent(final SimpleTimer.TimedEvent event, final long timeoutMs) {
new PeriodicTimedEvent(SimpleTimer2.getInstance(), timeoutMs) {
new PeriodicTimedEvent(SimpleTimer2.getInstance(), timeoutMs, timeoutMs) {
@Override
public void timeReached() {
event.timeReached();
@ -172,6 +173,7 @@ public class SimpleTimer2 {
* subsequent executions (unlike SimpleTimer, where the TimedEvent does
* its own rescheduling).
*
* @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
*/
@ -467,16 +469,6 @@ public class SimpleTimer2 {
public static abstract class PeriodicTimedEvent extends TimedEvent {
private long _timeoutMs;
/**
* Schedule periodic event
*
* @param timeoutMs run subsequent iterations of this event every timeoutMs ms
*/
public PeriodicTimedEvent(SimpleTimer2 pool, long timeoutMs) {
super(pool, timeoutMs);
_timeoutMs = timeoutMs;
}
/**
* Schedule periodic event
*