public class TimeoutResultListener<E>
extends java.lang.Object
implements jadex.commons.future.IResultListener<E>, jadex.commons.future.IUndoneResultListener<E>, jadex.commons.future.IFutureCommandListener
Modifier and Type | Field and Description |
---|---|
protected IExternalAccess |
exta
The external access.
|
protected jadex.commons.future.IResultListener<E> |
listener
The delegation listener.
|
protected java.lang.Object |
message
The timeout message.
|
protected boolean |
notified
The timeout occurred flag.
|
protected boolean |
realtime
The realtime flag.
|
protected long |
timeout
The timeout.
|
protected java.lang.Object |
timer
The timer.
|
protected boolean |
undone
Flag if undone methods should be used.
|
Constructor and Description |
---|
TimeoutResultListener(long timeout,
IExternalAccess exta,
boolean realtime,
java.lang.Object message,
jadex.commons.future.IResultListener<E> listener)
Create a new listener.
|
TimeoutResultListener(long timeout,
IExternalAccess exta,
jadex.commons.future.IResultListener<E> listener)
Create a new listener.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancel the timeout.
|
void |
commandAvailable(java.lang.Object command)
Called when a command is available.
|
void |
exceptionOccurred(java.lang.Exception exception)
Called when an exception occurred.
|
void |
exceptionOccurredIfUndone(java.lang.Exception exception)
Called when an exception occurred.
|
protected void |
initTimer() |
void |
resultAvailable(E result)
Called when the result is available.
|
void |
resultAvailableIfUndone(E result)
Called when the result is available.
|
protected jadex.commons.future.IResultListener<E> listener
protected IExternalAccess exta
protected boolean notified
protected java.lang.Object timer
protected long timeout
protected boolean realtime
protected java.lang.Object message
protected boolean undone
public TimeoutResultListener(long timeout, IExternalAccess exta, jadex.commons.future.IResultListener<E> listener)
public TimeoutResultListener(long timeout, IExternalAccess exta, boolean realtime, java.lang.Object message, jadex.commons.future.IResultListener<E> listener)
public void resultAvailable(E result)
resultAvailable
in interface jadex.commons.future.IFunctionalResultListener<E>
result
- The result.public void exceptionOccurred(java.lang.Exception exception)
exceptionOccurred
in interface jadex.commons.future.IFunctionalExceptionListener
exception
- The exception.public void resultAvailableIfUndone(E result)
resultAvailableIfUndone
in interface jadex.commons.future.IUndoneResultListener<E>
result
- The result.public void exceptionOccurredIfUndone(java.lang.Exception exception)
exceptionOccurredIfUndone
in interface jadex.commons.future.IUndoneResultListener<E>
exception
- The exception.public void cancel()
protected void initTimer()
public void commandAvailable(java.lang.Object command)
commandAvailable
in interface jadex.commons.future.IFutureCommandListener