use of com.cubrid.cubridmanager.core.broker.task.StartBrokerTask in project cubrid-manager by CUBRID.
the class RestartBrokerAction method run.
public void run() {
final Object[] obj = this.getSelectedObj();
DefaultCubridNode selection = (DefaultCubridNode) obj[0];
if (selection == null || selection.getServer() == null) {
return;
}
ServerInfo serverInfo = selection.getServer().getServerInfo();
if (serverInfo == null) {
return;
}
//stop first
StopBrokerTask stopTask = new StopBrokerTask(serverInfo);
stopTask.setBrokerName(selection.getLabel());
//then start again
StartBrokerTask startTask = new StartBrokerTask(serverInfo);
startTask.setBrokerName(selection.getLabel());
final String taskName = Messages.bind(Messages.restartBrokerTaskName, selection.getLabel());
TaskExecutor taskExecutor = new CommonTaskExec(taskName);
taskExecutor.addTask(stopTask);
taskExecutor.addTask(startTask);
new ExecTaskWithProgress(taskExecutor).exec();
if (!taskExecutor.isSuccess()) {
return;
}
TreeViewer treeViewer = (TreeViewer) this.getSelectionProvider();
CommonUITool.refreshNavigatorTree(treeViewer, selection.getParent());
ActionManager.getInstance().fireSelectionChanged(getSelection());
}
use of com.cubrid.cubridmanager.core.broker.task.StartBrokerTask in project cubrid-manager by CUBRID.
the class StartBrokerAction method run.
/**
* Override the run method in order to complete starting broker environment
*
*/
public void run() {
final Object[] obj = this.getSelectedObj();
DefaultCubridNode selection = (DefaultCubridNode) obj[0];
ServerInfo site = selection.getServer().getServerInfo();
StartBrokerTask task = new StartBrokerTask(site);
task.setBrokerName(selection.getLabel());
final String taskName = Messages.bind(Messages.startBrokerTaskName, selection.getLabel());
TaskExecutor taskExecutor = new CommonTaskExec(taskName);
taskExecutor.addTask(task);
new ExecTaskWithProgress(taskExecutor).exec();
if (!taskExecutor.isSuccess()) {
return;
}
TreeViewer treeViewer = (TreeViewer) this.getSelectionProvider();
CommonUITool.refreshNavigatorTree(treeViewer, selection.getParent());
ActionManager.getInstance().fireSelectionChanged(getSelection());
}
Aggregations