ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/Executors.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/Executors.java (file contents):
Revision 1.42 by dl, Mon Dec 22 16:25:20 2003 UTC vs.
Revision 1.43 by tim, Thu Dec 25 15:42:12 2003 UTC

# Line 81 | Line 81 | public class Executors {
81       * <tt>newFixedThreadPool(1)</tt> the returned executor is
82       * guaranteed not to be reconfigurable to use additional threads.
83       *
84 <     * @return the newly-created single-threaded Executor
84 >     * @return the newly created single-threaded Executor
85       */
86      public static ExecutorService newSingleThreadExecutor() {
87          return new DelegatedExecutorService
# Line 101 | Line 101 | public class Executors {
101       * @param threadFactory the factory to use when creating new
102       * threads
103       *
104 <     * @return the newly-created single-threaded Executor
104 >     * @return the newly created single-threaded Executor
105       */
106      public static ExecutorService newSingleThreadExecutor(ThreadFactory threadFactory) {
107          return new DelegatedExecutorService
# Line 159 | Line 159 | public class Executors {
159       * given time. Unlike the otherwise equivalent
160       * <tt>newScheduledThreadPool(1)</tt> the returned executor is
161       * guaranteed not to be reconfigurable to use additional threads.
162 <     * @return a newly created scheduled executor
162 >     * @return the newly created scheduled executor
163       */
164      public static ScheduledExecutorService newSingleThreadScheduledExecutor() {
165          return new DelegatedScheduledExecutorService
# Line 195 | Line 195 | public class Executors {
195       */
196      public static ScheduledExecutorService newScheduledThreadPool(int corePoolSize) {
197          return new ScheduledThreadPoolExecutor(corePoolSize);
198 < }
198 >    }
199  
200      /**
201       * Creates a thread pool that can schedule commands to run after a
# Line 213 | Line 213 | public class Executors {
213  
214  
215      /**
216 <     * Creates and returns an object that delegates all defined {@link
216 >     * Returns an object that delegates all defined {@link
217       * ExecutorService} methods to the given executor, but not any
218       * other methods that might otherwise be accessible using
219       * casts. This provides a way to safely "freeze" configuration and
# Line 229 | Line 229 | public class Executors {
229      }
230  
231      /**
232 <     * Creates and returns an object that delegates all defined {@link
232 >     * Returns an object that delegates all defined {@link
233       * ScheduledExecutorService} methods to the given executor, but
234       * not any other methods that might otherwise be accessible using
235       * casts. This provides a way to safely "freeze" configuration and
# Line 257 | Line 257 | public class Executors {
257       * <em>pool-N-thread-M</em>, where <em>N</em> is the sequence
258       * number of this factory, and <em>M</em> is the sequence number
259       * of the thread created by this factory.
260 <     * @return the thread factory
260 >     * @return a thread factory
261       */
262      public static ThreadFactory defaultThreadFactory() {
263          return new DefaultThreadFactory();
# Line 290 | Line 290 | public class Executors {
290       * thread waits for and services requests to create others that
291       * will inherit its values.
292       *
293 <     * @return the thread factory
293 >     * @return a thread factory
294       * @throws AccessControlException if the current access control
295       * context does not have permission to both get and set context
296       * class loader.
# Line 301 | Line 301 | public class Executors {
301  
302  
303      /**
304 <     * Creates and returns a {@link Callable} object that, when
304 >     * Returns a {@link Callable} object that, when
305       * called, runs the given task and returns the given result.  This
306       * can be useful when applying methods requiring a
307       * <tt>Callable</tt> to an otherwise resultless action.
308       * @param task the task to run
309       * @param result the result to return
310       * @throws NullPointerException if task null
311 <     * @return callable object
311 >     * @return a callable object
312       */
313      public static <T> Callable<T> callable(Runnable task, T result) {
314          if (task == null)
# Line 317 | Line 317 | public class Executors {
317      }
318  
319      /**
320 <     * Creates and returns a {@link Callable} object that, when
320 >     * Returns a {@link Callable} object that, when
321       * called, runs the given task and returns <tt>null</tt>
322       * @param task the task to run
323 <     * @return callable object
323 >     * @return a callable object
324       * @throws NullPointerException if task null
325       */
326      public static Callable<Object> callable(Runnable task) {
# Line 330 | Line 330 | public class Executors {
330      }
331  
332      /**
333 <     * Creates and returns a {@link Callable} object that, when
333 >     * Returns a {@link Callable} object that, when
334       * called, runs the given privileged action and returns its result
335       * @param action the privileged action to run
336 <     * @return callable object
336 >     * @return a callable object
337       * @throws NullPointerException if action null
338       */
339      public static Callable<Object> callable(PrivilegedAction action) {
# Line 343 | Line 343 | public class Executors {
343      }
344  
345      /**
346 <     * Creates and returns a {@link Callable} object that, when
346 >     * Returns a {@link Callable} object that, when
347       * called, runs the given privileged exception action and returns
348       * its result
349       * @param action the privileged exception action to run
350 <     * @return callable object
350 >     * @return a callable object
351       * @throws NullPointerException if action null
352       */
353      public static Callable<Object> callable(PrivilegedExceptionAction action) {
# Line 357 | Line 357 | public class Executors {
357      }
358  
359      /**
360 <     * Creates and returns a {@link Callable} object that will, when
360 >     * Returns a {@link Callable} object that will, when
361       * called, execute the given <tt>callable</tt> under the current
362       * access control context. This method should normally be
363       * invoked within an {@link AccessController#doPrivileged} action
# Line 366 | Line 366 | public class Executors {
366       * not possible, throw an associated {@link
367       * AccessControlException}.
368       * @param callable the underlying task
369 <     * @return callable object
369 >     * @return a callable object
370       * @throws NullPointerException if callable null
371       *
372       */
# Line 377 | Line 377 | public class Executors {
377      }
378      
379      /**
380 <     * Creates and returns a {@link Callable} object that will, when
380 >     * Returns a {@link Callable} object that will, when
381       * called, execute the given <tt>callable</tt> under the current
382       * access control context, with the current context class loader
383       * as the context class loader. This method should normally be
# Line 388 | Line 388 | public class Executors {
388       * AccessControlException}.
389       * @param callable the underlying task
390       *
391 <     * @return callable object
391 >     * @return a callable object
392       * @throws NullPointerException if callable null
393       * @throws AccessControlException if the current access control
394       * context does not have permission to both set and get context
# Line 629 | Line 629 | public class Executors {
629      
630      /**
631       * A wrapper class that exposes only the ExecutorService and
632 <     * ScheduleExecutor methods of a ScheduledThreadPoolExecutor.
632 >     * ScheduleExecutor methods of a ScheduledExecutorService implementation.
633       */
634      static class DelegatedScheduledExecutorService
635              extends DelegatedExecutorService

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines