wood burning stoves 2.0*
The moose likes Websphere and the fly likes Getting Was node's name? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "Getting Was node Watch "Getting Was node New topic
Author

Getting Was node's name?

mik laan
Greenhorn

Joined: Sep 04, 2002
Posts: 29
Hello,
I have a clustered environment with multiple Was instances and clones.
Are there any Was related java class, JNDI entry or system property
(System.getProperty()) that could be used in my java applicalition to tell in which node my application is running?
Thanks,
Raj Varanasi
Greenhorn

Joined: Nov 20, 2001
Posts: 11
Hi,
Usually hostname will be node name for websphere in a clustered environment.You can use the following code(jsp code) to get the hostname in ur java application.This is for solaris environment.

<%@ page import="java.io.*"%>
<%
String command = "hostname";
Process p = Runtime.getRuntime().exec(command);
String s =null;
DataInputStream in = new DataInputStream(p.getInputStream());
while ((s = in.readLine()) != null) {
out.println("Hostname is: " + s);
}
%>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting Was node's name?