if (target == STATE_REBOOT) {
req = this.reqFactory.reboot();
if (req == null) {
throw new TaskNotImplementedException("reboot not implemented");
}
// would be cool to implement a 'reboot -> start-paused' option,
// (there may be a conceivable application use), but for now we
// expect reboot results in STATE_STARTED
resource.setTargetStateUnderLock(STATE_STARTED);
if (this.trace) {
logger.trace("\n\n ***** ST--start " + idStr +
": adding reboot request: " + req + "\n");
}
} else if (current == STATE_PAUSED) {
if (target == STATE_PAUSED) {
throw new ProgrammingError("current and target are " +
"both paused");
}
req = reqFactory.unpause();
if (req == null) {
throw new TaskNotImplementedException(
"unpause not implemented");
}
if (this.trace) {
logger.trace("\n\n ***** ST--start " + idStr +
": adding unpause request: " + req + "\n");
}
} else if (current == STATE_PROPAGATED) {
if (target == STATE_PAUSED) {
req = reqFactory.startPaused();
notifyPaused = true;
} else {
req = reqFactory.start();
}
if (req == null) {
throw new TaskNotImplementedException(
"start (create) not implemented");
}
if (this.trace) {
logger.trace("\n\n ***** ST--start " + idStr +
": adding start (create) request: " + req + "\n");
}
} else if (current == STATE_SERIALIZED) {
req = reqFactory.unserialize();
if (req == null) {
throw new TaskNotImplementedException(
"unserialize not implemented");
}
if (this.trace) {
logger.trace("\n\n ***** ST--start " + idStr +