use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.
the class ProductInfoHandlerBase method printConsoleMessage.
public void printConsoleMessage(String message, Object[] args) {
LocalizedMessage lMessage;
if (args != null) {
lMessage = LocalizedMessage.get(message, args);
} else {
lMessage = LocalizedMessage.get(message);
}
Console.println();
Console.println(lMessage);
Console.println();
}
use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.
the class ConfigHandlerBase method printConsoleMessage.
protected void printConsoleMessage(String message, Object[] args) {
LocalizedMessage lMessage;
if (args != null) {
lMessage = LocalizedMessage.get(message, args);
} else {
lMessage = LocalizedMessage.get(message);
}
Console.println();
Console.println(lMessage);
Console.println();
}
use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.
the class TaskRunner method writeLogSuccess.
private void writeLogSuccess(LocalizedMessage message1) {
if (message1 != null) {
LocalizedMessage message2 = LocalizedMessage.get(LOC_DR_MSG_TASK_EXECUTE_SUCCESS);
Object[] args = { message1.getMessage(), message2.getMessage() };
LocalizedMessage combinedMessage = LocalizedMessage.get(LOC_DR_MSG_TASK_LOG_COMBINED_MSG, args);
logInstall(combinedMessage);
}
}
use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.
the class TaskRunner method rollBackTask.
private void rollBackTask(TaskInfo taskInfo, ITask task, IStateAccess stateAccess) throws InstallException {
LocalizedMessage message = task.getRollBackMessage(stateAccess, taskInfo.getPropertiesMap());
printMessage(message);
Debug.log("TaskRunner.rollBackTask() - task: " + taskInfo.getName() + " for class: " + task.getClass().getName());
boolean result = task.rollBack(taskInfo.getName(), stateAccess, taskInfo.getPropertiesMap());
if (!result) {
// Task Undo failed
printError();
writeLogError(message);
} else {
// Task Undo Succeeded
printDone();
writeLogSuccess(message);
}
}
use of com.sun.identity.install.tools.util.LocalizedMessage in project OpenAM by OpenRock.
the class TaskRunner method runTasks.
public void runTasks() throws InstallAbortException, InstallException {
boolean exitStatus = false;
boolean continueForward = true;
int index = 0;
int taskCount = getTaskInfoList().size();
Debug.log("TaskRunner.runTasks() - Starting to execute tasks...");
while (!getTaskInfoList().isEmpty() && !exitStatus) {
TaskInfo taskInfo = (TaskInfo) getTaskInfoList().get(index);
String handlerClass = taskInfo.getClassName();
ITask task = (ITask) getTaskHandlers().get(handlerClass);
// Set the PersistentStateAccess marker
PersistentStateAccess stateAccess = getStateAccess();
markStateAccess(stateAccess, index);
if (continueForward) {
// Task Execution in progress
continueForward = executeTask(taskInfo, task, stateAccess);
} else {
// Undo operation in progress
rollBackTask(taskInfo, task, stateAccess);
}
index = (continueForward) ? index + 1 : index - 1;
if ((index >= taskCount) || (index < 0)) {
exitStatus = true;
}
}
if (!continueForward) {
// We have successully done Roll back for all the tasks. So, exit
Debug.log("TaskRunner.promptForUserAction() - Successfully " + "completed RollBack for all the tasks. Now Exiting..");
LocalizedMessage message = LocalizedMessage.get(LOC_DR_MSG_TASK_ABORT_REQUESTED);
throw new InstallAbortException(message);
}
}
Aggregations