• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

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...
 
Wait for it ... wait .... wait .... NOW! Pafiffle! A perfect tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic