• 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

Connecting to running java process

 
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to be able to connect and run methods from an existing class that is running as a daemon process on a UNIX system. How do I issue commands / method calls from an external class to interact with the running process?

Thanks in advance.
[ July 13, 2007: Message edited by: Sam Smoot ]
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The running class probably needs to be a server of some kind, with server loosely defined as any process that waits for requests from clients.

It's pretty easy to write a socket server that accepts simple string requests from clients and sends string responses. See the Sun Networking Tutorial for details - the Socket chapter builds simple clients and servers you can largely borrow.

Other forms of "being a server" get more complex but might be appropriate if you need to have more complex conversations between objects. RMI might be the next step up the ladder.

Does that seem to fit the problem?
 
You firghten me terribly. I would like to go home now. Here, take this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic