Class EagerJsonInvocationImpl<T>
- java.lang.Object
-
- org.astonbitecode.j4rs.api.NativeInvocationBase
-
- org.astonbitecode.j4rs.api.invocation.EagerJsonInvocationImpl<T>
-
- All Implemented Interfaces:
JsonValue,NativeInvocation<T>,ObjectValue
public class EagerJsonInvocationImpl<T> extends NativeInvocationBase implements NativeInvocation<T>
-
-
Constructor Summary
Constructors Constructor Description EagerJsonInvocationImpl(T instance, Class<T> clazz)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NativeInvocationfield(String methodName)Retrieves the instance held under the Field fieldNameStringgetJson()TgetObject()Class<?>getObjectClass()voidinitializeCallbackChannel(long channelAddress)Initialize a callback channel for thisNativeInvocation.NativeInvocationinvoke(String methodName, InvocationArg... arg)Invokes a method of the instance of the class that is set for thisNativeInvocationvoidinvokeAsync(long functionPointer, String methodName, InvocationArg... args)Invokes asynchronously a method of the instance of the class that is set for thisNativeInvocation.NativeInvocationinvokeStatic(String methodName, InvocationArg... arg)Invokes a static method of the class that is set for thisNativeInvocationvoidinvokeToChannel(long channelAddress, String methodName, InvocationArg... args)Invokes a method of the instance of the class that is set for thisNativeInvocation.-
Methods inherited from class org.astonbitecode.j4rs.api.NativeInvocationBase
cast, cloneInstance
-
-
-
-
Method Detail
-
invoke
public NativeInvocation invoke(String methodName, InvocationArg... arg)
Description copied from interface:NativeInvocationInvokes a method of the instance of the class that is set for thisNativeInvocation- Specified by:
invokein interfaceNativeInvocation<T>- Parameters:
methodName- The method namearg- The arguments to use for invoking the method- Returns:
- A
NativeInvocationinstance containing the result of the invocation
-
invokeStatic
public NativeInvocation invokeStatic(String methodName, InvocationArg... arg)
Description copied from interface:NativeInvocationInvokes a static method of the class that is set for thisNativeInvocation- Specified by:
invokeStaticin interfaceNativeInvocation<T>- Parameters:
methodName- The static method namearg- The arguments to use for invoking the static method- Returns:
- A
NativeInvocationinstance containing the result of the invocation
-
invokeAsync
public void invokeAsync(long functionPointer, String methodName, InvocationArg... args)Description copied from interface:NativeInvocationInvokes asynchronously a method of the instance of the class that is set for thisNativeInvocation. The result of the invocation should be provided later using the performCallback method of aNativeCallbackSupportclass. Any possible returned objects from the actual synchronous invocation of the defined method will be dropped.- Specified by:
invokeAsyncin interfaceNativeInvocation<T>- Parameters:
functionPointer- The address of the function pointer that will be used later in the native side in order to actually paerform the callback.methodName- The method nameargs- The arguments to use when invoking the callback method (the functionPointer)
-
invokeToChannel
public void invokeToChannel(long channelAddress, String methodName, InvocationArg... args)Description copied from interface:NativeInvocationInvokes a method of the instance of the class that is set for thisNativeInvocation. The result of the invocation should be provided later using the doCallback method of aNativeCallbackToRustChannelSupportclass. Any possible returned objects from the actual synchronous invocation of the defined method will be dropped.- Specified by:
invokeToChannelin interfaceNativeInvocation<T>- Parameters:
channelAddress- The memory address of the channelmethodName- The method nameargs- The arguments
-
initializeCallbackChannel
public void initializeCallbackChannel(long channelAddress)
Description copied from interface:NativeInvocationInitialize a callback channel for thisNativeInvocation. The channel can be used by Java to send values to Rust using the doCallback method of aNativeCallbackToRustChannelSupportclass.- Specified by:
initializeCallbackChannelin interfaceNativeInvocation<T>- Parameters:
channelAddress- The memory address of the channel
-
field
public NativeInvocation field(String methodName)
Description copied from interface:NativeInvocationRetrieves the instance held under the Field fieldName- Specified by:
fieldin interfaceNativeInvocation<T>- Parameters:
methodName- The name of the field to retrieve- Returns:
- A
NativeInvocationinstance containing the defined field.
-
getObject
public T getObject()
- Specified by:
getObjectin interfaceObjectValue
-
getObjectClass
public Class<?> getObjectClass()
- Specified by:
getObjectClassin interfaceObjectValue
-
-