/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: TaskRunner.java,v 1.3 2008/09/09 16:59:33 leiming Exp $
*
*/
setTaskInfoList(new ArrayList());
setTaskHandlers(new HashMap());
}
boolean exitStatus = false;
boolean continueForward = true;
int index = 0;
// Set the PersistentStateAccess marker
if (continueForward) { // Task Execution in progress
} else { // Undo operation in progress
}
exitStatus = true;
}
}
if (!continueForward) {
// We have successully done Roll back for all the tasks. So, exit
+ "completed RollBack for all the tasks. Now Exiting..");
throw new InstallAbortException(message);
}
}
boolean continueForward = true;
.getPropertiesMap());
if (!result) { // Task Execution failed
printError();
if (!continueForward) { // Need to roll back!
}
} else {
printDone();
}
return continueForward;
}
if (!result) { // Task Undo failed
printError();
} else { // Task Undo Succeeded
printDone();
}
}
{
if (index < getInstanceTasksOffset()) {
stateAccess.setCommonDataFlag(true);
} else {
stateAccess.setCommonDataFlag(false);
}
}
throws InstallException {
{
// Include common tasks if fresh install or last install
} else {
}
}
+ "Handlers");
for (int i = 0; i < cCount; i++) {
// Initialize the handler class if is not present.
// Handler not present. Intialize and add it
try {
.newInstance();
} catch (Exception e) {
+ "to intialize Task Handler for task: "
throw new InstallException(lMessage);
}
}
}
}
}
}
private void printError() {
if (!isSilentMode()) {
}
}
}
}
private void printDone() {
if (!isSilentMode()) {
}
}
}
}
boolean continueForward = true;
if (!isSilentMode() && isInstallMode()) {
.interact(getStateAccess());
if (status.getIntValue() ==
+ "to roll back previous Tasks");
continueForward = false;
} else if (status.getIntValue() ==
+ "ABORT the installation.");
throw new InstallAbortException(message);
}
}
return continueForward;
}
return stateAccess;
}
private boolean isSilentMode() {
return isSilentMode;
}
private int getInstanceTasksOffset() {
return instanceTasksOffset;
}
return taskInfoList;
}
return taskHandlers;
}
}
private boolean isInstallMode() {
return installMode;
}
taskInfoList = list;
}
}
this.stateAccess = stateAccess;
}
isSilentMode = mode;
}
}
instLogger = logger;
}
this.installMode = installMode;
}
private int instanceTasksOffset;
private boolean isSilentMode;
"DR_ERR_TASK_INIT_FAILED";
"DR_MSG_TASK_ABORT_REQUESTED";
"DR_ERR_TASK_EXECUTE_FAIL";
"DR_MSG_TASK_EXECUTE_DONE";
"DR_MSG_TASK_EXECUTE_SUCCESS";
"DR_MSG_TASK_LOG_COMBINED_MSG";
}