- AbstractTaskExecutor - Class in org.jtrim2.executor
-
Defines a convenient abstract base class for
TaskExecutor implementations.
- AbstractTaskExecutor() - Constructor for class org.jtrim2.executor.AbstractTaskExecutor
-
- AbstractTaskExecutor.SubmittedTask<V> - Class in org.jtrim2.executor
-
- AbstractTaskExecutorService - Class in org.jtrim2.executor
-
- AbstractTaskExecutorService() - Constructor for class org.jtrim2.executor.AbstractTaskExecutorService
-
- AbstractTerminateNotifierTaskExecutorService - Class in org.jtrim2.executor
-
- AbstractTerminateNotifierTaskExecutorService() - Constructor for class org.jtrim2.executor.AbstractTerminateNotifierTaskExecutorService
-
Initializes the AbstractTerminateNotifierTaskExecutorService with
no listeners currently registered.
- addTerminateListener(Runnable) - Method in class org.jtrim2.executor.AbstractTerminateNotifierTaskExecutorService
-
Adds a listener which is to be notified after this
TaskExecutorService terminates.
- addTerminateListener(Runnable) - Method in class org.jtrim2.executor.DelegatedTaskExecutorService
-
Adds a listener which is to be notified after this
TaskExecutorService terminates.
- addTerminateListener(Runnable) - Method in interface org.jtrim2.executor.TaskExecutorService
-
Adds a listener which is to be notified after this
TaskExecutorService terminates.
- asExecutorService(TaskExecutorService) - Static method in class org.jtrim2.executor.ExecutorConverter
-
Returns an ExecutorService backed by the specified
TaskExecutorService.
- asExecutorService(TaskExecutorService, boolean) - Static method in class org.jtrim2.executor.ExecutorConverter
-
Returns an ExecutorService backed by the specified
TaskExecutorService.
- asFuture() - Method in class org.jtrim2.executor.FutureResultHolder
-
Returns this
FutureResultHolder viewed as a
Future.
- asTaskExecutor(Executor) - Static method in class org.jtrim2.executor.ExecutorConverter
-
Returns a TaskExecutor backed by the specified Executor.
- asTaskExecutorService(ExecutorService) - Static method in class org.jtrim2.executor.ExecutorConverter
-
Returns a TaskExecutorService backed by the specified
ExecutorService.
- asUnstoppableExecutor(ExecutorService) - Static method in class org.jtrim2.executor.ExecutorsEx
-
Returns an ExecutorService forwarding all of its methods to
the given ExecutorService but the returned
ExecutorService cannot be shutted down.
- asUnstoppableExecutor(TaskExecutorService) - Static method in class org.jtrim2.executor.TaskExecutors
-
Returns an TaskExecutorService forwarding all of its methods to
the given TaskExecutorService but the returned
TaskExecutorService cannot be shutted down.
- awaitExecutor(ExecutorService) - Static method in class org.jtrim2.executor.ExecutorsEx
-
Waits until the specified ExecutorService terminates.
- awaitExecutors(ExecutorService...) - Static method in class org.jtrim2.executor.ExecutorsEx
-
Waits until all the specified ExecutorServices terminate.
- awaitExecutors(Collection<? extends ExecutorService>) - Static method in class org.jtrim2.executor.ExecutorsEx
-
Waits until all the ExecutorServices in the specified collection
terminate.
- awaitExecutors(long, TimeUnit, ExecutorService...) - Static method in class org.jtrim2.executor.ExecutorsEx
-
Waits until all the specified ExecutorServices terminate or the
given timeout elapses.
- awaitExecutors(long, TimeUnit, Collection<? extends ExecutorService>) - Static method in class org.jtrim2.executor.ExecutorsEx
-
Waits until all the ExecutorServices in the specified collection
terminate or the given timeout elapses.
- awaitTermination(CancellationToken) - Method in class org.jtrim2.executor.DelegatedTaskExecutorService
-
Waits until this TaskExecutorService will not execute any more
tasks.
- awaitTermination(CancellationToken) - Method in interface org.jtrim2.executor.TaskExecutorService
-
Waits until this TaskExecutorService will not execute any more
tasks.
- execute(CancellationToken) - Method in class org.jtrim2.executor.AbstractTaskExecutor.SubmittedTask
-
Executes the submitted tasks and completes this SubmittedTask.
- execute(CancellationToken) - Method in interface org.jtrim2.executor.CancelableFunction
-
Executes the the implementation dependent task and returns the result of
the computation.
- execute(CancellationToken) - Method in interface org.jtrim2.executor.CancelableTask
-
Executes the the implementation dependent task.
- execute(CancellationToken, CancelableTask) - Method in class org.jtrim2.executor.DelegatedTaskExecutorService
-
Executes the task at some time in the future.
- execute(Runnable) - Method in class org.jtrim2.executor.DelegatedTaskExecutorService
-
Note that although the task itself is not cancelable explicitly, the executor might cancel
it by not executing the submitted task.
- execute(Runnable) - Method in class org.jtrim2.executor.GenericUpdateTaskExecutor
-
Submits a task which is to be executed in the future.
- execute(CancellationToken, CancelableTask) - Method in interface org.jtrim2.executor.TaskExecutor
-
Executes the task at some time in the future.
- execute(Runnable) - Method in interface org.jtrim2.executor.TaskExecutor
-
Note that although the task itself is not cancelable explicitly, the executor might cancel
it by not executing the submitted task.
- execute(Runnable) - Method in interface org.jtrim2.executor.UpdateTaskExecutor
-
Submits a task which is to be executed in the future.
- executeCurrentlySubmitted() - Method in class org.jtrim2.executor.ManualTaskExecutor
-
Executes every currently submitted task found in the task queue.
- executeFunction(CancellationToken, CancelableFunction<? extends V>) - Method in class org.jtrim2.executor.AbstractTaskExecutor
-
Executes the function at some time in the future.
- executeFunction(CancellationToken, CancelableFunction<? extends V>) - Method in class org.jtrim2.executor.AbstractTaskExecutorService
-
Executes the function at some time in the future.
- executeFunction(CancellationToken, CancelableFunction<? extends V>) - Method in class org.jtrim2.executor.ContextAwareWrapper
-
Executes the function at some time in the future.
- executeFunction(CancellationToken, CancelableFunction<? extends V>) - Method in class org.jtrim2.executor.DelegatedTaskExecutorService
-
Executes the function at some time in the future.
- executeFunction(CancellationToken, CancelableFunction<? extends V>) - Method in interface org.jtrim2.executor.TaskExecutor
-
Executes the function at some time in the future.
- executeStaged(Runnable) - Method in class org.jtrim2.executor.DelegatedTaskExecutorService
-
- executeStaged(Runnable) - Method in interface org.jtrim2.executor.TaskExecutor
-
Executes an non-cancelable task at some time in the future.
- ExecutorConverter - Class in org.jtrim2.executor
-
Defines static method to convert between the executors of JTrim and
the executors of Java.
- ExecutorsEx - Class in org.jtrim2.executor
-
This class contains static helper and factory methods for Executors
and ExecutorServices.
- ExecutorsEx.NamedThreadFactory - Class in org.jtrim2.executor
-
A ThreadFactory which creates thread with names containing a
specified string and a given daemon status and also belong to the same
thread group.
- GenericUpdateTaskExecutor - Class in org.jtrim2.executor
-
An UpdateTaskExecutor implementation which forwards tasks scheduled
to it to a given Executor or TaskExecutor.
- GenericUpdateTaskExecutor(Executor) - Constructor for class org.jtrim2.executor.GenericUpdateTaskExecutor
-
Creates a new GenericUpdateTaskExecutor which will forward its
tasks to the given TaskExecutor.
- get() - Method in class org.jtrim2.executor.DoneFuture
-
This method returns the result specified at construction time.
- get(long, TimeUnit) - Method in class org.jtrim2.executor.DoneFuture
-
This method returns the result specified at construction time.
- getDefaultInstance() - Static method in class org.jtrim2.executor.SyncTaskExecutor
-
Returns an TaskExecutorService which executes tasks synchronously
on the calling thread and cannot be shutted down.
- getFuture() - Method in class org.jtrim2.executor.AbstractTaskExecutor.SubmittedTask
-
Returns the future of the submitted task.
- getIdleTimeout(TimeUnit) - Method in class org.jtrim2.executor.SingleThreadedExecutor
-
Returns the currently set timeout value after idle threads should stop.
- getIdleTimeout(TimeUnit) - Method in class org.jtrim2.executor.ThreadPoolTaskExecutor
-
Returns the currently set timeout value after idle threads should stop.
- getMaxQueueSize() - Method in class org.jtrim2.executor.SingleThreadedExecutor
-
Returns the currently set maximum size for the queue of tasks scheduled
to be executed.
- getMaxQueueSize() - Method in class org.jtrim2.executor.ThreadPoolTaskExecutor
-
Returns the currently set maximum size for the queue of tasks scheduled
to be executed.
- getMaxThreadCount() - Method in class org.jtrim2.executor.ThreadPoolTaskExecutor
-
Returns the currently set maximum thread to be used by this executor.
- getNumberOfExecutingTasks() - Method in interface org.jtrim2.executor.MonitorableTaskExecutor
-
Returns the approximate number of tasks currently being executed.
- getNumberOfExecutingTasks() - Method in class org.jtrim2.executor.SingleThreadedExecutor
-
Returns the approximate number of tasks currently being executed.
- getNumberOfExecutingTasks() - Method in class org.jtrim2.executor.SyncTaskExecutor
-
Returns the approximate number of tasks currently being executed.
- getNumberOfExecutingTasks() - Method in class org.jtrim2.executor.ThreadPoolTaskExecutor
-
Returns the approximate number of tasks currently being executed.
- getNumberOfQueuedTasks() - Method in interface org.jtrim2.executor.MonitorableTaskExecutor
-
Returns the approximate number of tasks currently queued to this
executor.
- getNumberOfQueuedTasks() - Method in class org.jtrim2.executor.SingleThreadedExecutor
-
Returns the approximate number of tasks currently queued to this
executor.
- getNumberOfQueuedTasks() - Method in class org.jtrim2.executor.SyncTaskExecutor
-
Returns the approximate number of tasks currently queued to this
executor.
- getNumberOfQueuedTasks() - Method in class org.jtrim2.executor.ThreadPoolTaskExecutor
-
Returns the approximate number of tasks currently queued to this
executor.
- getPoolName() - Method in class org.jtrim2.executor.SingleThreadedExecutor
-
Returns the name of this SingleThreadedExecutor as specified at
construction time.
- getPoolName() - Method in class org.jtrim2.executor.ThreadPoolTaskExecutor
-
Returns the name of this ThreadPoolTaskExecutor as specified at
construction time.
- getSimpleExecutor() - Static method in class org.jtrim2.executor.SyncTaskExecutor
-
Returns a plain and efficient TaskExecutor which executes tasks
synchronously on the calling thread.
- inOrderExecutor(TaskExecutor) - Static method in class org.jtrim2.executor.TaskExecutors
-
Returns an executor which forwards task to a given executor and executes
tasks without running them concurrently.
- inOrderSimpleExecutor(TaskExecutor) - Static method in class org.jtrim2.executor.TaskExecutors
-
- inOrderSyncExecutor() - Static method in class org.jtrim2.executor.TaskExecutors
-
Returns an executor which invokes tasks in the order they were scheduled
to it.
- isCancelled() - Method in class org.jtrim2.executor.DoneFuture
-
This method does nothing but returns false.
- isCurrentThreadDispatching() - Method in class org.jtrim2.executor.TaskScheduler
-
Checks whether this method was invoked from a
dispatchTasks() method call (i.e.: a task is
being submitted on the current calling thread).
- isDone() - Method in class org.jtrim2.executor.DoneFuture
-
This method does nothing but returns true.
- isExecutingInThis() - Method in interface org.jtrim2.executor.ContextAwareTaskExecutor
-
Returns true if the calling code is executing in the context of
this executor.
- isExecutingInThis() - Method in class org.jtrim2.executor.ContextAwareWrapper
-
Returns true if the calling code is executing in the context of
this executor.
- isExecutingInThis() - Method in class org.jtrim2.executor.SingleThreadedExecutor
-
Returns true if the calling code is executing in the context of
this executor.
- isExecutingInThis() - Method in class org.jtrim2.executor.SyncTaskExecutor
-
Returns true if the calling code is executing in the context of
this executor.
- isExecutingInThis() - Method in class org.jtrim2.executor.ThreadPoolTaskExecutor
-
Returns true if the calling code is executing in the context of
this executor.
- isShutdown() - Method in class org.jtrim2.executor.DelegatedTaskExecutorService
-
Checks whether this TaskExecutorService accepts newly submitted
tasks or not.
- isShutdown() - Method in interface org.jtrim2.executor.TaskExecutorService
-
Checks whether this TaskExecutorService accepts newly submitted
tasks or not.
- isTerminated() - Method in class org.jtrim2.executor.DelegatedTaskExecutorService
-
Checks whether this TaskExecutorService may execute tasks
submitted to it tasks or not.
- isTerminated() - Method in interface org.jtrim2.executor.TaskExecutorService
-
Checks whether this TaskExecutorService may execute tasks
submitted to it tasks or not.
- NamedThreadFactory(boolean) - Constructor for class org.jtrim2.executor.ExecutorsEx.NamedThreadFactory
-
Creates a new thread factory with the specified daemon status and
a default name.
- NamedThreadFactory(boolean, String) - Constructor for class org.jtrim2.executor.ExecutorsEx.NamedThreadFactory
-
Creates a new thread factory with the specified daemon status and
name.
- newMultiThreadedExecutor(int, boolean) - Static method in class org.jtrim2.executor.ExecutorsEx
-
Creates a new ThreadPoolExecutor which will use at most the
specified maximum thread count and daemon status.
- newMultiThreadedExecutor(int, boolean, String) - Static method in class org.jtrim2.executor.ExecutorsEx
-
Creates a new ThreadPoolExecutor which will use at most the
specified maximum thread count, daemon status and name.
- newMultiThreadedExecutor(int, long, boolean) - Static method in class org.jtrim2.executor.ExecutorsEx
-
Creates a new ThreadPoolExecutor which will use at most the
specified maximum thread count, daemon status, and thread keep alive
time.
- newMultiThreadedExecutor(int, long, boolean, String) - Static method in class org.jtrim2.executor.ExecutorsEx
-
Creates a new ThreadPoolExecutor which will use at most the
specified maximum thread count, daemon status, name and thread keep alive
time.
- newSchedulerThreadedExecutor(int, boolean) - Static method in class org.jtrim2.executor.ExecutorsEx
-
Creates a new ScheduledThreadPoolExecutor which will use at most
the specified maximum thread count and daemon status.
- newSchedulerThreadedExecutor(int, boolean, String) - Static method in class org.jtrim2.executor.ExecutorsEx
-
Creates a new ScheduledThreadPoolExecutor which will use at most
the specified maximum thread count, daemon status and name.
- newSyncScheduler() - Static method in class org.jtrim2.executor.TaskScheduler
-
A convenience method effectively equivalent to
new TaskScheduler(SyncTaskExecutor.getSimpleExecutor()).
- newThread(Runnable) - Method in class org.jtrim2.executor.ExecutorsEx.NamedThreadFactory
-
Creates a new thread with the properties given in the constructor.
- noOpCancelableTask() - Static method in class org.jtrim2.executor.CancelableTasks
-
Returns a CancelableTask whose execute method does
nothing but returns immediately to the caller.
- notifyTerminateListeners() - Method in class org.jtrim2.executor.AbstractTerminateNotifierTaskExecutorService
-
Notifies the currently registered terminate listeners.
- sameContextExecutor(TaskExecutor) - Method in class org.jtrim2.executor.ContextAwareWrapper
-
Returns an executor which submits tasks to the given executor and
executes tasks in the same context as this executor.
- scheduleTask(Runnable) - Method in class org.jtrim2.executor.TaskScheduler
-
Schedules a single task for submitting to the executor specified at
construction time.
- scheduleTasks(List<? extends Runnable>) - Method in class org.jtrim2.executor.TaskScheduler
-
Schedules a list of tasks for submitting to the executor specified at
construction time.
- setIdleTimeout(long, TimeUnit) - Method in class org.jtrim2.executor.SingleThreadedExecutor
-
Sets the timeout value after idle threads should terminate.
- setIdleTimeout(long, TimeUnit) - Method in class org.jtrim2.executor.ThreadPoolTaskExecutor
-
Sets the timeout value after idle threads should terminate.
- setMaxQueueSize(int) - Method in class org.jtrim2.executor.SingleThreadedExecutor
-
Sets the maximum number of tasks allowed to be stored in the internal
queue.
- setMaxQueueSize(int) - Method in class org.jtrim2.executor.ThreadPoolTaskExecutor
-
Sets the maximum number of tasks allowed to be stored in the internal
queue.
- setMaxThreadCount(int) - Method in class org.jtrim2.executor.ThreadPoolTaskExecutor
-
Sets the maximum number of threads allowed to execute submitted tasks concurrently.
- setThreadFactory(ThreadFactory) - Method in class org.jtrim2.executor.SingleThreadedExecutor
-
Sets the ThreadFactory which is used to create worker threads
for this executor.
- setThreadFactory(ThreadFactory) - Method in class org.jtrim2.executor.ThreadPoolTaskExecutor
-
Sets the ThreadFactory which is used to create worker threads
for this executor.
- shutdown() - Method in class org.jtrim2.executor.DelegatedTaskExecutorService
-
Shuts down this TaskExecutorService, so that it will not execute
tasks submitted to it after this method call returns.
- shutdown() - Method in class org.jtrim2.executor.SingleThreadedExecutor
-
Shuts down this TaskExecutorService, so that it will not execute
tasks submitted to it after this method call returns.
- shutdown() - Method in interface org.jtrim2.executor.TaskExecutorService
-
Shuts down this TaskExecutorService, so that it will not execute
tasks submitted to it after this method call returns.
- shutdown() - Method in class org.jtrim2.executor.ThreadPoolTaskExecutor
-
Shuts down this TaskExecutorService, so that it will not execute
tasks submitted to it after this method call returns.
- shutdownAndCancel() - Method in class org.jtrim2.executor.DelegatedTaskExecutorService
-
Shuts down this TaskExecutorService and cancels already
submitted tasks, so that it will not execute tasks submitted to it after
this method call returns.
- shutdownAndCancel() - Method in class org.jtrim2.executor.SingleThreadedExecutor
-
Shuts down this TaskExecutorService and cancels already
submitted tasks, so that it will not execute tasks submitted to it after
this method call returns.
- shutdownAndCancel() - Method in interface org.jtrim2.executor.TaskExecutorService
-
Shuts down this TaskExecutorService and cancels already
submitted tasks, so that it will not execute tasks submitted to it after
this method call returns.
- shutdownAndCancel() - Method in class org.jtrim2.executor.ThreadPoolTaskExecutor
-
Shuts down this TaskExecutorService and cancels already
submitted tasks, so that it will not execute tasks submitted to it after
this method call returns.
- shutdownExecutorsNow(ExecutorService...) - Static method in class org.jtrim2.executor.ExecutorsEx
-
- shutdownExecutorsNow(Collection<? extends ExecutorService>) - Static method in class org.jtrim2.executor.ExecutorsEx
-
Invokes the
shutdownNow()
method of all the executors in the given collection.
- SingleThreadedExecutor - Class in org.jtrim2.executor
-
Defines a TaskExecutorService executing submitted tasks on a single
background thread.
- SingleThreadedExecutor(String) - Constructor for class org.jtrim2.executor.SingleThreadedExecutor
-
Creates a new SingleThreadedExecutor initialized with the
specified name.
- SingleThreadedExecutor(String, int) - Constructor for class org.jtrim2.executor.SingleThreadedExecutor
-
Creates a new SingleThreadedExecutor initialized with the given
properties.
- SingleThreadedExecutor(String, int, long, TimeUnit) - Constructor for class org.jtrim2.executor.SingleThreadedExecutor
-
Creates a new SingleThreadedExecutor initialized with the given
properties.
- submitTask(CancellationToken, AbstractTaskExecutor.SubmittedTask<?>) - Method in class org.jtrim2.executor.AbstractTaskExecutor
-
Implementations must override this method to actually execute submitted
tasks.
- submitTask(CancellationToken, AbstractTaskExecutor.SubmittedTask<?>) - Method in class org.jtrim2.executor.ManualTaskExecutor
-
Implementations must override this method to actually execute submitted
tasks.
- SubmittedTask(CancelableFunction<? extends V>) - Constructor for class org.jtrim2.executor.AbstractTaskExecutor.SubmittedTask
-
Creates a new SubmittedTask with the given underlying function.
- SyncTaskExecutor - Class in org.jtrim2.executor
-
Defines an executor which executes tasks synchronously on the calling thread
which submits them (by the execute or one of the submit
methods).
- SyncTaskExecutor() - Constructor for class org.jtrim2.executor.SyncTaskExecutor
-
Creates a new executor which executes tasks synchronously on the calling
thread.
- TaskExecutor - Interface in org.jtrim2.executor
-
Executes tasks at some time in the future.
- TaskExecutors - Class in org.jtrim2.executor
-
- TaskExecutorService - Interface in org.jtrim2.executor
-
Defines a
TaskExecutor with additional methods to better manage
submitted tasks.
- TaskScheduler - Class in org.jtrim2.executor
-
- TaskScheduler(Executor) - Constructor for class org.jtrim2.executor.TaskScheduler
-
Creates a new task scheduler (without any task scheduled) with the given
backing executor.
- ThreadPoolTaskExecutor - Class in org.jtrim2.executor
-
- ThreadPoolTaskExecutor(String) - Constructor for class org.jtrim2.executor.ThreadPoolTaskExecutor
-
Creates a new ThreadPoolTaskExecutor initialized with specified
name.
- ThreadPoolTaskExecutor(String, int) - Constructor for class org.jtrim2.executor.ThreadPoolTaskExecutor
-
Creates a new ThreadPoolTaskExecutor initialized with the given
properties.
- ThreadPoolTaskExecutor(String, int, int) - Constructor for class org.jtrim2.executor.ThreadPoolTaskExecutor
-
Creates a new ThreadPoolTaskExecutor initialized with the given
properties.
- ThreadPoolTaskExecutor(String, int, int, long, TimeUnit) - Constructor for class org.jtrim2.executor.ThreadPoolTaskExecutor
-
Creates a new ThreadPoolTaskExecutor initialized with the given
properties.
- toAsync(TaskExecutor, CancelableFunction<? extends R>) - Static method in class org.jtrim2.executor.CancelableTasks
-
Returns an asynchronous task executing the given synchronous task on the given executor.
- toString() - Method in class org.jtrim2.executor.DelegatedTaskExecutorService
- toString() - Method in class org.jtrim2.executor.GenericUpdateTaskExecutor
-
Returns the string representation of this executor in no particular
format.
- toString() - Method in class org.jtrim2.executor.TaskScheduler
-
Returns the string representation of this TaskScheduler in no
particular format.
- toString() - Method in class org.jtrim2.executor.ThreadPoolTaskExecutor
-
Returns the string representation of this executor in no particular
format.
- tryAwaitTermination(CancellationToken, long, TimeUnit) - Method in class org.jtrim2.executor.DelegatedTaskExecutorService
-
Waits until this TaskExecutorService will not execute any more
tasks or the given timeout elapses.
- tryAwaitTermination(CancellationToken, long, TimeUnit) - Method in interface org.jtrim2.executor.TaskExecutorService
-
Waits until this TaskExecutorService will not execute any more
tasks or the given timeout elapses.
- tryExecuteOne() - Method in class org.jtrim2.executor.ManualTaskExecutor
-
Removes a single task from the task queue of this executor and executes
it (along with its completion handler) unless the queue is empty.
- tryGetResult() - Method in class org.jtrim2.executor.FutureResultHolder
-
Returns the result of the computation if it is available or null
if it is not.
- trySetError(Throwable) - Method in class org.jtrim2.executor.FutureResultHolder
-
Signals the the computation has failed and the failure is described by
the specified exception.
- tryStoreResult(ResultType) - Method in class org.jtrim2.executor.FutureResultHolder
-
Stores the result of a computation if it has not completed yet.