public class PendingJavaScriptInvocation extends Object implements PendingJavaScriptResult
For internal use only. May be renamed or removed in a future release.
PendingJavaScriptResult.JavaScriptException
Constructor and Description |
---|
PendingJavaScriptInvocation(StateNode owner,
UIInternals.JavaScriptInvocation invocation)
Creates a new pending invocation for the given owner node and invocation.
|
Modifier and Type | Method and Description |
---|---|
boolean |
cancelExecution()
Cancel the javascript execution, if it was not yet sent to the
browser for execution.
|
void |
complete(elemental.json.JsonValue value)
Completes this invocation with the given return value from the client.
|
void |
completeExceptionally(elemental.json.JsonValue value)
Completes this invocation with the given exception value from the client.
|
UIInternals.JavaScriptInvocation |
getInvocation()
Gets the underlying JavaScript invocation that this pending invocation is
based on.
|
StateNode |
getOwner()
Gets the state node that this invocation belongs to.
|
boolean |
isCanceled()
Checks whether this invocation has been canceled.
|
boolean |
isSentToBrowser()
Checks whether the JavaScript execution has already been sent to the
browser.
|
boolean |
isSubscribed()
Checks if there are any subscribers for the return value of this
expression.
|
void |
then(SerializableConsumer<elemental.json.JsonValue> successHandler,
SerializableConsumer<String> errorHandler)
Adds an untyped handler that will be run for a successful execution and a
handler that will be run for a failed execution.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
then, then, then, toCompletableFuture, toCompletableFuture
public PendingJavaScriptInvocation(StateNode owner, UIInternals.JavaScriptInvocation invocation)
owner
- the state node that this invocation is related to, not
null
invocation
- the JavaScript invocation to send, not null
public StateNode getOwner()
public boolean isSubscribed()
true
if the return value should be passed back from
the client, false
if the return value can be ignoredpublic void complete(elemental.json.JsonValue value)
value
- the JSON return value from the clientpublic void completeExceptionally(elemental.json.JsonValue value)
value
- the JSON exception value from the clientpublic boolean cancelExecution()
Page.ExecutionCanceler
cancelExecution
in interface Page.ExecutionCanceler
cancelExecution
in interface PendingJavaScriptResult
true
if the execution was canceled,
false
if notpublic boolean isSentToBrowser()
PendingJavaScriptResult
isSentToBrowser
in interface PendingJavaScriptResult
true
if the execution is sent to the browser,
false
if it's still pendingpublic void then(SerializableConsumer<elemental.json.JsonValue> successHandler, SerializableConsumer<String> errorHandler)
PendingJavaScriptResult
Handlers can only be added before the execution has been sent to the browser.
then
in interface PendingJavaScriptResult
successHandler
- a handler for the JSON representation of the value from a
successful execution, not null
errorHandler
- a handler for an error message in case the execution failed,
or null
to ignore errorspublic boolean isCanceled()
true
if the invocation has been canceled, otherwise
false
public UIInternals.JavaScriptInvocation getInvocation()
null
Copyright © 2023. All rights reserved.