diff options
Diffstat (limited to 'plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/TimerControl.java')
-rw-r--r-- | plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/TimerControl.java | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/TimerControl.java b/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/TimerControl.java deleted file mode 100644 index 7d76924a5da..00000000000 --- a/plugins/org.eclipse.osee.ote.core/src/org/eclipse/osee/ote/core/environment/TimerControl.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2007 Boeing. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Boeing - initial API and implementation - *******************************************************************************/ -package org.eclipse.osee.ote.core.environment; - -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.ScheduledFuture; -import java.util.concurrent.TimeUnit; - -import org.eclipse.osee.ote.core.environment.interfaces.BasicTimeout; -import org.eclipse.osee.ote.core.environment.interfaces.ITimeout; -import org.eclipse.osee.ote.core.environment.interfaces.ITimerControl; -import org.eclipse.osee.ote.core.framework.IRunManager; - -public abstract class TimerControl implements ITimerControl { - - private final ScheduledExecutorService executor; - private IRunManager runManager; - - - public TimerControl(int maxTimers) { - executor = Executors.newScheduledThreadPool(maxTimers); - } - - @Override - public void cancelTimers() { - executor.shutdown(); - } - - public ScheduledFuture<?> schedulePeriodicTask(Runnable task, long initialDelay, long period) { - return executor.scheduleAtFixedRate(task, initialDelay, period, TimeUnit.MILLISECONDS); - } - - public ScheduledFuture<?> scheduleOneShotTask(Runnable task, long delay) { - return executor.schedule(task, delay, TimeUnit.MILLISECONDS); - } - - @Override - public void envWait(int milliseconds) throws InterruptedException { - envWait(new BasicTimeout(), milliseconds); - } - - @Override - public void envWait(ITimeout obj, int milliseconds) throws InterruptedException { - synchronized (obj) { - setTimerFor(obj, milliseconds); - obj.wait(); - } - } - - @Override - public void setRunManager(IRunManager runManager) { - this.runManager = runManager; - } - - @Override - public IRunManager getRunManager() { - return runManager; - } -} |