• 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

application instantiation

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a legacy win32 app that currently outputs data once a system event occurs. The win32 app has a feature that allows it to call an application and pass it that data using command line arguments. (ex. "java GuiApp -arg1")
I written a small GUI app that's supposed to list all those events as they occur, the problem I have is that on every event, a new application is started instead of the data being passed to the running application.
Is there any way that I can set it so that once an app is started, that any future calls to that app will default to the running one?
Thanks.
 
Ranch Hand
Posts: 1970
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ben Wu:
I have a legacy win32 app that currently outputs data once a system event occurs. The win32 app has a feature that allows it to call an application and pass it that data using command line arguments. (ex. "java GuiApp -arg1")
I written a small GUI app that's supposed to list all those events as they occur, the problem I have is that on every event, a new application is started instead of the data being passed to the running application.
Is there any way that I can set it so that once an app is started, that any future calls to that app will default to the running one?


No, I don't think you can do this as simply as you hope.
However, it's not that hard to achieve the effect that you want.
You need a small program that is started by your legacy application and makes a remote call to your permanently-running GUI application, passing the system event data, then exits.
The GUI application receives these remote calls and acts upon them.
If you write both programs in Java, you could use RMI for your remote calls. This has the advantage of being really easy.
However, starting a Java program is a fairly heavyweight operation. You might prefer that your short-lived program be something really small, in a language like C++. To achieve that, you could do the remote calls via CORBA (language-independent). Or, as the data you're passing is probably really simple, you could just use TCP/IP sockets.
 
Why is the word "abbreviation" so long? And this ad is so short?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic