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
FieldsModifier and TypeFieldDescriptionstatic final ThreadLocal
<ISuspendable> The component suspendable for a component thread. -
Method Summary
-
Field Details
-
SUSPENDABLE
The component suspendable for a component thread.
-
-
Method Details
-
suspend
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
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.
-