public class Task extends NetObject implements java.lang.AutoCloseable
.NET documentation at https://docs.microsoft.com/en-us/dotnet/api/System.Threading.Tasks.Task
Powered by JCOBridge: more info at https://www.jcobridge.com
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
assemblyFullName
Fully assembly qualified name: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
|
static java.lang.String |
assemblyShortName
Assembly name: mscorlib
|
static java.lang.String |
className
Qualified class name: System.Threading.Tasks.Task
|
static JCType |
classType
The type managed from JCOBridge.
|
| Constructor and Description |
|---|
Task() |
Task(Action action) |
Task(Action action,
CancellationToken cancellationToken) |
Task(Action action,
CancellationToken cancellationToken,
TaskCreationOptions creationOptions) |
Task(Action action,
TaskCreationOptions creationOptions) |
Task(java.lang.Object instance)
Internal constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static Task |
cast(IJCOBridgeReflected from)
Try to cast the
IJCOBridgeReflected instance into Task, a cast assert is made to check if types are compatible. |
void |
close() |
ConfiguredTaskAwaitable |
ConfigureAwait(boolean continueOnCapturedContext) |
static Task |
Delay(int millisecondsDelay) |
static Task |
Delay(int millisecondsDelay,
CancellationToken cancellationToken) |
static Task |
Delay(TimeSpan delay) |
static Task |
Delay(TimeSpan delay,
CancellationToken cancellationToken) |
void |
Dispose() |
static Task |
FromCanceled(CancellationToken cancellationToken) |
static Task |
FromException(NetException exception) |
NetObject |
getAsyncState() |
TaskAwaiter |
GetAwaiter() |
static Task |
getCompletedTask() |
TaskCreationOptions |
getCreationOptions() |
AggregateException |
getException() |
static TaskFactory |
getFactory() |
int |
getId() |
boolean |
getIsCanceled() |
boolean |
getIsCompleted() |
boolean |
getIsFaulted() |
java.lang.String |
getJCOAssemblyName()
Returns the reflected Assembly name
|
java.lang.String |
getJCOClassName()
Returns the reflected Class name
|
java.lang.Object |
getJCOInstance()
Returns the instantiated class
|
java.lang.String |
getJCOObjectName()
Returns the reflected Class name used to build the object
|
JCType |
getJCOType()
Returns the instantiated class Type
|
TaskStatus |
getStatus() |
static Task |
Run(Action action) |
static Task |
Run(Action action,
CancellationToken cancellationToken) |
void |
RunSynchronously() |
void |
RunSynchronously(TaskScheduler scheduler) |
void |
setJCOInstance(JCObject instance) |
void |
Start() |
void |
Start(TaskScheduler scheduler) |
void |
Wait() |
void |
Wait(CancellationToken cancellationToken) |
boolean |
Wait(int millisecondsTimeout) |
boolean |
Wait(int millisecondsTimeout,
CancellationToken cancellationToken) |
boolean |
Wait(TimeSpan timeout) |
static void |
WaitAll(Task... tasks) |
static void |
WaitAll(Task[] tasks,
CancellationToken cancellationToken) |
static boolean |
WaitAll(Task[] tasks,
int millisecondsTimeout) |
static boolean |
WaitAll(Task[] tasks,
int millisecondsTimeout,
CancellationToken cancellationToken) |
static boolean |
WaitAll(Task[] tasks,
TimeSpan timeout) |
static int |
WaitAny(Task... tasks) |
static int |
WaitAny(Task[] tasks,
CancellationToken cancellationToken) |
static int |
WaitAny(Task[] tasks,
int millisecondsTimeout) |
static int |
WaitAny(Task[] tasks,
int millisecondsTimeout,
CancellationToken cancellationToken) |
static int |
WaitAny(Task[] tasks,
TimeSpan timeout) |
static Task |
WhenAll(Task... tasks) |
static YieldAwaitable |
Yield() |
public static final java.lang.String assemblyFullName
public static final java.lang.String assemblyShortName
public static final java.lang.String className
public Task()
throws java.lang.Throwable
java.lang.Throwablepublic Task(Action action) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, InvalidOperationException, ArgumentException, ObjectDisposedException, AbandonedMutexException, NullReferenceException
public Task(Action action, CancellationToken cancellationToken) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, InvalidOperationException, ArgumentException, ObjectDisposedException, AbandonedMutexException, NullReferenceException
public Task(Action action, CancellationToken cancellationToken, TaskCreationOptions creationOptions) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, InvalidOperationException, ArgumentException, ObjectDisposedException, AbandonedMutexException, NullReferenceException
public Task(Action action, TaskCreationOptions creationOptions) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, InvalidOperationException, ArgumentException, ObjectDisposedException, AbandonedMutexException, NullReferenceException
public Task(java.lang.Object instance)
throws java.lang.Throwable
java.lang.Throwablepublic static Task cast(IJCOBridgeReflected from) throws java.lang.Throwable
IJCOBridgeReflected instance into Task, a cast assert is made to check if types are compatible.from - IJCOBridgeReflected instance to be castedTask instancejava.lang.Throwable - in case of error during cast operationpublic void close()
throws java.lang.Exception
close in interface java.lang.AutoCloseablejava.lang.Exceptionpublic ConfiguredTaskAwaitable ConfigureAwait(boolean continueOnCapturedContext) throws java.lang.Throwable
java.lang.Throwablepublic static Task Delay(int millisecondsDelay) throws java.lang.Throwable, ArgumentOutOfRangeException, ArgumentNullException, ArgumentException, ObjectDisposedException, InvalidOperationException, MissingMethodException, TargetInvocationException, SecurityException, NullReferenceException
public static Task Delay(int millisecondsDelay, CancellationToken cancellationToken) throws java.lang.Throwable, ArgumentOutOfRangeException, EventSourceException, ArgumentNullException, ArgumentException, ObjectDisposedException, AbandonedMutexException, InvalidOperationException, MissingMethodException, TargetInvocationException, SecurityException, NullReferenceException
public static Task Delay(TimeSpan delay) throws java.lang.Throwable, ArgumentOutOfRangeException, ArgumentException, ArgumentNullException, InvalidOperationException, NullReferenceException, ObjectDisposedException
public static Task Delay(TimeSpan delay, CancellationToken cancellationToken) throws java.lang.Throwable, ArgumentOutOfRangeException, ArgumentNullException, ArgumentException, ObjectDisposedException, InvalidOperationException, MissingMethodException, TargetInvocationException, SecurityException, NullReferenceException
public void Dispose()
throws java.lang.Throwable,
InvalidOperationException,
ObjectDisposedException,
AbandonedMutexException,
ArgumentException,
ArgumentNullException,
NotSupportedException,
ArgumentOutOfRangeException,
FileNotFoundException,
DirectoryNotFoundException,
UnauthorizedAccessException,
IOException,
PathTooLongException,
DriveNotFoundException,
OperationCanceledException
java.lang.ThrowableInvalidOperationExceptionObjectDisposedExceptionAbandonedMutexExceptionArgumentExceptionArgumentNullExceptionNotSupportedExceptionArgumentOutOfRangeExceptionFileNotFoundExceptionDirectoryNotFoundExceptionUnauthorizedAccessExceptionIOExceptionPathTooLongExceptionDriveNotFoundExceptionOperationCanceledExceptionpublic static Task FromCanceled(CancellationToken cancellationToken) throws java.lang.Throwable, ArgumentOutOfRangeException
java.lang.ThrowableArgumentOutOfRangeExceptionpublic static Task FromException(NetException exception) throws java.lang.Throwable, ArgumentNullException, InvalidOperationException, ArgumentOutOfRangeException, ObjectDisposedException, AbandonedMutexException, ArgumentException, MulticastNotSupportedException
public NetObject getAsyncState() throws java.lang.Throwable
java.lang.Throwablepublic TaskAwaiter GetAwaiter() throws java.lang.Throwable
java.lang.Throwablepublic static Task getCompletedTask() throws java.lang.Throwable
java.lang.Throwablepublic TaskCreationOptions getCreationOptions() throws java.lang.Throwable
java.lang.Throwablepublic AggregateException getException() throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, ArgumentException
java.lang.ThrowableArgumentNullExceptionArgumentOutOfRangeExceptionArgumentExceptionpublic static TaskFactory getFactory() throws java.lang.Throwable
java.lang.Throwablepublic int getId()
throws java.lang.Throwable,
IndexOutOfRangeException,
EventSourceException,
ArgumentNullException,
OutOfMemoryException,
ArgumentException,
ArgumentOutOfRangeException,
InvalidOperationException,
NotSupportedException
public boolean getIsCanceled()
throws java.lang.Throwable
java.lang.Throwablepublic boolean getIsCompleted()
throws java.lang.Throwable
java.lang.Throwablepublic boolean getIsFaulted()
throws java.lang.Throwable
java.lang.Throwablepublic java.lang.String getJCOAssemblyName()
IJCOBridgeReflectedgetJCOAssemblyName in interface IJCOBridgeReflectedgetJCOAssemblyName in class NetObjectString representing the Fullname of reflected Assemblypublic java.lang.String getJCOClassName()
IJCOBridgeReflectedgetJCOClassName in interface IJCOBridgeReflectedgetJCOClassName in class NetObjectString representing the Fullname of reflected Classpublic java.lang.Object getJCOInstance()
IJCOBridgeReflectedgetJCOInstance in interface IJCOBridgeReflectedgetJCOInstance in class NetObjectObject representing the CLR instance of the instantiated Classpublic java.lang.String getJCOObjectName()
IJCOBridgeReflectedgetJCOObjectName in interface IJCOBridgeReflectedgetJCOObjectName in class NetObjectString representing the name used to allocated the object
in CLR contextpublic JCType getJCOType()
IJCOBridgeReflectedgetJCOType in interface IJCOBridgeReflectedgetJCOType in class NetObjectJCType representing the CLR Type of the instantiated Classpublic TaskStatus getStatus() throws java.lang.Throwable
java.lang.Throwablepublic static Task Run(Action action) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, InvalidOperationException, ArgumentException, ObjectDisposedException, NotSupportedException, FormatException, IndexOutOfRangeException, EventSourceException, OutOfMemoryException, MulticastNotSupportedException, TaskSchedulerException
java.lang.ThrowableArgumentNullExceptionArgumentOutOfRangeExceptionInvalidOperationExceptionArgumentExceptionObjectDisposedExceptionNotSupportedExceptionFormatExceptionIndexOutOfRangeExceptionEventSourceExceptionOutOfMemoryExceptionMulticastNotSupportedExceptionTaskSchedulerExceptionpublic static Task Run(Action action, CancellationToken cancellationToken) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, InvalidOperationException, ArgumentException, ObjectDisposedException, NotSupportedException, FormatException, IndexOutOfRangeException, EventSourceException, OutOfMemoryException, MulticastNotSupportedException, TaskSchedulerException
java.lang.ThrowableArgumentNullExceptionArgumentOutOfRangeExceptionInvalidOperationExceptionArgumentExceptionObjectDisposedExceptionNotSupportedExceptionFormatExceptionIndexOutOfRangeExceptionEventSourceExceptionOutOfMemoryExceptionMulticastNotSupportedExceptionTaskSchedulerExceptionpublic void RunSynchronously()
throws java.lang.Throwable,
InvalidOperationException,
ArgumentOutOfRangeException,
ArgumentNullException,
ObjectDisposedException,
AbandonedMutexException,
FormatException,
ArgumentException,
OperationCanceledException,
NullReferenceException,
MulticastNotSupportedException,
FileNotFoundException,
DirectoryNotFoundException,
UnauthorizedAccessException,
IOException,
PathTooLongException,
DriveNotFoundException
java.lang.ThrowableInvalidOperationExceptionArgumentOutOfRangeExceptionArgumentNullExceptionObjectDisposedExceptionAbandonedMutexExceptionFormatExceptionArgumentExceptionOperationCanceledExceptionNullReferenceExceptionMulticastNotSupportedExceptionFileNotFoundExceptionDirectoryNotFoundExceptionUnauthorizedAccessExceptionIOExceptionPathTooLongExceptionDriveNotFoundExceptionpublic void RunSynchronously(TaskScheduler scheduler) throws java.lang.Throwable, ArgumentNullException, InvalidOperationException, ArgumentOutOfRangeException, ObjectDisposedException, AbandonedMutexException, FormatException, ArgumentException, OperationCanceledException, NullReferenceException, MulticastNotSupportedException, FileNotFoundException, DirectoryNotFoundException, UnauthorizedAccessException, IOException, PathTooLongException, DriveNotFoundException
java.lang.ThrowableArgumentNullExceptionInvalidOperationExceptionArgumentOutOfRangeExceptionObjectDisposedExceptionAbandonedMutexExceptionFormatExceptionArgumentExceptionOperationCanceledExceptionNullReferenceExceptionMulticastNotSupportedExceptionFileNotFoundExceptionDirectoryNotFoundExceptionUnauthorizedAccessExceptionIOExceptionPathTooLongExceptionDriveNotFoundExceptionpublic void setJCOInstance(JCObject instance)
setJCOInstance in class NetObjectpublic void Start()
throws java.lang.Throwable,
InvalidOperationException,
ArgumentNullException,
ObjectDisposedException,
AbandonedMutexException,
ArgumentException,
NotSupportedException,
FormatException,
IndexOutOfRangeException,
MulticastNotSupportedException,
TaskSchedulerException
public void Start(TaskScheduler scheduler) throws java.lang.Throwable, InvalidOperationException, ArgumentNullException, ArgumentOutOfRangeException, ObjectDisposedException, AbandonedMutexException, ArgumentException, NotSupportedException, FormatException, IndexOutOfRangeException, MulticastNotSupportedException, TaskSchedulerException
public void Wait()
throws java.lang.Throwable,
ArgumentOutOfRangeException,
ArgumentNullException,
InvalidOperationException,
ThreadAbortException,
TaskSchedulerException,
FormatException,
ArgumentException,
ObjectDisposedException,
OperationCanceledException,
AbandonedMutexException,
AggregateException
public void Wait(CancellationToken cancellationToken) throws java.lang.Throwable, ArgumentOutOfRangeException, ArgumentNullException, InvalidOperationException, ThreadAbortException, TaskSchedulerException, FormatException, ArgumentException, ObjectDisposedException, OperationCanceledException, AbandonedMutexException, AggregateException
public boolean Wait(int millisecondsTimeout)
throws java.lang.Throwable,
ArgumentOutOfRangeException,
ArgumentNullException,
InvalidOperationException,
ThreadAbortException,
TaskSchedulerException,
FormatException,
ArgumentException,
ObjectDisposedException,
OperationCanceledException,
AbandonedMutexException,
AggregateException
public boolean Wait(int millisecondsTimeout,
CancellationToken cancellationToken)
throws java.lang.Throwable,
ArgumentOutOfRangeException,
EventSourceException,
ArgumentNullException,
InvalidOperationException,
ThreadAbortException,
TaskSchedulerException,
FormatException,
ArgumentException,
ObjectDisposedException,
OperationCanceledException,
AbandonedMutexException,
NullReferenceException,
AggregateException
java.lang.ThrowableArgumentOutOfRangeExceptionEventSourceExceptionArgumentNullExceptionInvalidOperationExceptionThreadAbortExceptionTaskSchedulerExceptionFormatExceptionArgumentExceptionObjectDisposedExceptionOperationCanceledExceptionAbandonedMutexExceptionNullReferenceExceptionAggregateExceptionpublic boolean Wait(TimeSpan timeout) throws java.lang.Throwable, ArgumentOutOfRangeException, ArgumentNullException, InvalidOperationException, ThreadAbortException, TaskSchedulerException, FormatException, ArgumentException, ObjectDisposedException, OperationCanceledException, AbandonedMutexException, AggregateException
public static void WaitAll(Task... tasks) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, OperationCanceledException, ArgumentException, EventSourceException, InvalidOperationException, TaskSchedulerException, ObjectDisposedException, AbandonedMutexException, FormatException, AggregateException
public static void WaitAll(Task[] tasks, CancellationToken cancellationToken) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, OperationCanceledException, ArgumentException, InvalidOperationException, TaskSchedulerException, ObjectDisposedException, AbandonedMutexException, NullReferenceException, FormatException, AggregateException
public static boolean WaitAll(Task[] tasks, int millisecondsTimeout) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, OperationCanceledException, ArgumentException, InvalidOperationException, TaskSchedulerException, ObjectDisposedException, AbandonedMutexException, NullReferenceException, FormatException, AggregateException
public static boolean WaitAll(Task[] tasks, int millisecondsTimeout, CancellationToken cancellationToken) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, OperationCanceledException, ArgumentException, InvalidOperationException, TaskSchedulerException, ObjectDisposedException, AbandonedMutexException, NullReferenceException, FormatException, AggregateException
public static boolean WaitAll(Task[] tasks, TimeSpan timeout) throws java.lang.Throwable, ArgumentOutOfRangeException, ArgumentNullException, OperationCanceledException, ArgumentException, EventSourceException, InvalidOperationException, TaskSchedulerException, ObjectDisposedException, AbandonedMutexException, FormatException, AggregateException
public static int WaitAny(Task... tasks) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, OperationCanceledException, ArgumentException, ObjectDisposedException, InvalidOperationException, ThreadAbortException, TaskSchedulerException, AggregateException
public static int WaitAny(Task[] tasks, CancellationToken cancellationToken) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, OperationCanceledException, ArgumentException, ObjectDisposedException, AbandonedMutexException, InvalidOperationException, ThreadAbortException, TaskSchedulerException, FormatException, AggregateException
public static int WaitAny(Task[] tasks, int millisecondsTimeout) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, OperationCanceledException, ArgumentException, ObjectDisposedException, AbandonedMutexException, InvalidOperationException, ThreadAbortException, TaskSchedulerException, FormatException, AggregateException
public static int WaitAny(Task[] tasks, int millisecondsTimeout, CancellationToken cancellationToken) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, OperationCanceledException, ArgumentException, ObjectDisposedException, AbandonedMutexException, FileNotFoundException, DirectoryNotFoundException, UnauthorizedAccessException, IOException, PathTooLongException, DriveNotFoundException, InvalidOperationException, ThreadAbortException, TaskSchedulerException, FormatException, AggregateException
java.lang.ThrowableArgumentNullExceptionArgumentOutOfRangeExceptionOperationCanceledExceptionArgumentExceptionObjectDisposedExceptionAbandonedMutexExceptionFileNotFoundExceptionDirectoryNotFoundExceptionUnauthorizedAccessExceptionIOExceptionPathTooLongExceptionDriveNotFoundExceptionInvalidOperationExceptionThreadAbortExceptionTaskSchedulerExceptionFormatExceptionAggregateExceptionpublic static int WaitAny(Task[] tasks, TimeSpan timeout) throws java.lang.Throwable, ArgumentOutOfRangeException, ArgumentNullException, OperationCanceledException, ArgumentException, ObjectDisposedException, InvalidOperationException, ThreadAbortException, TaskSchedulerException, AggregateException
public static Task WhenAll(Task... tasks) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, ArgumentException, ObjectDisposedException, AbandonedMutexException, InvalidOperationException
public static YieldAwaitable Yield() throws java.lang.Throwable
java.lang.Throwable