public class InterruptMonitor extends Object implements IInterruptMonitor
Represents information about interruption.
Constructor and Description |
---|
InterruptMonitor()
Initializes a new instance of the
InterruptMonitor class. |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes used resources.
|
CancellationTokenSource |
getCancellationToken()
Monitor's cancellation token used for process interruption.
|
static IInterruptMonitor |
getThreadLocalInstance()
Gets or sets the IInterruptMonitor instance which is unique for each thread.
|
void |
interrupt()
Sends a request to interrupt operations.
|
static void |
setThreadLocalInstance(IInterruptMonitor value)
Gets or sets the IInterruptMonitor instance which is unique for each thread.
|
public InterruptMonitor()
Initializes a new instance of the InterruptMonitor
class.
public final CancellationTokenSource getCancellationToken()
Monitor's cancellation token used for process interruption. By default each IInterruptMonitor generates its own cancellationSource.
getCancellationToken
in interface IInterruptMonitor
public static IInterruptMonitor getThreadLocalInstance()
Gets or sets the IInterruptMonitor instance which is unique for each thread.
public static void setThreadLocalInstance(IInterruptMonitor value)
Gets or sets the IInterruptMonitor instance which is unique for each thread.
value
- IInterruptMonitor instancepublic void interrupt()
Sends a request to interrupt operations.
interrupt
in interface IInterruptMonitor
public final void dispose()
Disposes used resources.
dispose
in interface com.aspose.ms.System.IDisposable
Copyright © 2024 Aspose. All Rights Reserved.