public void startInstance(String name, String opts) throws Exception {
getExistingInstance(name).start(opts);
}
public void startInstance(String name, String opts, boolean wait, boolean debug) throws Exception {
Instance child = getExistingInstance(name);
String options = opts;
if (options == null) {
options = child.getJavaOpts();
}
if (options == null) {
options = DEFAULT_OPTS;
}
if (debug) {
options += DEBUG_OPTS;
}
if (wait) {
String state = child.getState();
if (Instance.STOPPED.equals(state)) {
child.start(opts);
}
if (!Instance.STARTED.equals(state)) {
do {
Thread.sleep(500);
state = child.getState();
} while (Instance.STARTING.equals(state));
}
} else {
child.start(opts);
}
}