let the ContantTimer not throw exception when it's interrupted.

This commit is contained in:
Tienan Chen 2013-11-22 11:16:06 +08:00
parent cbdfede570
commit e7ab8f8027
1 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,6 @@
package org.bench4q.agent.plugin.basic;
import org.apache.log4j.Logger;
import org.bench4q.agent.plugin.Behavior;
import org.bench4q.agent.plugin.Parameter;
import org.bench4q.agent.plugin.Plugin;
@ -7,6 +8,8 @@ import org.bench4q.agent.plugin.result.TimerReturn;
@Plugin("ConstantTimer")
public class ConstantTimerPlugin {
private Logger logger = Logger.getLogger(ConstantTimerPlugin.class);
public ConstantTimerPlugin() {
}
@ -17,7 +20,7 @@ public class ConstantTimerPlugin {
Thread.sleep(time);
return new TimerReturn(true);
} catch (Exception e) {
e.printStackTrace();
logger.info("sleep interrupted!");
return new TimerReturn(false);
}
}