How to start/stop java app running on a different JVM

Discussions

General J2EE: How to start/stop java app running on a different JVM

  1. How to start/stop java app running on a different JVM (4 messages)

    Hi,
     Can somebody tell me how to control(start and stop etc ) a java-app running on a different JVM from another app running on a different jvm.
    Thanks
    Regards,
    Puru

    Previously we implemented this using JMS, but in this case we cannot use JMS.
  2. You can go by the ideas from this thread:
    http://www.theserverside.com/discussion/thread.jsp?thread_id=17463

    Instead of just opening the socket, also listen on it for "close" requests and stuff like that.
    If you need something more elaborate thea just sending a few simple commands, you might want to consider using RMI instead (although that makes it harder for non-java stuff, like shell scripts, to close the VM without loading up a whole new VM to call the RMI close command).

    Gal
  3. Thanks for your reply. I have used UDP IPMulticasting to send the message. It seems to be working ok, does anybody see anydrawbacks in using UDP ipmulticasting
    Thanks
    Puru

    > You can go by the ideas from this thread:
    > http://www.theserverside.com/discussion/thread.jsp?thread_id=17463
    >
    > Instead of just opening the socket, also listen on it for "close" requests and stuff like that.
    > If you need something more elaborate thea just sending a few simple commands, you might want to consider using RMI instead (although that makes it harder for
    non-java stuff, like shell scripts, to close the VM without loading up a whole new VM to call the RMI close command).
    >
    > Gal
  4. You would have to be in the same local network for the multicast to reach the running VM. Also, you would have to devise some sort of mechanism to recover from packet delivery errors, UDP won't do that for you.
    Why did you decide to go with UDP (and multicasting) rather than TCP?

    p.s. I'm not sure if multicasting would work on Windows machines with no network connection or a loopback driver installed (I mean you won't be able to stop the application from this isolated Windows machine).

    Gal
  5. I wanted to stop a set of services with one command. So used UDP multicasting.
    Puru