Interface Interruptible

All Known Subinterfaces:
IPortalSession
All Known Implementing Classes:
Dcm1ProcessEnabledSession, Dcm2ProcessEnabledSession, FunctionCallContext, NonInteractiveProcessEnabledSession, PortalContext, PortalMessageSession, PortalSession, ProcessEnabledSession, TxPortalContext

public interface Interruptible
Represents an object which performs a computation that may be interrupted.

The interruption is typically performed from another thread. It is the responsibility of the object implementing this interface to check at appropriate times (implementation dependent) whether the interrupted flag has been set, stop the computation it is currently performing and exit by throwing an InterruptedException.

This interface does not specify what should happen if a new computation is started in an interruptible object while the interrupted flag set. This decision is implementation dependent. However, if the implementation supports starting a new computation, then it should clear the interrupted flag (i.e. isInterrupted() should return false) before the new computation is started.

Since:
11.0
Author:
Petru Galanton
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Sets the interrupted flag, indicating that this object should interrupt the computation it is currently performing (typically on another thread) as soon as possible, and exit by throwing an InterruptedException.
    boolean
    Indicates whether the interrupted flag has been set.
  • Method Details

    • interrupt

      void interrupt()
      Sets the interrupted flag, indicating that this object should interrupt the computation it is currently performing (typically on another thread) as soon as possible, and exit by throwing an InterruptedException.
    • isInterrupted

      boolean isInterrupted()
      Indicates whether the interrupted flag has been set.
      Returns:
      true if the interrupted flag is set, false otherwise.