Package jadex.bridge.service.component
Class ComponentSuspendable
- java.lang.Object
- 
- jadex.commons.future.ThreadLocalTransferHelper
- 
- jadex.bridge.service.component.ComponentSuspendable
 
 
- 
- All Implemented Interfaces:
- ISuspendable
 
 public class ComponentSuspendable extends ThreadLocalTransferHelper implements ISuspendable Allow waiting for futures by blocking a component.
- 
- 
Field SummaryFields Modifier and Type Field Description protected IInternalAccessagentThe component adapter.static java.lang.ThreadLocal<ComponentSuspendable>COMSUPSThe component suspendables.protected Future<?>futureThe current future.protected java.util.Map<java.lang.ThreadLocal<java.lang.Object>,java.lang.Object>valsThe thread locals.- 
Fields inherited from class jadex.commons.future.ThreadLocalTransferHelperTHREADLOCALS
 - 
Fields inherited from interface jadex.commons.future.ISuspendableSUSPENDABLE
 
- 
 - 
Constructor SummaryConstructors Constructor Description ComponentSuspendable(IInternalAccess agent)Create a component suspendable.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetDefaultTimeout()Get the default timeout.Future<?>getFuture()Get the future.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.java.lang.StringtoString()Get the string representation.- 
Methods inherited from class jadex.commons.future.ThreadLocalTransferHelperaddThreadLocal, afterSwitch, beforeSwitch, removeThreadLocal, restoreValues, saveValues
 
- 
 
- 
- 
- 
Field Detail- 
COMSUPSpublic static final java.lang.ThreadLocal<ComponentSuspendable> COMSUPS The component suspendables.
 - 
agentprotected IInternalAccess agent The component adapter.
 - 
futureprotected Future<?> future The current future.
 - 
valsprotected java.util.Map<java.lang.ThreadLocal<java.lang.Object>,java.lang.Object> vals The thread locals.
 
- 
 - 
Constructor Detail- 
ComponentSuspendablepublic ComponentSuspendable(IInternalAccess agent) Create a component suspendable.
 
- 
 - 
Method Detail- 
suspendpublic void suspend(Future<?> future, long timeout, boolean realtime) Suspend the execution of the suspendable.- Specified by:
- suspendin interface- ISuspendable
- Parameters:
- future- The future to wait for.
- timeout- The timeout.
- realtime- Flag if timeout is realtime (in contrast to simulation time).
 
 - 
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.
 
 - 
getFuturepublic Future<?> getFuture() Get the future.- Returns:
- The future.
 
 - 
getDefaultTimeoutpublic long getDefaultTimeout() Get the default timeout.- Returns:
- The default timeout (-1 for none).
 
 - 
toStringpublic java.lang.String toString() Get the string representation.- Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-