404 |
|
/** |
405 |
|
* A callable that runs given task and returns given result |
406 |
|
*/ |
407 |
< |
private static class RunnableAdapter<T> implements Callable<T> { |
408 |
< |
private final Runnable task; |
409 |
< |
private final T result; |
407 |
> |
static final class RunnableAdapter<T> implements Callable<T> { |
408 |
> |
final Runnable task; |
409 |
> |
final T result; |
410 |
|
RunnableAdapter(Runnable task, T result) { |
411 |
|
this.task = task; |
412 |
|
this.result = result; |
420 |
|
/** |
421 |
|
* A callable that runs given privileged action and returns its result |
422 |
|
*/ |
423 |
< |
private static class PrivilegedActionAdapter implements Callable<Object> { |
423 |
> |
static final class PrivilegedActionAdapter implements Callable<Object> { |
424 |
|
PrivilegedActionAdapter(PrivilegedAction action) { |
425 |
|
this.action = action; |
426 |
|
} |
433 |
|
/** |
434 |
|
* A callable that runs given privileged exception action and returns its result |
435 |
|
*/ |
436 |
< |
private static class PrivilegedExceptionActionAdapter implements Callable<Object> { |
436 |
> |
static final class PrivilegedExceptionActionAdapter implements Callable<Object> { |
437 |
|
PrivilegedExceptionActionAdapter(PrivilegedExceptionAction action) { |
438 |
|
this.action = action; |
439 |
|
} |
447 |
|
/** |
448 |
|
* A callable that runs under established access control settings |
449 |
|
*/ |
450 |
< |
private static class PrivilegedCallable<T> implements Callable<T> { |
450 |
> |
static final class PrivilegedCallable<T> implements Callable<T> { |
451 |
|
private final AccessControlContext acc; |
452 |
|
private final Callable<T> task; |
453 |
|
private T result; |
479 |
|
* A callable that runs under established access control settings and |
480 |
|
* current ClassLoader |
481 |
|
*/ |
482 |
< |
private static class PrivilegedCallableUsingCurrentClassLoader<T> implements Callable<T> { |
482 |
> |
static final class PrivilegedCallableUsingCurrentClassLoader<T> implements Callable<T> { |
483 |
|
private final ClassLoader ccl; |
484 |
|
private final AccessControlContext acc; |
485 |
|
private final Callable<T> task; |
524 |
|
/** |
525 |
|
* The default thread factory |
526 |
|
*/ |
527 |
< |
private static class DefaultThreadFactory implements ThreadFactory { |
527 |
> |
static class DefaultThreadFactory implements ThreadFactory { |
528 |
|
static final AtomicInteger poolNumber = new AtomicInteger(1); |
529 |
|
final ThreadGroup group; |
530 |
|
final AtomicInteger threadNumber = new AtomicInteger(1); |
554 |
|
/** |
555 |
|
* Thread factory capturing access control and class loader |
556 |
|
*/ |
557 |
< |
private static class PrivilegedThreadFactory extends DefaultThreadFactory { |
557 |
> |
static class PrivilegedThreadFactory extends DefaultThreadFactory { |
558 |
|
private final ClassLoader ccl; |
559 |
|
private final AccessControlContext acc; |
560 |
|
|
585 |
|
* A wrapper class that exposes only the ExecutorService methods |
586 |
|
* of an implementation. |
587 |
|
*/ |
588 |
< |
private static class DelegatedExecutorService extends AbstractExecutorService { |
588 |
> |
static class DelegatedExecutorService extends AbstractExecutorService { |
589 |
|
private final ExecutorService e; |
590 |
|
DelegatedExecutorService(ExecutorService executor) { e = executor; } |
591 |
|
public void execute(Runnable command) { e.execute(command); } |
630 |
|
* A wrapper class that exposes only the ExecutorService and |
631 |
|
* ScheduleExecutor methods of a ScheduledExecutorService implementation. |
632 |
|
*/ |
633 |
< |
private static class DelegatedScheduledExecutorService |
633 |
> |
static class DelegatedScheduledExecutorService |
634 |
|
extends DelegatedExecutorService |
635 |
|
implements ScheduledExecutorService { |
636 |
|
private final ScheduledExecutorService e; |