[jboss-user] [Beginners Corner] - Re: Spawning processes from JBoss App Server
dilip_anant
do-not-reply at jboss.com
Fri Aug 17 03:21:31 EDT 2007
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#4075100
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4075100
More information about the jboss-user
mailing list