use of java.util.Timer in project jetty.project by eclipse.
the class TimerScheduler method schedule.
@Override
public Task schedule(final Runnable task, final long delay, final TimeUnit units) {
Timer timer = _timer;
if (timer == null)
throw new RejectedExecutionException("STOPPED: " + this);
SimpleTask t = new SimpleTask(task);
timer.schedule(t, units.toMillis(delay));
return t;
}
use of java.util.Timer in project jetty.project by eclipse.
the class TimerScheduler method run.
@Override
public void run() {
Timer timer = _timer;
if (timer != null) {
timer.purge();
schedule(this, 1, TimeUnit.SECONDS);
}
}
use of java.util.Timer in project zeppelin by apache.
the class ZeppelinClient method addRoutines.
private void addRoutines() {
schedulerService.add(ZeppelinHeartbeat.newInstance(this), 10, 1 * MIN);
new Timer().schedule(new java.util.TimerTask() {
@Override
public void run() {
watcherSession = openWatcherSession();
}
}, 5000);
}
use of java.util.Timer in project UltimateAndroid by cymcsg.
the class CircleProgressActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.circle_progress_activity_my);
donutProgress = (DonutProgress) findViewById(R.id.donut_progress);
circleProgress = (CircleProgress) findViewById(R.id.circle_progress);
arcProgress = (ArcProgress) findViewById(R.id.arc_progress);
timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
runOnUiThread(new Runnable() {
@Override
public void run() {
donutProgress.setProgress(donutProgress.getProgress() + 1);
circleProgress.setProgress(circleProgress.getProgress() + 1);
arcProgress.setProgress(arcProgress.getProgress() + 1);
}
});
}
}, 1000, 100);
}
use of java.util.Timer in project PlayerHater by chrisrhoden.
the class PlaylistSupportingPlayer method startWithFade.
public void startWithFade() throws IllegalStateException {
setVolume(0, 0);
start();
final Timer timer = new Timer(true);
TimerTask timerTask = new TimerTask() {
@Override
public void run() {
setVolume(mLeftVolume + 0.1f, mRightVolume + 01.f);
if (mLeftVolume >= 1.0f || mRightVolume >= 1.0f) {
timer.cancel();
timer.purge();
}
}
};
timer.schedule(timerTask, 200, 200);
}
Aggregations