Ganesh,
We have developed a java prgm that is called from a shell:
-------Put in your shell--------
(…)
Usage: java B2BShutdown [yes/no] [force/drain] [timeout]
[yes/no] = restart?
[force/drain] = immediate/wait?
[timeout] = minutes to wait before committing?
java TNShutdown no drain 30
(…)
-------the corresponding java source----------
import java.io.*;
import java.util.Vector;
import com.wm.util.Table;
import com.wm.util.Values;
import com.wm.app.b2b.util.GenUtil;
import com.wm.app.b2b.client.Context;
import com.wm.app.b2b.client.ServiceException;
import com.wm.util.coder.ValuesCodable;
public class TNShutdown {
public static void main(String[] args) {
if (args.length != 3) {
System.out.println("\nUsage: JavaCMD TNShutdown [yes/no] [force/drain] [timeout]\n");
System.out.println("\t[yes/no] = restart?");
System.out.println("\t[force/drain] = immediate/wait?");
System.out.println("\t[timeout] = minutes to wait before committing?\n");
System.exit(0);
}
// Edit these settings for your locale and then compile
String server = "localhost:<your port>";
String username = "<Admin User Name>";
String password = "<Pwd>";
// Edit these settings to your preference
String bounce = args[0];
String option = args[1];
String timeout = args[2];
Values in = new Values();
Context context = new Context();
try {
context.connect(server, username, password);
} catch (ServiceException e) {
System.out.println("\n\tCannot connect to server \""+server+"\"");
System.exit(0);
}
try {
in.put("bounce", bounce);
in.put("option", option);
in.put("timeout", timeout);
in = context.invoke("wm.server.admin", "shutdown", in);
} catch (ServiceException e) {
System.out.println("\n\tCould not shutdown server: " + e.getMessage());
System.exit(0);
}
System.out.println(in.getString("message"));
}
}
This should fulfil your need,
Regards,
Emmanuel
#webMethods-General#Integration-Server-and-ESB#webMethods