-
1. Re: How to get the server being usign in HA-JNDI
brian.stansberry May 15, 2008 3:21 PM (in response to jin.peng)Sorry, no such API. What server a naming request goes to is determined as part of making the request; it isn't known in advance. And there's no API to expose what it was after the fact.
-
2. Re: How to get the server being used in HA-JNDI
jin.peng May 15, 2008 3:31 PM (in response to jin.peng)Thanks for the reply.
If I really want to know, can I register an object into clustered JNDI and the object return the local server name.
String getServerName().
This way by looking up the object from JNDI and query getServerName(), I can know what server I am connecting to.
Will this work?
Thanks,
Jin -
3. Re: How to get the server being usign in HA-JNDI
brian.stansberry May 15, 2008 4:00 PM (in response to jin.peng)If all you want to know is what server an object came from, the approach you describe can work. If you want to know something about what HA-JNDI will do in the future, it doesn't help. This is because HA-JNDI load balances naming requests. So you'll know what server that request went to. The next naming request will go to a different server.