From b69ebe70a6378603bbf5299f0f68d355be175a0a Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 31 Oct 2013 01:13:58 +0100 Subject: [PATCH] Consistent javadoc references to java.util.concurrent and javax.enterprise.concurrent --- .../concurrent/ConcurrentTaskExecutor.java | 20 ++++++------- .../concurrent/ConcurrentTaskScheduler.java | 28 +++++++++---------- .../concurrent/CustomizableThreadFactory.java | 6 ++-- .../ScheduledExecutorFactoryBean.java | 2 +- .../concurrent/ScheduledExecutorTask.java | 8 +++--- .../ThreadPoolExecutorFactoryBean.java | 4 +-- .../concurrent/ThreadPoolTaskExecutor.java | 6 ++-- .../scheduling/concurrent/package-info.java | 4 +-- .../util/ConcurrentReferenceHashMap.java | 4 +-- 9 files changed, 40 insertions(+), 42 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ConcurrentTaskExecutor.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ConcurrentTaskExecutor.java index 9518a677397..bb7ee45b56a 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ConcurrentTaskExecutor.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ConcurrentTaskExecutor.java @@ -31,8 +31,8 @@ import org.springframework.scheduling.SchedulingTaskExecutor; import org.springframework.util.ClassUtils; /** - * Adapter that takes a JDK 1.5 {@code java.util.concurrent.Executor} and - * exposes a Spring {@link org.springframework.core.task.TaskExecutor} for it. + * Adapter that takes a {@code java.util.concurrent.Executor} and exposes + * a Spring {@link org.springframework.core.task.TaskExecutor} for it. * Also detects an extended {@code java.util.concurrent.ExecutorService}, adapting * the {@link org.springframework.core.task.AsyncTaskExecutor} interface accordingly. * @@ -41,8 +41,8 @@ import org.springframework.util.ClassUtils; * exposing a long-running hint based on {@link SchedulingAwareRunnable} and an * identity name based on the given Runnable/Callable's {@code toString()}. * - *

Note that there is a pre-built {@link ThreadPoolTaskExecutor} that allows for - * defining a JDK 1.5 {@link java.util.concurrent.ThreadPoolExecutor} in bean style, + *

Note that there is a pre-built {@link ThreadPoolTaskExecutor} that allows + * for defining a {@link java.util.concurrent.ThreadPoolExecutor} in bean style, * exposing it as a Spring {@link org.springframework.core.task.TaskExecutor} directly. * This is a convenient alternative to a raw ThreadPoolExecutor definition with * a separate definition of the present adapter class. @@ -77,8 +77,7 @@ public class ConcurrentTaskExecutor implements SchedulingTaskExecutor { /** - * Create a new ConcurrentTaskExecutor, - * using a single thread executor as default. + * Create a new ConcurrentTaskExecutor, using a single thread executor as default. * @see java.util.concurrent.Executors#newSingleThreadExecutor() */ public ConcurrentTaskExecutor() { @@ -86,11 +85,10 @@ public class ConcurrentTaskExecutor implements SchedulingTaskExecutor { } /** - * Create a new ConcurrentTaskExecutor, - * using the given JDK 1.5 concurrent executor. + * Create a new ConcurrentTaskExecutor, using the given {@link java.util.concurrent.Executor}. *

Autodetects a JSR-236 {@link javax.enterprise.concurrent.ManagedExecutorService} * in order to expose {@link javax.enterprise.concurrent.ManagedTask} adapters for it. - * @param concurrentExecutor the JDK 1.5 concurrent executor to delegate to + * @param concurrentExecutor the {@link java.util.concurrent.Executor} to delegate to */ public ConcurrentTaskExecutor(Executor concurrentExecutor) { setConcurrentExecutor(concurrentExecutor); @@ -98,7 +96,7 @@ public class ConcurrentTaskExecutor implements SchedulingTaskExecutor { /** - * Specify the JDK 1.5 concurrent executor to delegate to. + * Specify the {@link java.util.concurrent.Executor} to delegate to. *

Autodetects a JSR-236 {@link javax.enterprise.concurrent.ManagedExecutorService} * in order to expose {@link javax.enterprise.concurrent.ManagedTask} adapters for it. */ @@ -119,7 +117,7 @@ public class ConcurrentTaskExecutor implements SchedulingTaskExecutor { } /** - * Return the JDK 1.5 concurrent executor that this adapter delegates to. + * Return the {@link java.util.concurrent.Executor} that this adapter delegates to. */ public final Executor getConcurrentExecutor() { return this.concurrentExecutor; diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ConcurrentTaskScheduler.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ConcurrentTaskScheduler.java index 96320a5df4b..e4f4dfd5176 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ConcurrentTaskScheduler.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ConcurrentTaskScheduler.java @@ -36,8 +36,8 @@ import org.springframework.util.ClassUtils; import org.springframework.util.ErrorHandler; /** - * Adapter that takes a JDK 1.5 {@code java.util.concurrent.ScheduledExecutorService} - * and exposes a Spring {@link org.springframework.scheduling.TaskScheduler} for it. + * Adapter that takes a {@code java.util.concurrent.ScheduledExecutorService} and + * exposes a Spring {@link org.springframework.scheduling.TaskScheduler} for it. * Extends {@link ConcurrentTaskExecutor} in order to implement the * {@link org.springframework.scheduling.SchedulingTaskExecutor} interface as well. * @@ -47,7 +47,7 @@ import org.springframework.util.ErrorHandler; * against the {@code java.util.concurrent.ScheduledExecutorService} API. * *

Note that there is a pre-built {@link ThreadPoolTaskScheduler} that allows for - * defining a JDK 1.5 {@link java.util.concurrent.ScheduledThreadPoolExecutor} in bean style, + * defining a {@link java.util.concurrent.ScheduledThreadPoolExecutor} in bean style, * exposing it as a Spring {@link org.springframework.scheduling.TaskScheduler} directly. * This is a convenient alternative to a raw ScheduledThreadPoolExecutor definition with * a separate definition of the present adapter class. @@ -94,14 +94,14 @@ public class ConcurrentTaskScheduler extends ConcurrentTaskExecutor implements T } /** - * Create a new ConcurrentTaskScheduler, - * using the given JDK 1.5 executor as shared delegate. + * Create a new ConcurrentTaskScheduler, using the given + * {@link java.util.concurrent.ScheduledExecutorService} as shared delegate. *

Autodetects a JSR-236 {@link javax.enterprise.concurrent.ManagedScheduledExecutorService} * in order to use it for trigger-based scheduling if possible, * instead of Spring's local trigger management. - * @param scheduledExecutor the JDK 1.5 scheduled executor to delegate to - * for {@link org.springframework.scheduling.SchedulingTaskExecutor} as well - * as {@link TaskScheduler} invocations + * @param scheduledExecutor the {@link java.util.concurrent.ScheduledExecutorService} + * to delegate to for {@link org.springframework.scheduling.SchedulingTaskExecutor} + * as well as {@link TaskScheduler} invocations */ public ConcurrentTaskScheduler(ScheduledExecutorService scheduledExecutor) { super(scheduledExecutor); @@ -109,15 +109,15 @@ public class ConcurrentTaskScheduler extends ConcurrentTaskExecutor implements T } /** - * Create a new ConcurrentTaskScheduler, - * using the given JDK 1.5 executors as delegates. + * Create a new ConcurrentTaskScheduler, using the given {@link java.util.concurrent.Executor} + * and {@link java.util.concurrent.ScheduledExecutorService} as delegates. *

Autodetects a JSR-236 {@link javax.enterprise.concurrent.ManagedScheduledExecutorService} * in order to use it for trigger-based scheduling if possible, * instead of Spring's local trigger management. - * @param concurrentExecutor the JDK 1.5 concurrent executor to delegate to + * @param concurrentExecutor the {@link java.util.concurrent.Executor} to delegate to * for {@link org.springframework.scheduling.SchedulingTaskExecutor} invocations - * @param scheduledExecutor the JDK 1.5 scheduled executor to delegate to - * for {@link TaskScheduler} invocations + * @param scheduledExecutor the {@link java.util.concurrent.ScheduledExecutorService} + * to delegate to for {@link TaskScheduler} invocations */ public ConcurrentTaskScheduler(Executor concurrentExecutor, ScheduledExecutorService scheduledExecutor) { super(concurrentExecutor); @@ -126,7 +126,7 @@ public class ConcurrentTaskScheduler extends ConcurrentTaskExecutor implements T /** - * Specify the JDK 1.5 scheduled executor to delegate to. + * Specify the {@link java.util.concurrent.ScheduledExecutorService} to delegate to. *

Autodetects a JSR-236 {@link javax.enterprise.concurrent.ManagedScheduledExecutorService} * in order to use it for trigger-based scheduling if possible, * instead of Spring's local trigger management. diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/CustomizableThreadFactory.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/CustomizableThreadFactory.java index 090eac7b506..fe981cd516f 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/CustomizableThreadFactory.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/CustomizableThreadFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,8 +21,8 @@ import java.util.concurrent.ThreadFactory; import org.springframework.util.CustomizableThreadCreator; /** - * Implementation of the JDK 1.5 {@link java.util.concurrent.ThreadFactory} - * interface, allowing for customizing the created threads (name, priority, etc). + * Implementation of the {@link java.util.concurrent.ThreadFactory} interface, + * allowing for customizing the created threads (name, priority, etc). * *

See the base class {@link org.springframework.util.CustomizableThreadCreator} * for details on the available configuration options. diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java index 507349e8fcc..2990e8b3a27 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorFactoryBean.java @@ -31,7 +31,7 @@ import org.springframework.util.ObjectUtils; /** * {@link org.springframework.beans.factory.FactoryBean} that sets up - * a JDK 1.5 {@link java.util.concurrent.ScheduledExecutorService} + * a {@link java.util.concurrent.ScheduledExecutorService} * (by default: a {@link java.util.concurrent.ScheduledThreadPoolExecutor}) * and exposes it for bean references. * diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorTask.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorTask.java index 07d8c02199f..1ed39081625 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorTask.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ScheduledExecutorTask.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,9 +23,9 @@ import java.util.concurrent.TimeUnit; * {@link Runnable} and a delay plus period. The period needs to be specified; * there is no point in a default for it. * - *

The JDK 1.5 {@link java.util.concurrent.ScheduledExecutorService} does - * not offer more sophisticated scheduling options such as cron expressions. - * Consider using Quartz for such advanced needs. + *

The {@link java.util.concurrent.ScheduledExecutorService} does not offer + * more sophisticated scheduling options such as cron expressions. + * Consider using {@link ThreadPoolTaskScheduler} for such needs. * *

Note that the {@link java.util.concurrent.ScheduledExecutorService} mechanism * uses a {@link Runnable} instance that is shared between repeated executions, diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolExecutorFactoryBean.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolExecutorFactoryBean.java index a3addbd27e8..274a39510d7 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolExecutorFactoryBean.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolExecutorFactoryBean.java @@ -31,13 +31,13 @@ import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.InitializingBean; /** - * JavaBean that allows for configuring a JDK 1.5 {@link java.util.concurrent.ThreadPoolExecutor} + * JavaBean that allows for configuring a {@link java.util.concurrent.ThreadPoolExecutor} * in bean style (through its "corePoolSize", "maxPoolSize", "keepAliveSeconds", * "queueCapacity" properties) and exposing it as a bean reference of its native * {@link java.util.concurrent.ExecutorService} type. * *

For an alternative, you may set up a ThreadPoolExecutor instance directly using - * constructor injection, or use a factory method definition that points to the JDK 1.5 + * constructor injection, or use a factory method definition that points to the * {@link java.util.concurrent.Executors} class. * *

If you need a timing-based {@link java.util.concurrent.ScheduledExecutorService} diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor.java index b73871ae2da..d7d5946e10c 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor.java @@ -34,7 +34,7 @@ import org.springframework.scheduling.SchedulingTaskExecutor; import org.springframework.util.Assert; /** - * JavaBean that allows for configuring a JDK 1.5 {@link java.util.concurrent.ThreadPoolExecutor} + * JavaBean that allows for configuring a {@link java.util.concurrent.ThreadPoolExecutor} * in bean style (through its "corePoolSize", "maxPoolSize", "keepAliveSeconds", "queueCapacity" * properties) and exposing it as a Spring {@link org.springframework.core.task.TaskExecutor}. * This class is also well suited for management and monitoring (e.g. through JMX), @@ -42,13 +42,13 @@ import org.springframework.util.Assert; * (all supporting updates at runtime); "poolSize", "activeCount" (for introspection only). * *

For an alternative, you may set up a ThreadPoolExecutor instance directly using - * constructor injection, or use a factory method definition that points to the JDK 1.5 + * constructor injection, or use a factory method definition that points to the * {@link java.util.concurrent.Executors} class. To expose such a raw Executor as a * Spring {@link org.springframework.core.task.TaskExecutor}, simply wrap it with a * {@link org.springframework.scheduling.concurrent.ConcurrentTaskExecutor} adapter. * *

NOTE: This class implements Spring's - * {@link org.springframework.core.task.TaskExecutor} interface as well as the JDK 1.5 + * {@link org.springframework.core.task.TaskExecutor} interface as well as the * {@link java.util.concurrent.Executor} interface, with the former being the primary * interface, the other just serving as secondary convenience. For this reason, the * exception handling follows the TaskExecutor contract rather than the Executor contract, diff --git a/spring-context/src/main/java/org/springframework/scheduling/concurrent/package-info.java b/spring-context/src/main/java/org/springframework/scheduling/concurrent/package-info.java index 00014e09464..fb8a94108ef 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/concurrent/package-info.java +++ b/spring-context/src/main/java/org/springframework/scheduling/concurrent/package-info.java @@ -1,7 +1,7 @@ /** * - * Scheduling convenience classes for the JDK 1.5+ Executor mechanism - * in the {@code java.util.concurrent} package, allowing to set up a + * Scheduling convenience classes for the {@code java.util.concurrent} + * and {@code javax.enterprise.concurrent} packages, allowing to set up a * ThreadPoolExecutor or ScheduledThreadPoolExecutor as a bean in a Spring * context. Provides support for the native {@code java.util.concurrent} * interfaces as well as the Spring {@code TaskExecutor} mechanism. diff --git a/spring-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java b/spring-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java index fa4566251f9..05eb94dc9a7 100644 --- a/spring-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java +++ b/spring-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java @@ -48,7 +48,7 @@ import java.util.concurrent.locks.ReentrantLock; * references at any time, so it may appear that an unknown thread is silently removing * entries. * - *

If not explicitly specified this implementation will use + *

If not explicitly specified, this implementation will use * {@linkplain SoftReference soft entry references}. * * @param The key type @@ -425,7 +425,6 @@ public class ConcurrentReferenceHashMap extends AbstractMap implemen setReferences(createReferenceArray(this.initialSize)); } - public Reference getReference(Object key, int hash, Restructure restructure) { if (restructure == Restructure.WHEN_NECESSARY) { restructureIfNecessary(false); @@ -895,6 +894,7 @@ public class ConcurrentReferenceHashMap extends AbstractMap implemen * The types of restructuring that can be performed. */ protected static enum Restructure { + WHEN_NECESSARY, NEVER }