• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to identify the JVM which your client applicaiton is using?

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have a look at System.getProperties() method
 
Akhil Jain
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks.i think we can get the type of vendor from these set of system properties...
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic