//Project Webflow //Leader Tom Haupt import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import WebFlow.*; import WebFlow.event.*; import org.omg.CORBA.*; public class slave1 extends HttpServlet { // private String sMasterRef = new String("/home/T11F/webflow/WEBFLOW/JIGSAW/Jigsaw/WWW/Praveen/slave.ref"); private String cmd_line = "java WebFlow.Server /home/T11F/webflow/WEBFLOW/JIGSAW/Jigsaw/WWW/Praveen/QSslave.conf"; private WebFlowContext ws; private HttpServletResponse res; private ORB orb; String newLine; protected void doGet(HttpServletRequest req, HttpServletResponse r) throws ServletException, IOException { String status = new String(); String command = req.getParameter("command"); res=r; //----if URL is osprey4.npac.syr.edu:2956/servlets/fm3?command=start //----starts the WebFlowServer------------------------------------ System.out.println("out"); System.err.println("err"); try { Process prc_module_fac = Runtime.getRuntime().exec(cmd_line); status = "Executed: \n " + cmd_line; System.err.println(status); /* DataInputStream os= new DataInputStream(prc_module_fac.getInputStream()); System.err.println("os"); while( (newLine=os.readLine()) != null){ System.err.println(newLine);} */ PrintInBrowser(status); } catch (Exception ex) { System.err.println("Error in starting WebFlowServer :"+ex); status = "Cannot start " + cmd_line; } } //-------Prints the string status for the applet window------ public void PrintPlainText(String status) throws IOException { res.setContentType("text/html"); PrintWriter out = res.getWriter(); out.println(status); out.close(); } //-------Prints the string status in the browser window------ public void PrintInBrowser(String status) throws IOException { res.setContentType("text/html"); PrintWriter out = res.getWriter(); out.println("