public void runTask()
{
state = State.RUNNING;
starting = false;
lastException = null;
final ProgressDialog dlg = getProgressDialog();
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
String cmdLine = getStopCommandLineName();
printEquivalentCommandLine(cmdLine, getCommandLineArguments(),
INFO_CTRL_PANEL_EQUIVALENT_CMD_TO_STOP_SERVER.get());
dlg.setSummary(Message.raw(
Utilities.applyFont(
INFO_CTRL_PANEL_STOPPING_SERVER_SUMMARY.get().toString(),
ColorAndFontConstants.defaultFont)));
}
});
// To display new status
getInfo().regenerateDescriptor();
getInfo().stopPooling();
try
{
ArrayList<String> arguments = getCommandLineArguments();
String[] args = new String[arguments.size()];
arguments.toArray(args);
returnCode = executeCommandLine(getStopCommandLineName(), args);
if (returnCode != 0)
{
state = State.FINISHED_WITH_ERROR;
}
else
{
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
getProgressDialog().getProgressBar().setIndeterminate(false);
dlg.getProgressBar().setValue(30);
dlg.appendProgressHtml(Utilities.applyFont(
"<b>"+INFO_CTRL_PANEL_SERVER_STOPPED.get()+"</b><br><br>",
ColorAndFontConstants.progressFont));
String cmdLine = getStartCommandLineName();
printEquivalentCommandLine(cmdLine, getStartCommandLineArguments(),
INFO_CTRL_PANEL_EQUIVALENT_CMD_TO_START_SERVER.get());
dlg.setSummary(Message.raw(
Utilities.applyFont(
INFO_CTRL_PANEL_STARTING_SERVER_SUMMARY.get().toString(),
ColorAndFontConstants.defaultFont)));
}
});