I have some stuff deployerd on WAS6 server. and i am trying to lookup jndi name from two different clients
1. Application client using IBM jvm
2. Application client using SUN jvm
for jndi lookup both the SUN jvm and IBM jvm uses different Context Factories.
How can i identify the client's JVM at runtime so that i can pass correct Context Factory to lookup jndi names on server.
some thing like:
........
String CLIENT_INFO = getClientInfo();
.......
....
if(CLIENT_INFO.equalsIgnoreCase("IBM"))
this.initialContextFactory=com.ibm.websphere.naming.WsnInitialContextFactory
else
this.initialContextFactory=com.sun.jndi.cosnaming.CNCtxFactory
...
...
public String getClientInfo(){
//Code to identify whether the client is using sun jvm or ibm jvm
//return the string saying that its "SUN" or "IBM"
return "SUN" or "IBM";
}
[ March 24, 2006: Message edited by: Akhil Jain ]