use of com.cubrid.cubridmanager.core.shard.task.StopShardTask in project cubrid-manager by CUBRID.
the class StopShardAction method run.
/**
* Override the run method in order to complete stopping broker environment
*/
public void run() {
final Object[] obj = this.getSelectedObj();
CubridShard selection = (CubridShard) obj[0];
if (null == selection) {
return;
}
if (!CommonUITool.openConfirmBox(CONFIRM_CONTENT)) {
return;
}
ServerInfo serverInfo = selection.getServer().getServerInfo();
StopShardTask task = new StopShardTask(serverInfo, selection.getName());
TaskExecutor taskExecutor = new CommonTaskExec(Messages.stopShardActionName);
taskExecutor.addTask(task);
new ExecTaskWithProgress(taskExecutor).exec();
if (!taskExecutor.isSuccess()) {
return;
}
if (!task.isSuccess()) {
String msg = Messages.bind(Messages.errCanNotStopShardBroker, task.getErrorMsg());
CommonUITool.openErrorBox(msg);
return;
}
selection.setRunning(false);
TreeViewer treeViewer = (TreeViewer) this.getSelectionProvider();
CommonUITool.refreshNavigatorTree(treeViewer, selection);
ActionManager.getInstance().fireSelectionChanged(getSelection());
}
use of com.cubrid.cubridmanager.core.shard.task.StopShardTask in project cubrid-manager by CUBRID.
the class StopShardEnvAction method run.
/**
* Override the run method in order to complete stopping broker environment
*/
public void run() {
final Object[] obj = this.getSelectedObj();
CubridShardFolder selection = (CubridShardFolder) obj[0];
if (null == selection) {
return;
}
if (!CommonUITool.openConfirmBox(CONFIRM_CONTENT)) {
return;
}
ServerInfo serverInfo = selection.getServer().getServerInfo();
StopShardTask task = new StopShardTask(serverInfo, null);
TaskExecutor taskExecutor = new CommonTaskExec(Messages.stopShardEnvActionName);
taskExecutor.addTask(task);
new ExecTaskWithProgress(taskExecutor).exec();
if (!taskExecutor.isSuccess()) {
return;
}
if (!task.isSuccess()) {
String msg = Messages.bind(Messages.errCanNotStopShardBroker, task.getErrorMsg());
CommonUITool.openErrorBox(msg);
return;
}
selection.setRunning(false);
TreeViewer treeViewer = (TreeViewer) this.getSelectionProvider();
CommonUITool.refreshNavigatorTree(treeViewer, selection);
ActionManager.getInstance().fireSelectionChanged(getSelection());
}
Aggregations