Dela via


Executors Class

Definition

Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory, and Callable classes defined in this package.

[Android.Runtime.Register("java/util/concurrent/Executors", DoNotGenerateAcw=true)]
public class Executors : Java.Lang.Object
[<Android.Runtime.Register("java/util/concurrent/Executors", DoNotGenerateAcw=true)>]
type Executors = class
    inherit Object
Inheritance
Executors
Attributes

Remarks

Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory, and Callable classes defined in this package. This class supports the following kinds of methods:

<ul> <li>Methods that create and return an ExecutorService set up with commonly useful configuration settings. <li>Methods that create and return a ScheduledExecutorService set up with commonly useful configuration settings. <li>Methods that create and return a "wrapped" ExecutorService, that disables reconfiguration by making implementation-specific methods inaccessible. <li>Methods that create and return a ThreadFactory that sets newly created threads to a known state. <li>Methods that create and return a Callable out of other closure-like forms, so they can be used in execution methods requiring Callable. </ul>

Added in 1.5.

Java documentation for java.util.concurrent.Executors.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

Executors(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

Callable(IPrivilegedAction)

Returns a Callable object that, when called, runs the given privileged action and returns its result.

Callable(IPrivilegedExceptionAction)

Returns a Callable object that, when called, runs the given privileged exception action and returns its result.

Callable(IRunnable, Object)

Returns a Callable object that, when called, runs the given task and returns the given result.

Callable(IRunnable)

Returns a Callable object that, when called, runs the given task and returns null.

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
DefaultThreadFactory()

Returns a default thread factory used to create new threads.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
NewCachedThreadPool()

Creates a thread pool that creates new threads as needed, but will reuse previously constructed threads when they are available.

NewCachedThreadPool(IThreadFactory)

Creates a thread pool that creates new threads as needed, but will reuse previously constructed threads when they are available, and uses the provided ThreadFactory to create new threads when needed.

NewFixedThreadPool(Int32, IThreadFactory)

Creates a thread pool that reuses a fixed number of threads operating off a shared unbounded queue, using the provided ThreadFactory to create new threads when needed.

NewFixedThreadPool(Int32)

Creates a thread pool that reuses a fixed number of threads operating off a shared unbounded queue.

NewScheduledThreadPool(Int32, IThreadFactory)

Creates a thread pool that can schedule commands to run after a given delay, or to execute periodically.

NewScheduledThreadPool(Int32)

Creates a thread pool that can schedule commands to run after a given delay, or to execute periodically.

NewSingleThreadExecutor()

Creates an Executor that uses a single worker thread operating off an unbounded queue.

NewSingleThreadExecutor(IThreadFactory)

Creates an Executor that uses a single worker thread operating off an unbounded queue, and uses the provided ThreadFactory to create a new thread when needed.

NewSingleThreadScheduledExecutor()

Creates a single-threaded executor that can schedule commands to run after a given delay, or to execute periodically.

NewSingleThreadScheduledExecutor(IThreadFactory)

Creates a single-threaded executor that can schedule commands to run after a given delay, or to execute periodically.

NewWorkStealingPool()

Creates a work-stealing thread pool using the number of Runtime#availableProcessors available processors as its target parallelism level.

NewWorkStealingPool(Int32)

Creates a thread pool that maintains enough threads to support the given parallelism level, and may use multiple queues to reduce contention.

Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
PrivilegedCallable(ICallable)

Legacy security code; do not use.

PrivilegedCallableUsingCurrentClassLoader(ICallable)

Legacy security code; do not use.

PrivilegedThreadFactory()

Legacy security code; do not use.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnconfigurableExecutorService(IExecutorService)

Returns an object that delegates all defined ExecutorService methods to the given executor, but not any other methods that might otherwise be accessible using casts.

UnconfigurableScheduledExecutorService(IScheduledExecutorService)

Returns an object that delegates all defined ScheduledExecutorService methods to the given executor, but not any other methods that might otherwise be accessible using casts.

UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to