
public final class FutureReply extends Object implements EventReply
Future but without
cancellation, exception completion or ExecutionException, but with the additional
restriction that put() may be called at most once per instance. Thread-safe.| Constructor and Description |
|---|
FutureReply()
Construct.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getMessage()
Gets a short string describing the acceptance or rejection.
|
void |
put(EventReply value)
Posts a reply using a
PromptReply as the source of the message text. |
String |
toString()
Gets the string form of the response.
|
boolean |
wasAccepted(Duration timeout)
Gets a boolean flag, blocking if need be, which tells whether an event was accepted.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitacceptedpublic boolean wasAccepted(Duration timeout) throws InterruptedException, TimeoutException
EventReplywasAccepted in interface EventReplytimeout - How long to wait for the decision.InterruptedException - if interrupted.TimeoutException - if the wait times out.EventReply.getMessage()public String getMessage()
EventReplygetMessage in interface EventReplyIllegalStateException - if wasAccepted() wasn't called.#put(java.lang.String)public void put(EventReply value)
PromptReply as the source of the message text.value - The source of the message text, which should be a non-blocking implementation
of EventReply.IllegalStateException - if put() has already been called for this instance.NullPointerException - if the argument is null.#get()Copyright © 2022 LSST. All rights reserved.