public class ComponentSuspendable
extends jadex.commons.future.ThreadLocalTransferHelper
implements jadex.commons.future.ISuspendable
Modifier and Type | Field and Description |
---|---|
protected IInternalAccess |
agent
The component adapter.
|
static java.lang.ThreadLocal<ComponentSuspendable> |
COMSUPS
The component suspendables.
|
protected jadex.commons.future.Future<?> |
future
The current future.
|
protected java.util.Map<java.lang.ThreadLocal<java.lang.Object>,java.lang.Object> |
vals
The thread locals.
|
Constructor and Description |
---|
ComponentSuspendable(IInternalAccess agent)
Create a component suspendable.
|
Modifier and Type | Method and Description |
---|---|
long |
getDefaultTimeout()
Get the default timeout.
|
jadex.commons.future.Future<?> |
getFuture()
Get the future.
|
java.lang.Object |
getMonitor()
Get the monitor for waiting.
|
void |
resume(jadex.commons.future.Future<?> future)
Resume the execution of the suspendable.
|
void |
suspend(jadex.commons.future.Future<?> future,
long timeout,
boolean realtime)
Suspend the execution of the suspendable.
|
java.lang.String |
toString()
Get the string representation.
|
public static final java.lang.ThreadLocal<ComponentSuspendable> COMSUPS
protected IInternalAccess agent
protected jadex.commons.future.Future<?> future
protected java.util.Map<java.lang.ThreadLocal<java.lang.Object>,java.lang.Object> vals
public ComponentSuspendable(IInternalAccess agent)
public void suspend(jadex.commons.future.Future<?> future, long timeout, boolean realtime)
suspend
in interface jadex.commons.future.ISuspendable
future
- The future to wait for.timeout
- The timeout.realtime
- Flag if timeout is realtime (in contrast to simulation time).public void resume(jadex.commons.future.Future<?> future)
resume
in interface jadex.commons.future.ISuspendable
public java.lang.Object getMonitor()
getMonitor
in interface jadex.commons.future.ISuspendable
public jadex.commons.future.Future<?> getFuture()
public long getDefaultTimeout()
public java.lang.String toString()
toString
in class java.lang.Object