Package jadex.commons.future
Class ThreadSuspendable
- java.lang.Object
- 
- jadex.commons.future.ThreadLocalTransferHelper
- 
- jadex.commons.future.ThreadSuspendable
 
 
- 
- All Implemented Interfaces:
- ISuspendable
 
 public class ThreadSuspendable extends ThreadLocalTransferHelper implements ISuspendable Suspendable for threads.
- 
- 
Field SummaryFields Modifier and Type Field Description protected IFuture<?>futureThe future.protected booleanresumedThe resumed flag to differentiante from timeout.- 
Fields inherited from class jadex.commons.future.ThreadLocalTransferHelperTHREADLOCALS, vals
 - 
Fields inherited from interface jadex.commons.future.ISuspendableSUSPENDABLE
 
- 
 - 
Constructor SummaryConstructors Constructor Description ThreadSuspendable()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected longgetDefaultTimeout()Get the default timeout.java.lang.ObjectgetMonitor()Get the monitor for waiting.voidresume(Future<?> future)Resume the execution of the suspendable.voidsuspend(Future<?> future, long timeout, boolean realtime)Suspend the execution of the suspendable.- 
Methods inherited from class jadex.commons.future.ThreadLocalTransferHelperaddThreadLocal, afterSwitch, beforeSwitch, removeThreadLocal, restoreValues, saveValues
 
- 
 
- 
- 
- 
Field Detail- 
futureprotected IFuture<?> future The future.
 - 
resumedprotected boolean resumed The resumed flag to differentiante from timeout.
 
- 
 - 
Method Detail- 
suspendpublic void suspend(Future<?> future, long timeout, boolean realtime) Suspend the execution of the suspendable.- Specified by:
- suspendin interface- ISuspendable
- Parameters:
- timeout- The timeout.
- realtime- Flag if timeout is realtime (in contrast to simulation time).
- future- The future to wait for.
 
 - 
resumepublic void resume(Future<?> future) Resume the execution of the suspendable.- Specified by:
- resumein interface- ISuspendable
- Parameters:
- future- The future that issues the resume.
 
 - 
getMonitorpublic java.lang.Object getMonitor() Get the monitor for waiting.- Specified by:
- getMonitorin interface- ISuspendable
- Returns:
- The monitor.
 
 - 
getDefaultTimeoutprotected long getDefaultTimeout() Get the default timeout.- Returns:
- The default timeout (-1 for none).
 
 
- 
 
-