0

I have 2 war packages which use one JVM. Is there some internal JVM facility similar to IPC/FIFO in Linux which I can use to send signals. In this case I prefer not to use sockets for security reasons. Communication will be only internal.

Peter Penzov
  • 1,126
  • 134
  • 430
  • 808
  • Take a look at https://stackoverflow.com/questions/10942427/how-to-have-2-jvms-talk-to-one-another It's topic is two seperate VMs, but it can be applied to your use case too. – Korashen Apr 11 '19 at 10:22
  • IS there way to use RMI internally? Only on the same JVM without opening network port? – Peter Penzov Apr 11 '19 at 10:25
  • I do not know a way to open RMI internally. I would go with an IP like 127.0.0.1 to loopback to itself. But if you exclude any kind of network, that would not work. But maybe someone else does have an idea. – Korashen Apr 11 '19 at 10:27
  • 1
    How about using jndi to look up your objects and then execute? – J_D Apr 11 '19 at 10:29
  • Can you share more about this idea? – Peter Penzov Apr 11 '19 at 10:29
  • The objects can be access in the same war or from a different war package via jndi. When your wars are deployed to an AS - Application Server, the classes contained inside will be bound. These classes maybe accessed in the context of the AS. Maybe this article may help: https://stackoverflow.com/questions/4365621/what-is-jndi-what-is-its-basic-use-when-is-it-used – J_D Apr 11 '19 at 10:35
  • Why not use a `Queue`? Or a `PipeInputStream` / `PipeOutputStream` pair? – Stephen C Apr 11 '19 at 10:35
  • @StephenC Can you share more about your idea, please? – Peter Penzov Apr 11 '19 at 10:45
  • 1
    Start by reading the javadocs for those classes. – Stephen C Apr 11 '19 at 13:26
  • What are your constraints (except security)? Are you looking for a synchronous or asynchronous paradigm? – tmarwen Apr 11 '19 at 13:51
  • I need to restart Spring Job from remote war package. So both options are welcome. – Peter Penzov Apr 11 '19 at 13:52

0 Answers0