Package jadex.future

Interface ISuspendable

All Known Implementing Classes:
ThreadSuspendable

public interface ISuspendable
Interface for suspendable entities. Is used by the IFuture to suspend callers.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The component suspendable for a component thread.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the future if currently suspended, null otherwise.
    Return the lock for internal synchronization.
    void
    resume(Future<?> future)
    Resume the execution of the suspendable.
    void
    suspend(Future<?> future, long timeout, boolean realtime)
    Suspend the execution of the suspendable.
  • Field Details

    • SUSPENDABLE

      static final ThreadLocal<ISuspendable> SUSPENDABLE
      The component suspendable for a component thread.
  • Method Details

    • suspend

      void suspend(Future<?> future, long timeout, boolean realtime)
      Suspend the execution of the suspendable.
      Parameters:
      future - The future to wait for.
      timeout - The timeout (-1 for no timeout, -2 for default timeout).
      realtime - Flag if timeout is realtime (in contrast to simulation time).
      Throws:
      jadex.common.TimeoutException - when not resumed before timeout.
    • resume

      void resume(Future<?> future)
      Resume the execution of the suspendable.
      Parameters:
      future - The future that issues the resume.
    • getFuture

      IFuture<?> getFuture()
      Get the future if currently suspended, null otherwise.
    • getLock

      ReentrantLock getLock()
      Return the lock for internal synchronization.