setUrn#

package: org.yuanrong.call.

Interface description#

public CppFunctionHandler<R> setUrn(String urn)#

When Java calls a stateless function in C++, set the functionUrn for the function.

  • Parameters:

    • urn - functionUrn, can be obtained after the function is deployed.

  • Returns:

    CppFunctionHandler<R>, with built-in invoke method, can create and call the cpp function instance.

public CppInstanceCreator setUrn(String urn)#

When Java calls a stateful function in C++, set the functionUrn for the function.

CppInstanceHandler cppInstance = YR.instance(CppInstanceClass.of("Counter","FactoryCreate"))
    .setUrn("sn:cn:yrk:default:function:0-opc-opc:$latest").invoke(1);
ObjectRef ref1 = cppInstance.function(CppInstanceMethod.of("Add", int.class)).invoke(5);
int res = (int)YR.get(ref1, 100);
  • Parameters:

    • urn - functionUrn, can be obtained after the function is deployed.

  • Returns:

    [CppInstanceCreator]struct-CppInstanceCreator.md), with built-in invoke method, can create instances of this cpp function class.

public JavaFunctionHandler<R> setUrn(String urn)#

When Java calls a stateless function in Java, set the functionUrn for the function.

ObjectRef ref1 = YR.function(JavaFunction.of("com.example.YrlibHandler$MyYRApp", "smallCall", String.class))
    .setUrn("sn:cn:yrk:default:function:0-perf-callee:$latest").invoke();
String res = (String)YR.get(ref1, 100);
  • Parameters:

    • urn - functionUrn, can be obtained after the function is deployed.

  • Returns:

    JavaFunctionHandler<R>, with built-in invoke method, can create and invoke the java function instance.

public JavaInstanceCreator setUrn(String urn)#

When Java calls a Java stateful function, set the functionUrn for the function.

JavaInstanceHandler javaInstance = YR.instance(JavaInstanceClass.of("com.example.YrlibHandler$MyYRApp"))
    .setUrn("sn:cn:yrk:default:function:0-perf-callee:$latest").invoke();
ObjectRef ref1 = javaInstance.function(JavaInstanceMethod.of("smallCall", String.class)).invoke();
String res = (String)YR.get(ref1, 100);
  • Parameters:

    • urn - functionUrn, can be obtained after the function is deployed.

  • Returns:

    JavaInstanceCreator, with built-in invoke method, can create instances of this Java function class.