Search in sources :

Example 1 with StopBrokerEnvTask

use of com.cubrid.cubridmanager.core.broker.task.StopBrokerEnvTask in project cubrid-manager by CUBRID.

the class StopBrokerEnvAction method run.

/**
	 * Override the run method in order to complete stopping broker environment
	 */
public void run() {
    if (!CommonUITool.openConfirmBox(CONFIRM_CONTENT)) {
        return;
    }
    final Object[] obj = this.getSelectedObj();
    CubridBrokerFolder selection = (CubridBrokerFolder) obj[0];
    if (null == selection) {
        return;
    }
    ServerInfo serverInfo = selection.getServer().getServerInfo();
    StopBrokerEnvTask task = new StopBrokerEnvTask(serverInfo);
    TaskExecutor taskExecutor = new CommonTaskExec(Messages.stopBrokerEnvTaskName);
    taskExecutor.addTask(task);
    new ExecTaskWithProgress(taskExecutor).exec();
    if (!taskExecutor.isSuccess()) {
        return;
    }
    selection.setRunning(false);
    TreeViewer treeViewer = (TreeViewer) this.getSelectionProvider();
    CommonUITool.refreshNavigatorTree(treeViewer, selection);
    ActionManager.getInstance().fireSelectionChanged(getSelection());
}
Also used : CommonTaskExec(com.cubrid.common.ui.spi.progress.CommonTaskExec) StopBrokerEnvTask(com.cubrid.cubridmanager.core.broker.task.StopBrokerEnvTask) TaskExecutor(com.cubrid.common.ui.spi.progress.TaskExecutor) ServerInfo(com.cubrid.cubridmanager.core.common.model.ServerInfo) TreeViewer(org.eclipse.jface.viewers.TreeViewer) ExecTaskWithProgress(com.cubrid.common.ui.spi.progress.ExecTaskWithProgress) CubridBrokerFolder(com.cubrid.cubridmanager.ui.spi.model.CubridBrokerFolder)

Aggregations

CommonTaskExec (com.cubrid.common.ui.spi.progress.CommonTaskExec)1 ExecTaskWithProgress (com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)1 TaskExecutor (com.cubrid.common.ui.spi.progress.TaskExecutor)1 StopBrokerEnvTask (com.cubrid.cubridmanager.core.broker.task.StopBrokerEnvTask)1 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)1 CubridBrokerFolder (com.cubrid.cubridmanager.ui.spi.model.CubridBrokerFolder)1 TreeViewer (org.eclipse.jface.viewers.TreeViewer)1