public int execute(Object opaque) {
if (! (opaque instanceof ShutdownCLParser)) {
throw new IllegalArgumentException("Argument type is [" + opaque.getClass() + "]; expected [" + ShutdownCLParser.class + "]");
}
ShutdownCLParser parser = (ShutdownCLParser) opaque;
port = parser.getPort();
if (port == null) {
port = new Integer(DEFAULT_PORT);
}
host = parser.getHost();
if (host == null) {
host = "localhost";
}
secure = parser.isSecure();
if (secure) {
try {
DeployUtils.setSecurityProperties();
} catch (DeploymentException e) {
System.err.println(e.getMessage());
return 1;
}
}
user = parser.getUser();
password = parser.getPassword();
if (user == null && password == null) {
String uri = DeployUtils.getConnectionURI(host, port, secure);
ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(DeployUtils.class.getClassLoader());