Package software.amazon.jsii
Class JsiiClient
java.lang.Object
software.amazon.jsii.JsiiClient
HTTP client for jsii-server.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbeginAsyncMethod(JsiiObjectRef objRef, String method, com.fasterxml.jackson.databind.node.ArrayNode args) Begins the execution of an async method.com.fasterxml.jackson.databind.JsonNodecallMethod(JsiiObjectRef objRef, String method, com.fasterxml.jackson.databind.node.ArrayNode args) Calls a method on a remote object.com.fasterxml.jackson.databind.JsonNodecallStaticMethod(String fqn, String method, com.fasterxml.jackson.databind.node.ArrayNode args) Invokes a static method.voidcompleteCallback(Callback callback, String error, String name, com.fasterxml.jackson.databind.JsonNode result) Completes a callback.createObject(String fqn, Collection<Object> initializerArgs, Collection<JsiiOverride> overrides, Collection<String> interfaces) Creates a remote jsii object.voiddeleteObject(JsiiObjectRef objRef) Deletes a remote object.com.fasterxml.jackson.databind.JsonNodeendAsyncMethod(JsiiPromise promise) Ends the execution of an async method.com.fasterxml.jackson.databind.JsonNodegetModuleNames(String moduleName) Returns all names for a jsii module.com.fasterxml.jackson.databind.JsonNodegetPropertyValue(JsiiObjectRef objRef, String property) Gets a value for a property from a remote object.com.fasterxml.jackson.databind.JsonNodegetStaticPropertyValue(String fqn, String property) Gets a value of a static property.voidloadModule(JsiiModule module) Loads a JavaScript module into the remote sandbox.Dequques all the currently pending callbacks.voidsetPropertyValue(JsiiObjectRef objRef, String property, com.fasterxml.jackson.databind.JsonNode value) Sets a value for a property in a remote object.voidsetStaticPropertyValue(String fqn, String property, com.fasterxml.jackson.databind.JsonNode value) Sets the value of a mutable static property.
-
Constructor Details
-
JsiiClient
Creates a new jsii-runtime client.- Parameters:
runtime- TheJsiiRuntime.
-
-
Method Details
-
loadModule
Loads a JavaScript module into the remote sandbox.- Parameters:
module- The module to load
-
createObject
public JsiiObjectRef createObject(String fqn, Collection<Object> initializerArgs, Collection<JsiiOverride> overrides, Collection<String> interfaces) Creates a remote jsii object.- Parameters:
fqn- The fully-qualified-name of the class.initializerArgs- Constructor arguments.overrides- A list of async methods to override. If a method is defined as an override, a callback will be scheduled when it is called, and the promise it returns will only be fulfilled when the callback is completed.- Returns:
- A jsii object reference.
-
deleteObject
Deletes a remote object.- Parameters:
objRef- The object reference.
-
getPropertyValue
public com.fasterxml.jackson.databind.JsonNode getPropertyValue(JsiiObjectRef objRef, String property) Gets a value for a property from a remote object.- Parameters:
objRef- The remote object reference.property- The property name.- Returns:
- The value of the property.
-
setPropertyValue
public void setPropertyValue(JsiiObjectRef objRef, String property, com.fasterxml.jackson.databind.JsonNode value) Sets a value for a property in a remote object.- Parameters:
objRef- The remote object reference.property- The name of the property.value- The new property value.
-
getStaticPropertyValue
Gets a value of a static property.- Parameters:
fqn- The FQN of the classproperty- The name of the static property- Returns:
- The value of the static property
-
setStaticPropertyValue
public void setStaticPropertyValue(String fqn, String property, com.fasterxml.jackson.databind.JsonNode value) Sets the value of a mutable static property.- Parameters:
fqn- The FQN of the classproperty- The property namevalue- The new value
-
callStaticMethod
public com.fasterxml.jackson.databind.JsonNode callStaticMethod(String fqn, String method, com.fasterxml.jackson.databind.node.ArrayNode args) Invokes a static method.- Parameters:
fqn- The FQN of the class.method- The method name.args- The method arguments.- Returns:
- The return value.
-
callMethod
public com.fasterxml.jackson.databind.JsonNode callMethod(JsiiObjectRef objRef, String method, com.fasterxml.jackson.databind.node.ArrayNode args) Calls a method on a remote object.- Parameters:
objRef- The remote object reference.method- The name of the method.args- Method arguments.- Returns:
- The return value of the method.
-
beginAsyncMethod
public JsiiPromise beginAsyncMethod(JsiiObjectRef objRef, String method, com.fasterxml.jackson.databind.node.ArrayNode args) Begins the execution of an async method.- Parameters:
objRef- The object reference.method- The name of the async method.args- Arguments for the method.- Returns:
- A
JsiiPromisewhich represents this method.
-
endAsyncMethod
Ends the execution of an async method.- Parameters:
promise- The promise returned by beginAsyncMethod.- Returns:
- The method return value.
-
pendingCallbacks
Dequques all the currently pending callbacks.- Returns:
- A list of all pending callbacks.
-
completeCallback
public void completeCallback(Callback callback, String error, String name, com.fasterxml.jackson.databind.JsonNode result) Completes a callback.- Parameters:
callback- The callback to complete.error- Error information (or null).name- Error type (or null).result- Result (or null).
-
getModuleNames
Returns all names for a jsii module.- Parameters:
moduleName- The name of the module.- Returns:
- The result (map from "lang" to language configuration).
-