James Carr
James Carr

Reputation: 807

How to allow desktop applications to invoke methods on a Java application on the same machine

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

Upvotes: 1

Views: 130

Answers (1)

Knubo
Knubo

Reputation: 8443

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/

Upvotes: 4

Related Questions