我正在使用 comet 服务器,我希望它与 C++ 交互。
我正在使用 persevere 来编写控制远程硬件的应用程序。 Persevere 是用 Java 编写的,不提供替代 API。
我使用基于 Web 的 GUI 作为控制面板。 到目前为止,一切都很好。
我可以像 dojo 一样使用 REST 通道获取和设置数据,但问题是我真的不知道如何使用 REST 通道。 我应该使用哪个库来执行此操作?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用 gcc 作为工具链,您可以嵌入带有 GCJ 的 JVM 来在您的应用程序中运行 persevere。 GCJ 使用它的 CNI 接口(比 JNI 容易得多)。 我使用该方法在 C++ 应用程序中使用 Java 脚本。 您甚至可以将 persevere jar 编译到本机库中,并使用 GCJ 将其链接到您的应用程序。
最好的参考是 GCJ 文档。
还有一份 Linux Journal 包含文章Embedded Java with GCJ,您可以阅读。
您还可以研究使用 gcj 的应用程序。
If you use gcc as your toolchain you can embed a JVM with GCJ to run persevere inside your application. GCJ makes it easy to call C++ from Java with it's CNI interface (much easier than JNI). I used that method to use Java scripting inside our C++ application. You can even compile the persevere jar into a native library and link it to your app with GCJ.
The best reference is the GCJ Documentation.
There is also a Linux Journal contains the article Embedded Java with GCJ that you can read.
You can also study applications that use gcj.