if (!quiet) {
println("Connecting to Geronimo server: " + hostname + ":" + port);
}
BaseDeploymentFactory deploymentFactory = new BaseDeploymentFactory();
ConnectionParamsImpl connectionParams = new ConnectionParamsImpl(null, hostname, port, null, username, password, false, false, false, secure);
connection = new OnlineServerConnection(connectionParams, new ShellUserPasswordHandler(session), deploymentFactory);
}
// Disconnect previous connection if any
disconnect();