Top Description Fields Constructors Methods
io.opentelemetry.context

pack-priv abstract Class ForwardingExecutorService

extends Object
implements ExecutorService
Class Inheritance
All Implemented Interfaces
java.util.concurrent.ExecutorService, java.lang.AutoCloseable, java.util.concurrent.Executor
Known Direct Subclasses
io.opentelemetry.context.ContextExecutorService, io.opentelemetry.context.CurrentContextExecutorService
Imports
java.util.ArrayList, .Collection, .List, java.util.concurrent.Callable, .ExecutorService, .TimeUnit

A ExecutorService that implements methods that don't need Context.

Field Summary

Modifier and TypeField and Description
private final ExecutorService

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public final boolean
awaitTermination(long
the maximum time to wait
timeout
,
TimeUnit
the time unit of the timeout argument
unit
)

Implements java.util.concurrent.ExecutorService.awaitTermination.

Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.

pack-priv ExecutorService
public final boolean
isShutdown()

Implements java.util.concurrent.ExecutorService.isShutdown.

Returns true if this executor has been shut down.

public final boolean
isTerminated()

Implements java.util.concurrent.ExecutorService.isTerminated.

Returns true if all tasks have completed following shut down.

public final void
shutdown()

Implements java.util.concurrent.ExecutorService.shutdown.

Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted.

public final List<Runnable>
shutdownNow()

Implements java.util.concurrent.ExecutorService.shutdownNow.

Attempts to stop all actively executing tasks, halts the processing of waiting tasks, and returns a list of the tasks that were awaiting execution.

protected static <T> Collection<? extends Callable<T>>
wrap(Context context, Collection<? extends Callable<T>> tasks)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

delegateback to summary
private final ExecutorService delegate

Constructor Detail

ForwardingExecutorServiceback to summary
protected ForwardingExecutorService(ExecutorService delegate)

Method Detail

awaitTerminationback to summary
public final boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException

Implements java.util.concurrent.ExecutorService.awaitTermination.

Doc from java.util.concurrent.ExecutorService.awaitTermination.

Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.

Parameters
timeout:long

the maximum time to wait

unit:TimeUnit

the time unit of the timeout argument

Returns:boolean

true if this executor terminated and false if the timeout elapsed before termination

Annotations
@Override
Exceptions
InterruptedException:
if interrupted while waiting
delegateback to summary
pack-priv ExecutorService delegate()
isShutdownback to summary
public final boolean isShutdown()

Implements java.util.concurrent.ExecutorService.isShutdown.

Doc from java.util.concurrent.ExecutorService.isShutdown.

Returns true if this executor has been shut down.

Returns:boolean

true if this executor has been shut down

Annotations
@Override
isTerminatedback to summary
public final boolean isTerminated()

Implements java.util.concurrent.ExecutorService.isTerminated.

Doc from java.util.concurrent.ExecutorService.isTerminated.

Returns true if all tasks have completed following shut down. Note that isTerminated is never true unless either shutdown or shutdownNow was called first.

Returns:boolean

true if all tasks have completed following shut down

Annotations
@Override
shutdownback to summary
public final void shutdown()

Implements java.util.concurrent.ExecutorService.shutdown.

Doc from java.util.concurrent.ExecutorService.shutdown.

Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted. Invocation has no additional effect if already shut down.

This method does not wait for previously submitted tasks to complete execution. Use awaitTermination to do that.

Annotations
@Override
shutdownNowback to summary
public final List<Runnable> shutdownNow()

Implements java.util.concurrent.ExecutorService.shutdownNow.

Doc from java.util.concurrent.ExecutorService.shutdownNow.

Attempts to stop all actively executing tasks, halts the processing of waiting tasks, and returns a list of the tasks that were awaiting execution.

This method does not wait for actively executing tasks to terminate. Use awaitTermination to do that.

There are no guarantees beyond best-effort attempts to stop processing actively executing tasks. For example, typical implementations will cancel via Thread#interrupt, so any task that fails to respond to interrupts may never terminate.

Returns:List<Runnable>

list of tasks that never commenced execution

Annotations
@Override
wrapback to summary
protected static <T> Collection<? extends Callable<T>> wrap(Context context, Collection<? extends Callable<T>> tasks)