users@glassfish.java.net

Re: restart glassfishv2u2 programmatically

From: <glassfish_at_javadesktop.org>
Date: Thu, 18 Sep 2008 11:00:17 PDT

>but when i asked what is the difference b/w manually and programmatically when you have run the script for both i meant how do they differ in terms of implimentation.

Programmatically:

I use my Administration Client to call my restart jax-rpc webservice method(in that glassfish that should be restarted) which calls the Restarter.class and the Restarter calls the restartgf.bat.

public class Restarter extends Thread {
    public void run() {
        try {
            Process p = Runtime.getRuntime().exec("d:/dev/server/bin/restartgf.bat");
            BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
            String line;
            while ((line = input.readLine()) != null) {
                System.out.println("RESTARTER:" + line);
            }
            input.close();
        } catch (Exception ioe) {
            ioe.printStackTrace();
        }
    }
}

>Can you please modify my script and introduce a timegap of 5 mins instead of 30 secs and then tryagain

The same. The port 8080 is listening (5min)until "re start" cause the server to stop (because of the port conflict).


Thanx
[Message sent by forum member 'montsie' (montsie)]

http://forums.java.net/jive/thread.jspa?messageID=300198