如何允许桌面应用程序调用同一台计算机上的 Java 应用程序上的方法

发布于 2024-10-02 11:04:59 字数 180 浏览 1 评论 0原文

因此,我希望能够允许驻留在同一台计算机上的其他应用程序调用我的 Java 应用程序。

该调用将启动应用程序(如果未运行)并调用该方法,或者仅调用该方法。

理想情况下,通信应该独立于语言,因为调用应用程序可以用任何语言编写。

有没有人以前这样做过并且可以建议要探索/避免的事情?

谢谢

So I'd like to be able to allow other applications residing on the same machine to call into my Java application.

The call would either launch the app if not running and invoke the method or just invoke the method.

Ideally the communication should be language independent as calling application could be written in any language.

Has anyone done this before and can suggest things to explore/avoid?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不及他 2024-10-09 11:04:59

我会使用 TCP 并将您的应用程序变成守护进程。如果您希望您的应用程序易于与其他平台集成,则应使用您定义的基于文本的协议来满足您的需求。

如果不需要传输复杂的结构,请避免使用 XML。 (如果您需要更复杂的数据传输,我会选择 JSON)。

如果您不熟悉套接字编程,这可能会有所帮助:

http://download.oracle。 com/javase/tutorial/networking/sockets/

I'd use TCP and make your application into a daemon. If you want your application to be easy for other platforms to integrate with, you should use a text based protocol that you define to suit your needs.

And avoid XML if you don't need to transport complex structures. (I'd go for JSON if you need more complex data transfer).

If you are new to socket programming, this might help:

http://download.oracle.com/javase/tutorial/networking/sockets/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文