• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Communicaton between Java programs

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a Java application running on a machine; I also have another Java application which I think is running on the same machine, but for arguments sake let's assume it is not (in case I am wrong).

What are the possible ways that I can get data to be exchanged between an object in one application with an object in the other? Ideally I would like the solution to be as easy as possible to implement (wouldn't we all).

Kind regards,

Tony.
 
Ranch Hand
Posts: 1170
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Easy as possible would be Java's Remove Method Invocation API. See the documentation for RMI.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want to exchange objects, you can open a ServerSocket on one machine, and connect to it through a Socket from the other. Then you can serialize objects over the connection.
If you want to invoke methods, RMI might be the way to go, although it does add some complexity.
If you don't mind considerable complexity, you can run an embedded Tomcat with Axis, and make web service calls. But that sounds like overkill for what you describe.
 
Tony Bateman
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The RMI sounds like a good solution because I will want to call methods on the object.

Thanks!

- Tony.
 
reply
    Bookmark Topic Watch Topic
  • New Topic