diff options
Diffstat (limited to 'plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent')
15 files changed, 82 insertions, 87 deletions
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/CompletionWorkSerializer.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/CompletionWorkSerializer.java index 0bb6612ec5..445f67e3bc 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/CompletionWorkSerializer.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/CompletionWorkSerializer.java @@ -4,7 +4,7 @@ * 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: * Eike Stepper - initial API and implementation */ diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ExecutorServiceFactory.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ExecutorServiceFactory.java index cd88064704..9d2dc42ef4 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ExecutorServiceFactory.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ExecutorServiceFactory.java @@ -63,64 +63,64 @@ public class ExecutorServiceFactory extends Factory final ExecutorService executorService = Executors.newCachedThreadPool(threadFactory); return LifecycleUtil.delegateLifecycle(getClass().getClassLoader(), executorService, ExecutorService.class, new ILifecycle() + { + private boolean active; + + public void activate() throws LifecycleException + { + active = true; + } + + public Exception deactivate() + { + try { - private boolean active; - - public void activate() throws LifecycleException - { - active = true; - } - - public Exception deactivate() - { - try - { - executorService.shutdown(); - active = false; - return null; - } - catch (Exception ex) - { - return ex; - } - } - - public LifecycleState getLifecycleState() - { - return active ? LifecycleState.ACTIVE : LifecycleState.INACTIVE; - } - - public boolean isActive() - { - return active; - } - - public void addListener(IListener listener) - { - // Do nothing - } - - public void removeListener(IListener listener) - { - // Do nothing - } - - public IListener[] getListeners() - { - return EventUtil.NO_LISTENERS; - } - - public boolean hasListeners() - { - return false; - } - - @Override - public String toString() - { - return "CachedThreadPool"; - } - }); + executorService.shutdown(); + active = false; + return null; + } + catch (Exception ex) + { + return ex; + } + } + + public LifecycleState getLifecycleState() + { + return active ? LifecycleState.ACTIVE : LifecycleState.INACTIVE; + } + + public boolean isActive() + { + return active; + } + + public void addListener(IListener listener) + { + // Do nothing + } + + public void removeListener(IListener listener) + { + // Do nothing + } + + public IListener[] getListeners() + { + return EventUtil.NO_LISTENERS; + } + + public boolean hasListeners() + { + return false; + } + + @Override + public String toString() + { + return "CachedThreadPool"; + } + }); } public static ExecutorService get(IManagedContainer container) diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ICorrelator.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ICorrelator.java index 47e3f53b23..b2061f90a4 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ICorrelator.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ICorrelator.java @@ -4,7 +4,7 @@ * 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: * Eike Stepper - initial API and implementation */ diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/IRWLockManager.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/IRWLockManager.java index 319aceb159..ed103e8ebf 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/IRWLockManager.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/IRWLockManager.java @@ -16,7 +16,7 @@ import java.util.Collection; * Support Multiple reads/no write and upgrade lock from read to write. Many context could request * {@link LockType#WRITE write} lock at the same time. It will privileges first context that has already a * {@link LockType#READ read} lock. If no one has any read lock, it's "first come first serve". - * + * * @author Eike Stepper * @since 3.0 */ @@ -33,7 +33,7 @@ public interface IRWLockManager<OBJECT, CONTEXT> /** * Attempts to release for a given locktype, context and objects. - * + * * @throws IllegalMonitorStateException * Unlocking objects without lock. */ diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/IRWOLockManager.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/IRWOLockManager.java index b10def8648..cb11385598 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/IRWOLockManager.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/IRWOLockManager.java @@ -4,7 +4,7 @@ * 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: * Caspar De Groot - initial API and implementation */ @@ -18,7 +18,7 @@ import java.util.List; /** * A {@link IRWLockManager read/write lock manager} that supports {@link IRWLockManager.LockType#OPTION write option} * locks. - * + * * @author Caspar De Groot * @since 3.2 */ diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ISynchronizer.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ISynchronizer.java index dd5d1d2c25..443a5d45a1 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ISynchronizer.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ISynchronizer.java @@ -4,7 +4,7 @@ * 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: * Eike Stepper - initial API and implementation */ @@ -15,7 +15,7 @@ package org.eclipse.net4j.util.concurrent; * consumer must have access to this {@link ISynchronizer} and there must only ever exist one consumer for it. Once the * result value is consumed by the consumer this {@link ISynchronizer} must not be reused. * <p> - * + * * @author Eike Stepper */ public interface ISynchronizer<RESULT> diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/IWorkSerializer.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/IWorkSerializer.java index 9c74c33b03..fa519aa7a2 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/IWorkSerializer.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/IWorkSerializer.java @@ -4,7 +4,7 @@ * 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: * Eike Stepper - initial API and implementation */ diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/OnePendingExecutor.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/OnePendingExecutor.java index 4efc4b2eb3..92ab5c648c 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/OnePendingExecutor.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/OnePendingExecutor.java @@ -4,7 +4,7 @@ * 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: * Eike Stepper - initial API and implementation */ diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/QueueRunner.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/QueueRunner.java index 82bf5dbf10..15b80874b2 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/QueueRunner.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/QueueRunner.java @@ -4,7 +4,7 @@ * 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: * Eike Stepper - initial API and implementation */ diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RWLockManager.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RWLockManager.java index 3bd5deeab4..da8951bc3c 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RWLockManager.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RWLockManager.java @@ -29,7 +29,7 @@ import java.util.Set; * Support Multiple reads/no write and upgrade lock from read to write. Many context could request * {@link IRWLockManager.LockType#WRITE write} lock at the same time. It will privileges first context that has already * a {@link IRWLockManager.LockType#READ read} lock. If no one has any read lock, it's "first come first serve". - * + * * @author Simon McDuff * @since 2.0 * @deprecated Use {@link RWOLockManager} @@ -130,7 +130,7 @@ public class RWLockManager<OBJECT, CONTEXT> extends Lifecycle implements IRWLock /** * Attempts to release for a given locktype, context and objects. - * + * * @throws IllegalMonitorStateException * Unlocking objects without lock. * @since 3.0 @@ -267,7 +267,7 @@ public class RWLockManager<OBJECT, CONTEXT> extends Lifecycle implements IRWLock * Attempts to release this lock. * <p> * If the number of context is now zero then the lock is made available for write lock attempts. - * + * * @throws IllegalMonitorStateException * Unlocking object not locked. */ diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RoundRobinList.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RoundRobinList.java index 605ae181ad..0c361a2d82 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RoundRobinList.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RoundRobinList.java @@ -4,7 +4,7 @@ * 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: * Eike Stepper - initial API and implementation */ diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/Sleeper.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/Sleeper.java index 06da07c4cb..80896594d2 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/Sleeper.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/Sleeper.java @@ -4,7 +4,7 @@ * 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: * Eike Stepper - initial API and implementation */ diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/SynchronousWorkSerializer.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/SynchronousWorkSerializer.java index 1bf21139fe..6819932258 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/SynchronousWorkSerializer.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/SynchronousWorkSerializer.java @@ -4,7 +4,7 @@ * 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: * Eike Stepper - initial API and implementation */ diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/TrackableTimerTask.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/TrackableTimerTask.java index 8cca7eb369..213d169559 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/TrackableTimerTask.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/TrackableTimerTask.java @@ -29,11 +29,11 @@ public abstract class TrackableTimerTask extends TimerTask /** * The boolean value of the system property <code>org.eclipse.net4j.util.concurrent.TrackTimerTasks</code>. */ - public static final boolean TRACK_TIMER_TASKS = Boolean.parseBoolean(OMPlatform.INSTANCE.getProperty( - "org.eclipse.net4j.util.concurrent.TrackTimerTasks", "false")); + public static final boolean TRACK_TIMER_TASKS = Boolean + .parseBoolean(OMPlatform.INSTANCE.getProperty("org.eclipse.net4j.util.concurrent.TrackTimerTasks", "false")); - private static final Map<TrackableTimerTask, ConstructionInfo> CONSTRUCTION_INFOS = TRACK_TIMER_TASKS ? new WeakHashMap<TrackableTimerTask, ConstructionInfo>() - : null; + private static final Map<TrackableTimerTask, ConstructionInfo> CONSTRUCTION_INFOS = TRACK_TIMER_TASKS + ? new WeakHashMap<TrackableTimerTask, ConstructionInfo>() : null; protected TrackableTimerTask() { diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/package-info.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/package-info.java index 12fd804b0c..49f9a16946 100644 --- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/package-info.java +++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/package-info.java @@ -1,12 +1,8 @@ /* - * Copyright (c) 2011, 2012 Eike Stepper (Berlin, Germany) and others. - * 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: - * Eike Stepper - initial API and implementation + * Copyright (c) 2011, 2012 Eike Stepper (Berlin, Germany) and others. 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: Eike Stepper - initial API + * and implementation */ /** @@ -14,4 +10,3 @@ * @apiviz.exclude .* */ package org.eclipse.net4j.util.concurrent; - |