org.apache.ignite.internal.processors.security.thread

## Class SecurityAwareThreadPoolExecutor

- java.lang.Object
- - java.util.concurrent.AbstractExecutorService
  - - java.util.concurrent.ThreadPoolExecutor
    - - org.apache.ignite.thread.IgniteThreadPoolExecutor
      - - org.apache.ignite.internal.processors.security.thread.SecurityAwareThreadPoolExecutor

All Implemented Interfaces:
  Executor, ExecutorService, MetricsAwareExecutorService

    public class SecurityAwareThreadPoolExecutor
    extends IgniteThreadPoolExecutor

Extends `ThreadPoolExecutor` with the ability to execute tasks in security context that was actual when task was added to executor's queue.

### Nested Class Summary

### Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor

`ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy`

### Constructor Summary

Constructors
Constructor and Description
`SecurityAwareThreadPoolExecutor(IgniteSecurity security, String threadNamePrefix, String igniteInstanceName, int corePoolSize, int maxPoolSize, long keepAliveTime, BlockingQueue<Runnable> workQ, byte plc, Thread.UncaughtExceptionHandler eHnd)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `execute(@NotNull Runnable cmd)`
`<T> @NotNull List<Future<T>>` `invokeAll(@NotNull Collection<? extends Callable<T>> tasks)`
`<T> @NotNull List<Future<T>>` `invokeAll(@NotNull Collection<? extends Callable<T>> tasks, long timeout, @NotNull TimeUnit unit)`
`<T> T` `invokeAny(@NotNull Collection<? extends Callable<T>> tasks)`
`<T> T` `invokeAny(@NotNull Collection<? extends Callable<T>> tasks, long timeout, @NotNull TimeUnit unit)`
`<T> @NotNull Future<T>` `submit(@NotNull Callable<T> task)`
`@NotNull Future<?>` `submit(@NotNull Runnable task)`
`<T> @NotNull Future<T>` `submit(@NotNull Runnable task, T res)`

### Methods inherited from class org.apache.ignite.thread.IgniteThreadPoolExecutor

`afterExecute, beforeExecute, executionTimeMetric, registerMetrics`

### Methods inherited from class java.util.concurrent.ThreadPoolExecutor

`allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated, toString`

### Methods inherited from class java.util.concurrent.AbstractExecutorService

`newTaskFor, newTaskFor`

### Methods inherited from class java.lang.Object

`clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### SecurityAwareThreadPoolExecutor

    public SecurityAwareThreadPoolExecutor(IgniteSecurity security,
                                           String threadNamePrefix,
                                           String igniteInstanceName,
                                           int corePoolSize,
                                           int maxPoolSize,
                                           long keepAliveTime,
                                           BlockingQueue<Runnable> workQ,
                                           byte plc,
                                           Thread.UncaughtExceptionHandler eHnd)

### Method Detail

#### submit

    @NotNull
    public <T> @NotNull Future<T> submit(@NotNull
                                                  @NotNull Callable<T> task)

Specified by:
  `submit` in interface `ExecutorService`
Overrides:
  `submit` in class `AbstractExecutorService`

#### submit

    @NotNull
    public <T> @NotNull Future<T> submit(@NotNull
                                                  @NotNull Runnable task,
                                                  T res)

Specified by:
  `submit` in interface `ExecutorService`
Overrides:
  `submit` in class `AbstractExecutorService`

#### submit

    @NotNull
    public @NotNull Future<?> submit(@NotNull
                                              @NotNull Runnable task)

Specified by:
  `submit` in interface `ExecutorService`
Overrides:
  `submit` in class `AbstractExecutorService`

#### invokeAll

    @NotNull
    public <T> @NotNull List<Future<T>> invokeAll(@NotNull
                                                           @NotNull Collection<? extends Callable<T>> tasks)
                                                    throws InterruptedException

Specified by:
  `invokeAll` in interface `ExecutorService`
Overrides:
  `invokeAll` in class `AbstractExecutorService`
Throws:
  `InterruptedException`

#### invokeAll

    @NotNull
    public <T> @NotNull List<Future<T>> invokeAll(@NotNull
                                                           @NotNull Collection<? extends Callable<T>> tasks,
                                                           long timeout,
                                                           @NotNull
                                                           @NotNull TimeUnit unit)
                                                    throws InterruptedException

Specified by:
  `invokeAll` in interface `ExecutorService`
Overrides:
  `invokeAll` in class `AbstractExecutorService`
Throws:
  `InterruptedException`

#### invokeAny

    @NotNull
    public <T> T invokeAny(@NotNull
                                    @NotNull Collection<? extends Callable<T>> tasks)
                             throws InterruptedException,
                                    ExecutionException

Specified by:
  `invokeAny` in interface `ExecutorService`
Overrides:
  `invokeAny` in class `AbstractExecutorService`
Throws:
  `InterruptedException`
  `ExecutionException`

#### invokeAny

    public <T> T invokeAny(@NotNull
                           @NotNull Collection<? extends Callable<T>> tasks,
                           long timeout,
                           @NotNull
                           @NotNull TimeUnit unit)
                    throws InterruptedException,
                           ExecutionException,
                           TimeoutException

Specified by:
  `invokeAny` in interface `ExecutorService`
Overrides:
  `invokeAny` in class `AbstractExecutorService`
Throws:
  `InterruptedException`
  `ExecutionException`
  `TimeoutException`

#### execute

    public void execute(@NotNull
                        @NotNull Runnable cmd)

Specified by:
  `execute` in interface `Executor`
Overrides:
  `execute` in class `ThreadPoolExecutor`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.14.0
Release Date | : September 29 2022