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