protected int dasNotRunning(boolean local) throws CommandException {
if (!local)
throw new CommandException(
Strings.get("restart.dasNotRunningNoRestart"));
logger.warning(strings.get("restart.dasNotRunning"));
CLICommand cmd = habitat.getService(CLICommand.class, "start-domain");
/*
* Collect the arguments that also apply to start-domain.
* The start-domain CLICommand object will already have the
* ProgramOptions injected into it so we don't need to worry
* about them here.
*
* Usage: asadmin [asadmin-utility-options] start-domain
* [-v|--verbose[=<verbose(default:false)>]]
* [--upgrade[=<upgrade(default:false)>]]
* [--debug[=<debug(default:false)>]] [--domaindir <domaindir>]
* [-?|--help[=<help(default:false)>]] [domain_name]
*
* Only --debug, --domaindir, and the operand apply here.
*/
List<String> opts = new ArrayList<String>();
opts.add("start-domain");
if (debug != null) {
opts.add("--debug");
opts.add(debug.toString());
}
if (domainDirParam != null) {
opts.add("--domaindir");
opts.add(domainDirParam);
// XXX - would this be better?
//opts.add(getDomainRootDir().toString());
}
if (getDomainName() != null)
opts.add(getDomainName());
return cmd.execute(opts.toArray(new String[opts.size()]));
}