Search in sources :

Example 1 with StartBrokerEnvTask

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

the class StartBrokerEnvAction method run.

/**
	 * Override the run method in order to complete starting broker environment
	 * 
	 */
public void run() {
    final Object[] obj = this.getSelectedObj();
    CubridBrokerFolder selection = (CubridBrokerFolder) obj[0];
    if (null == selection) {
        return;
    }
    ServerInfo serverInfo = selection.getServer().getServerInfo();
    StartBrokerEnvTask task = new StartBrokerEnvTask(serverInfo);
    TaskExecutor taskExecutor = new CommonTaskExec(Messages.startBrokerEnvTaskName);
    taskExecutor.addTask(task);
    new ExecTaskWithProgress(taskExecutor).exec();
    if (!taskExecutor.isSuccess()) {
        return;
    }
    selection.setRunning(true);
    TreeViewer treeViewer = (TreeViewer) this.getSelectionProvider();
    CommonUITool.refreshNavigatorTree(treeViewer, selection);
    ActionManager.getInstance().fireSelectionChanged(getSelection());
}
Also used : CommonTaskExec(com.cubrid.common.ui.spi.progress.CommonTaskExec) 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) StartBrokerEnvTask(com.cubrid.cubridmanager.core.broker.task.StartBrokerEnvTask) 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 StartBrokerEnvTask (com.cubrid.cubridmanager.core.broker.task.StartBrokerEnvTask)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