end - start);
System.exit(status);
}
static int execute(String[] args) {
AbortTask task;
try {
Configuration conf = parseConfiguration(args);
task = new AbortTask(conf.profile, conf.sessionId);
} catch (Exception e) {
HelpFormatter formatter = new HelpFormatter();
formatter.setWidth(Integer.MAX_VALUE);
formatter.printHelp(
MessageFormat.format(
"java -classpath ... {0}",
WindGateAbort.class.getName()),
OPTIONS,
true);
System.out.println("Note:");
System.out.println(" If session ID is not specified, this removes all sessions");
System.out.println("");
System.out.println(" Profile path accepts following URI formats:");
System.out.println(" no scheme -");
System.out.println(" Local file system path");
System.out.println(" \"classpath\" scheme -");
System.out.println(" Absolute path on class path (includes plugin libraries)");
System.out.println(" other schemes (e.g. http://...)-");
System.out.println(" Processed as a URL");
WGLOG.error(e, "E01001");
return 1;
}
try {
if (RuntimeContext.get().canExecute(task)) {
task.execute();
}
return 0;
} catch (Exception e) {
WGLOG.error(e, "E01002");
return 1;