Package system.threading.tasks
Class Task
- java.lang.Object
-
- org.mases.jcobridge.netreflection.NetObject
-
- system.threading.tasks.Task
-
- All Implemented Interfaces:
java.lang.AutoCloseable,IJCOBridgeReflected
public class Task extends NetObject implements java.lang.AutoCloseable
The base .NET class managing System.Threading.Tasks.Task, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089..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
- Author:
- MASES s.r.l https://masesgroup.com
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringassemblyFullNameFully assembly qualified name: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089static java.lang.StringassemblyShortNameAssembly name: mscorlibstatic java.lang.StringclassNameQualified class name: System.Threading.Tasks.Taskstatic JCTypeclassTypeThe type managed from JCOBridge.
-
Constructor Summary
Constructors Constructor Description Task()Task(java.lang.Object instance)Internal constructor.Task(Action action)Task(Action action, CancellationToken cancellationToken)Task(Action action, CancellationToken cancellationToken, TaskCreationOptions creationOptions)Task(Action action, TaskCreationOptions creationOptions)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Taskcast(IJCOBridgeReflected from)Try to cast theIJCOBridgeReflectedinstance intoTask, a cast assert is made to check if types are compatible.voidclose()ConfiguredTaskAwaitableConfigureAwait(boolean continueOnCapturedContext)static TaskDelay(int millisecondsDelay)static TaskDelay(int millisecondsDelay, CancellationToken cancellationToken)static TaskDelay(TimeSpan delay)static TaskDelay(TimeSpan delay, CancellationToken cancellationToken)voidDispose()static TaskFromCanceled(CancellationToken cancellationToken)static TaskFromException(NetException exception)NetObjectgetAsyncState()TaskAwaiterGetAwaiter()static TaskgetCompletedTask()TaskCreationOptionsgetCreationOptions()AggregateExceptiongetException()static TaskFactorygetFactory()intgetId()booleangetIsCanceled()booleangetIsCompleted()booleangetIsFaulted()java.lang.StringgetJCOAssemblyName()Returns the reflected Assembly namejava.lang.StringgetJCOClassName()Returns the reflected Class namejava.lang.ObjectgetJCOInstance()Returns the instantiated classjava.lang.StringgetJCOObjectName()Returns the reflected Class name used to build the objectJCTypegetJCOType()Returns the instantiated class TypeTaskStatusgetStatus()static TaskRun(Action action)static TaskRun(Action action, CancellationToken cancellationToken)voidRunSynchronously()voidRunSynchronously(TaskScheduler scheduler)voidsetJCOInstance(JCObject instance)voidStart()voidStart(TaskScheduler scheduler)voidWait()booleanWait(int millisecondsTimeout)booleanWait(int millisecondsTimeout, CancellationToken cancellationToken)voidWait(CancellationToken cancellationToken)booleanWait(TimeSpan timeout)static voidWaitAll(Task... tasks)static booleanWaitAll(Task[] tasks, int millisecondsTimeout)static booleanWaitAll(Task[] tasks, int millisecondsTimeout, CancellationToken cancellationToken)static voidWaitAll(Task[] tasks, CancellationToken cancellationToken)static booleanWaitAll(Task[] tasks, TimeSpan timeout)static intWaitAny(Task... tasks)static intWaitAny(Task[] tasks, int millisecondsTimeout)static intWaitAny(Task[] tasks, int millisecondsTimeout, CancellationToken cancellationToken)static intWaitAny(Task[] tasks, CancellationToken cancellationToken)static intWaitAny(Task[] tasks, TimeSpan timeout)static TaskWhenAll(Task... tasks)static YieldAwaitableYield()
-
-
-
Field Detail
-
assemblyFullName
public static final java.lang.String assemblyFullName
Fully assembly qualified name: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089- See Also:
- Constant Field Values
-
assemblyShortName
public static final java.lang.String assemblyShortName
Assembly name: mscorlib- See Also:
- Constant Field Values
-
className
public static final java.lang.String className
Qualified class name: System.Threading.Tasks.Task- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Task
public Task(java.lang.Object instance) throws java.lang.ThrowableInternal constructor. Use with caution- Throws:
java.lang.Throwable
-
Task
public Task() throws java.lang.Throwable- Throws:
java.lang.Throwable
-
Task
public Task(Action action) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, InvalidOperationException, ArgumentException, ObjectDisposedException, AbandonedMutexException, NullReferenceException
-
Task
public Task(Action action, CancellationToken cancellationToken) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, InvalidOperationException, ArgumentException, ObjectDisposedException, AbandonedMutexException, NullReferenceException
-
Task
public Task(Action action, CancellationToken cancellationToken, TaskCreationOptions creationOptions) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, InvalidOperationException, ArgumentException, ObjectDisposedException, AbandonedMutexException, NullReferenceException
-
Task
public Task(Action action, TaskCreationOptions creationOptions) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, InvalidOperationException, ArgumentException, ObjectDisposedException, AbandonedMutexException, NullReferenceException
-
-
Method Detail
-
getJCOAssemblyName
public java.lang.String getJCOAssemblyName()
Description copied from interface:IJCOBridgeReflectedReturns the reflected Assembly name- Specified by:
getJCOAssemblyNamein interfaceIJCOBridgeReflected- Overrides:
getJCOAssemblyNamein classNetObject- Returns:
- A
Stringrepresenting the Fullname of reflected Assembly
-
getJCOClassName
public java.lang.String getJCOClassName()
Description copied from interface:IJCOBridgeReflectedReturns the reflected Class name- Specified by:
getJCOClassNamein interfaceIJCOBridgeReflected- Overrides:
getJCOClassNamein classNetObject- Returns:
- A
Stringrepresenting the Fullname of reflected Class
-
getJCOObjectName
public java.lang.String getJCOObjectName()
Description copied from interface:IJCOBridgeReflectedReturns the reflected Class name used to build the object- Specified by:
getJCOObjectNamein interfaceIJCOBridgeReflected- Overrides:
getJCOObjectNamein classNetObject- Returns:
- A
Stringrepresenting the name used to allocated the object in CLR context
-
getJCOInstance
public java.lang.Object getJCOInstance()
Description copied from interface:IJCOBridgeReflectedReturns the instantiated class- Specified by:
getJCOInstancein interfaceIJCOBridgeReflected- Overrides:
getJCOInstancein classNetObject- Returns:
- An
Objectrepresenting the CLR instance of the instantiated Class
-
setJCOInstance
public void setJCOInstance(JCObject instance)
- Overrides:
setJCOInstancein classNetObject
-
getJCOType
public JCType getJCOType()
Description copied from interface:IJCOBridgeReflectedReturns the instantiated class Type- Specified by:
getJCOTypein interfaceIJCOBridgeReflected- Overrides:
getJCOTypein classNetObject- Returns:
- A
JCTyperepresenting the CLR Type of the instantiated Class
-
cast
public static Task cast(IJCOBridgeReflected from) throws java.lang.Throwable
Try to cast theIJCOBridgeReflectedinstance intoTask, a cast assert is made to check if types are compatible.- Parameters:
from-IJCOBridgeReflectedinstance to be casted- Returns:
Taskinstance- Throws:
java.lang.Throwable- in case of error during cast operation
-
Wait
public boolean Wait(int millisecondsTimeout) throws java.lang.Throwable, ArgumentOutOfRangeException, ArgumentNullException, InvalidOperationException, ThreadAbortException, TaskSchedulerException, FormatException, ArgumentException, ObjectDisposedException, OperationCanceledException, AbandonedMutexException, AggregateException
-
Wait
public boolean Wait(int millisecondsTimeout, CancellationToken cancellationToken) throws java.lang.Throwable, ArgumentOutOfRangeException, EventSourceException, ArgumentNullException, InvalidOperationException, ThreadAbortException, TaskSchedulerException, FormatException, ArgumentException, ObjectDisposedException, OperationCanceledException, AbandonedMutexException, NullReferenceException, AggregateException- Throws:
java.lang.ThrowableArgumentOutOfRangeExceptionEventSourceExceptionArgumentNullExceptionInvalidOperationExceptionThreadAbortExceptionTaskSchedulerExceptionFormatExceptionArgumentExceptionObjectDisposedExceptionOperationCanceledExceptionAbandonedMutexExceptionNullReferenceExceptionAggregateException
-
Wait
public boolean Wait(TimeSpan timeout) throws java.lang.Throwable, ArgumentOutOfRangeException, ArgumentNullException, InvalidOperationException, ThreadAbortException, TaskSchedulerException, FormatException, ArgumentException, ObjectDisposedException, OperationCanceledException, AbandonedMutexException, AggregateException
-
WaitAll
public static boolean WaitAll(Task[] tasks, int millisecondsTimeout) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, OperationCanceledException, ArgumentException, InvalidOperationException, TaskSchedulerException, ObjectDisposedException, AbandonedMutexException, NullReferenceException, FormatException, AggregateException
-
WaitAll
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
-
WaitAll
public static boolean WaitAll(Task[] tasks, TimeSpan timeout) throws java.lang.Throwable, ArgumentOutOfRangeException, ArgumentNullException, OperationCanceledException, ArgumentException, EventSourceException, InvalidOperationException, TaskSchedulerException, ObjectDisposedException, AbandonedMutexException, FormatException, AggregateException
-
WaitAny
public static int WaitAny(Task... tasks) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, OperationCanceledException, ArgumentException, ObjectDisposedException, InvalidOperationException, ThreadAbortException, TaskSchedulerException, AggregateException
-
WaitAny
public static int WaitAny(Task[] tasks, int millisecondsTimeout) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, OperationCanceledException, ArgumentException, ObjectDisposedException, AbandonedMutexException, InvalidOperationException, ThreadAbortException, TaskSchedulerException, FormatException, AggregateException
-
WaitAny
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
- Throws:
java.lang.ThrowableArgumentNullExceptionArgumentOutOfRangeExceptionOperationCanceledExceptionArgumentExceptionObjectDisposedExceptionAbandonedMutexExceptionFileNotFoundExceptionDirectoryNotFoundExceptionUnauthorizedAccessExceptionIOExceptionPathTooLongExceptionDriveNotFoundExceptionInvalidOperationExceptionThreadAbortExceptionTaskSchedulerExceptionFormatExceptionAggregateException
-
WaitAny
public static int WaitAny(Task[] tasks, CancellationToken cancellationToken) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, OperationCanceledException, ArgumentException, ObjectDisposedException, AbandonedMutexException, InvalidOperationException, ThreadAbortException, TaskSchedulerException, FormatException, AggregateException
-
WaitAny
public static int WaitAny(Task[] tasks, TimeSpan timeout) throws java.lang.Throwable, ArgumentOutOfRangeException, ArgumentNullException, OperationCanceledException, ArgumentException, ObjectDisposedException, InvalidOperationException, ThreadAbortException, TaskSchedulerException, AggregateException
-
ConfigureAwait
public ConfiguredTaskAwaitable ConfigureAwait(boolean continueOnCapturedContext) throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
GetAwaiter
public TaskAwaiter GetAwaiter() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
Yield
public static YieldAwaitable Yield() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
Delay
public static Task Delay(int millisecondsDelay) throws java.lang.Throwable, ArgumentOutOfRangeException, ArgumentNullException, ArgumentException, ObjectDisposedException, InvalidOperationException, MissingMethodException, TargetInvocationException, SecurityException, NullReferenceException
-
Delay
public static Task Delay(int millisecondsDelay, CancellationToken cancellationToken) throws java.lang.Throwable, ArgumentOutOfRangeException, EventSourceException, ArgumentNullException, ArgumentException, ObjectDisposedException, AbandonedMutexException, InvalidOperationException, MissingMethodException, TargetInvocationException, SecurityException, NullReferenceException
-
Delay
public static Task Delay(TimeSpan delay) throws java.lang.Throwable, ArgumentOutOfRangeException, ArgumentException, ArgumentNullException, InvalidOperationException, NullReferenceException, ObjectDisposedException
-
Delay
public static Task Delay(TimeSpan delay, CancellationToken cancellationToken) throws java.lang.Throwable, ArgumentOutOfRangeException, ArgumentNullException, ArgumentException, ObjectDisposedException, InvalidOperationException, MissingMethodException, TargetInvocationException, SecurityException, NullReferenceException
-
FromCanceled
public static Task FromCanceled(CancellationToken cancellationToken) throws java.lang.Throwable, ArgumentOutOfRangeException
- Throws:
java.lang.ThrowableArgumentOutOfRangeException
-
FromException
public static Task FromException(NetException exception) throws java.lang.Throwable, ArgumentNullException, InvalidOperationException, ArgumentOutOfRangeException, ObjectDisposedException, AbandonedMutexException, ArgumentException, MulticastNotSupportedException
-
Run
public static Task Run(Action action) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, InvalidOperationException, ArgumentException, ObjectDisposedException, NotSupportedException, FormatException, IndexOutOfRangeException, EventSourceException, OutOfMemoryException, MulticastNotSupportedException, TaskSchedulerException
- Throws:
java.lang.ThrowableArgumentNullExceptionArgumentOutOfRangeExceptionInvalidOperationExceptionArgumentExceptionObjectDisposedExceptionNotSupportedExceptionFormatExceptionIndexOutOfRangeExceptionEventSourceExceptionOutOfMemoryExceptionMulticastNotSupportedExceptionTaskSchedulerException
-
Run
public static Task Run(Action action, CancellationToken cancellationToken) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, InvalidOperationException, ArgumentException, ObjectDisposedException, NotSupportedException, FormatException, IndexOutOfRangeException, EventSourceException, OutOfMemoryException, MulticastNotSupportedException, TaskSchedulerException
- Throws:
java.lang.ThrowableArgumentNullExceptionArgumentOutOfRangeExceptionInvalidOperationExceptionArgumentExceptionObjectDisposedExceptionNotSupportedExceptionFormatExceptionIndexOutOfRangeExceptionEventSourceExceptionOutOfMemoryExceptionMulticastNotSupportedExceptionTaskSchedulerException
-
WhenAll
public static Task WhenAll(Task... tasks) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, ArgumentException, ObjectDisposedException, AbandonedMutexException, InvalidOperationException
-
Dispose
public void Dispose() throws java.lang.Throwable, InvalidOperationException, ObjectDisposedException, AbandonedMutexException, ArgumentException, ArgumentNullException, NotSupportedException, ArgumentOutOfRangeException, FileNotFoundException, DirectoryNotFoundException, UnauthorizedAccessException, IOException, PathTooLongException, DriveNotFoundException, OperationCanceledException- Throws:
java.lang.ThrowableInvalidOperationExceptionObjectDisposedExceptionAbandonedMutexExceptionArgumentExceptionArgumentNullExceptionNotSupportedExceptionArgumentOutOfRangeExceptionFileNotFoundExceptionDirectoryNotFoundExceptionUnauthorizedAccessExceptionIOExceptionPathTooLongExceptionDriveNotFoundExceptionOperationCanceledException
-
RunSynchronously
public void RunSynchronously() throws java.lang.Throwable, InvalidOperationException, ArgumentOutOfRangeException, ArgumentNullException, ObjectDisposedException, AbandonedMutexException, FormatException, ArgumentException, OperationCanceledException, NullReferenceException, MulticastNotSupportedException, FileNotFoundException, DirectoryNotFoundException, UnauthorizedAccessException, IOException, PathTooLongException, DriveNotFoundException- Throws:
java.lang.ThrowableInvalidOperationExceptionArgumentOutOfRangeExceptionArgumentNullExceptionObjectDisposedExceptionAbandonedMutexExceptionFormatExceptionArgumentExceptionOperationCanceledExceptionNullReferenceExceptionMulticastNotSupportedExceptionFileNotFoundExceptionDirectoryNotFoundExceptionUnauthorizedAccessExceptionIOExceptionPathTooLongExceptionDriveNotFoundException
-
RunSynchronously
public void RunSynchronously(TaskScheduler scheduler) throws java.lang.Throwable, ArgumentNullException, InvalidOperationException, ArgumentOutOfRangeException, ObjectDisposedException, AbandonedMutexException, FormatException, ArgumentException, OperationCanceledException, NullReferenceException, MulticastNotSupportedException, FileNotFoundException, DirectoryNotFoundException, UnauthorizedAccessException, IOException, PathTooLongException, DriveNotFoundException
- Throws:
java.lang.ThrowableArgumentNullExceptionInvalidOperationExceptionArgumentOutOfRangeExceptionObjectDisposedExceptionAbandonedMutexExceptionFormatExceptionArgumentExceptionOperationCanceledExceptionNullReferenceExceptionMulticastNotSupportedExceptionFileNotFoundExceptionDirectoryNotFoundExceptionUnauthorizedAccessExceptionIOExceptionPathTooLongExceptionDriveNotFoundException
-
Start
public void Start() throws java.lang.Throwable, InvalidOperationException, ArgumentNullException, ObjectDisposedException, AbandonedMutexException, ArgumentException, NotSupportedException, FormatException, IndexOutOfRangeException, MulticastNotSupportedException, TaskSchedulerException
-
Start
public void Start(TaskScheduler scheduler) throws java.lang.Throwable, InvalidOperationException, ArgumentNullException, ArgumentOutOfRangeException, ObjectDisposedException, AbandonedMutexException, ArgumentException, NotSupportedException, FormatException, IndexOutOfRangeException, MulticastNotSupportedException, TaskSchedulerException
-
Wait
public void Wait() throws java.lang.Throwable, ArgumentOutOfRangeException, ArgumentNullException, InvalidOperationException, ThreadAbortException, TaskSchedulerException, FormatException, ArgumentException, ObjectDisposedException, OperationCanceledException, AbandonedMutexException, AggregateException
-
Wait
public void Wait(CancellationToken cancellationToken) throws java.lang.Throwable, ArgumentOutOfRangeException, ArgumentNullException, InvalidOperationException, ThreadAbortException, TaskSchedulerException, FormatException, ArgumentException, ObjectDisposedException, OperationCanceledException, AbandonedMutexException, AggregateException
-
WaitAll
public static void WaitAll(Task... tasks) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, OperationCanceledException, ArgumentException, EventSourceException, InvalidOperationException, TaskSchedulerException, ObjectDisposedException, AbandonedMutexException, FormatException, AggregateException
-
WaitAll
public static void WaitAll(Task[] tasks, CancellationToken cancellationToken) throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, OperationCanceledException, ArgumentException, InvalidOperationException, TaskSchedulerException, ObjectDisposedException, AbandonedMutexException, NullReferenceException, FormatException, AggregateException
-
close
public void close() throws java.lang.Exception- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.lang.Exception
-
getIsCanceled
public boolean getIsCanceled() throws java.lang.Throwable- Throws:
java.lang.Throwable
-
getIsCompleted
public boolean getIsCompleted() throws java.lang.Throwable- Throws:
java.lang.Throwable
-
getIsFaulted
public boolean getIsFaulted() throws java.lang.Throwable- Throws:
java.lang.Throwable
-
getId
public int getId() throws java.lang.Throwable, IndexOutOfRangeException, EventSourceException, ArgumentNullException, OutOfMemoryException, ArgumentException, ArgumentOutOfRangeException, InvalidOperationException, NotSupportedException
-
getException
public AggregateException getException() throws java.lang.Throwable, ArgumentNullException, ArgumentOutOfRangeException, ArgumentException
- Throws:
java.lang.ThrowableArgumentNullExceptionArgumentOutOfRangeExceptionArgumentException
-
getAsyncState
public NetObject getAsyncState() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
getCompletedTask
public static Task getCompletedTask() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
getCreationOptions
public TaskCreationOptions getCreationOptions() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
getFactory
public static TaskFactory getFactory() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
getStatus
public TaskStatus getStatus() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
-