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.
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.
This way by looking up the object from JNDI and query getServerName(), I can know what server I am connecting to.
Will this work?
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.