-
1. Re: Programmatically Determining Remoting Config
jaikiran Sep 7, 2012 3:59 AM (in response to wesjanik)Wesley Janik wrote:
The problem is, I'd like a way for the nodes of the cluster to discover their connection (host & port) info to publish to the other nodes.
I don't fully understand your use case. Why do you want to publish the cluster node information from within your application?
-
2. Re: Programmatically Determining Remoting Config
wesjanik Sep 7, 2012 8:30 AM (in response to jaikiran)Thanks for your prompt reply - I probably should have said what my end goal was . I'm trying to build a clustered singleton I can "talk to" (i.e. invoke methods on) similar to what's being discussed here https://community.jboss.org/message/745512#745512. What I'd ideally like to do is return some kind of EJB proxy that's hard-wired to talk to the node that constructed it. In this case, that would be the node the singleton is elected to run on. From what I understand, the best (only?) way to construct one of these proxies in a thread-safe way is using remote JNDI. I was figuring I could have the singleton service 'getValue' method return information on the node location, then construct an InitialContext to point to it.
Granted there are problems with this approach (most notably a new node could be elected between when the location information is retrieved and the EJB method invoked), but one thing at a time. Even more ideal would be the ability to pass arguments to the 'getValue' method and proxy the invocation through the singleton service to a local EJB, but from what I understand that's not possible.