KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > swingclient > workflowadmin > monitoring > actions > TerminateProcess


1 package org.enhydra.shark.swingclient.workflowadmin.monitoring.actions;
2
3 import java.awt.event.*;
4
5
6
7 import org.enhydra.shark.api.client.wfmodel.*;
8 import org.enhydra.shark.swingclient.*;
9 import org.enhydra.shark.swingclient.workflowadmin.*;
10 import org.enhydra.shark.swingclient.workflowadmin.monitoring.*;
11
12 /**
13  * Terminates selected process.
14  *
15  * @author Sasa Bojanic
16  * @version 1.0
17  */

18 public class TerminateProcess extends ActionBase {
19
20    public TerminateProcess (ProcessMonitor pm) {
21       super(pm);
22    }
23
24    public void actionPerformed(ActionEvent e) {
25       ProcessMonitor pm=(ProcessMonitor)actionPanel;
26       SharkAdmin workflowAdmin=pm.getWorkflowAdmin();
27
28       try {
29          WfProcess proc=pm.getProcessViewer().getCurrentProcess();
30          if (proc!=null) {
31             try{
32                proc.terminate();
33             } catch (Exception JavaDoc ex) {}
34             workflowAdmin.refresh(true);
35          }
36       } catch (Exception JavaDoc ex){}
37    }
38 }
39
Popular Tags