This is the code snippet that does the job:
Runtime r = Runtime.getRuntime();
serverIPOrHostName = (String) bfuParameters.get(SERVERIP_HOSTNAME);
service = (String) bfuParameters.get(SERVICE_NAME);
String cmd = SERVICECHECK + SYMBOL + serverIPOrHostName + QUERY + service;
p = r.exec(cmd);
inp = p.getInputStream();
byte[] dataInput = new byte[320];
inp.read(dataInput);
String inputData = new String(dataInput);
//Logger added to read the service response.
logger.error(inputData);
//Checks for specified sequence of characters in the string and
//returns boolean.
if (inputData.contains(SERVICE_RUNNING)) {
result = 1;
} else {
result = 0;
}
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4075100#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...