最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

how to call a java @entrypoint method (of a graalvm native image shared library) with non-primitive types from C - Stack Overflo

programmeradmin5浏览0评论

So I'm trying to invoke a foreign Java method annotated with @CEntryPoint from a Python application. The input to the method should be a C struct generated from a Python dict and the output, a C struct that's parsed into a Python dict for further handling.

I've failed to find any official docs/resources on passing/returning anything other than primitive types or string. How can I modify the method below such that a complex data type can be passed from Python to Java and back? Additionally, is the approach I've described the faster way of communicating between Python and Java and what could be a better alternative?

@CEntryPoint(name = "call_engine")
public static Output callEngine(IsolateThread thread, Input input) {
    final String id = input.getId();
    final Map<String, String> input.getMap();
    ...
}

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论