My Web service will run on a Jboss App Server or a Websphere app Server. For both of them I need to know the instance name, for Jboss I can use System.getProperty("jboss.server.name"),
but what can I use for WebSphere? I can't use WebSphere-specific methods, I need to call System.properties
Thanks
An alternative, at least for WebSphere, is to look it up in the JNDI tree. This is what I use:
InitialContext ic = new javax.naming.InitialContext();
String serverName = ic.lookup("servername").toString();
This way I don't have to configure anything as WebSphere binds that information for me.
Cell and node name can also be retrieved using "thisNode/cell/cellname" and "thisNode/nodename". Something useful in clusters.