[erlang-questions] JInterface and node discovery

Joost Yervante Damad joost.damad@REDACTED
Wed Dec 13 11:28:17 CET 2006


Hi,

I'm playing with JInterface, but I'm not sure how to proceed with the 
following particular situation:

The JInterface starts an MBox, and thus gets a pid (A).
I have a second piece of code in an erlang node, which also has a pid (B).

Now the JIterface needs to know the pid B somehow as I want this to be it's 
interface partner to cross from java to erlang and back.

The problem I have is that almost all solutions to this "initial" problem 
require me to tell one of the parties the node name of the other party. 
However I'd rather have the JInterface node not know the other node and have 
the erlang node discover that the JInterface node is connected to the erlang 
cluster in a dynamic "triggered" way. One of the problem is that the 
JInterface node has no access to "globally registered" names. At least not 
without again first knowing the other node by name.

I was hoping there is some solution in OTP that allows me to e.g. register a 
pid as "listening" to events that tell topology changes in an Erlang cluster.
This would allow me to send a message to an JInterface from out of erlang 
whenever it is added to the cluster.

Does such a thing exist, or am I overlooking some other obvious solution?

Greetings, Joost



More information about the erlang-questions mailing list