1 package org.enhydra.shark.corbaclient.workflowadmin.definition.actions; 2 3 import java.awt.event.*; 4 5 import javax.swing.*; 6 7 import org.omg.WfBase.*; 8 import org.enhydra.shark.corba.WorkflowService.*; 9 import org.enhydra.shark.corbaclient.*; 10 import org.enhydra.shark.corbaclient.workflowadmin.*; 11 import org.enhydra.shark.corbaclient.workflowadmin.definition.*; 12 13 19 public class UnloadPackage extends ActionBase { 20 21 public UnloadPackage(PackageManagement pdm) { 22 super(pdm); 23 } 24 25 public void actionPerformed(ActionEvent e) { 26 PackageManagement pdm=(PackageManagement)actionPanel; 27 SharkAdmin workflowAdmin=pdm.getWorkflowAdmin(); 28 try { 29 String id=pdm.getSelectedPackageId(); 30 String ver=pdm.getSelectedPackageVersion(); 31 33 SharkAdmin.getPackageAmin().closePkgWithVersion(id,ver); 34 workflowAdmin.refresh(true); 35 } catch (PackageHasActiveProcesses nc){ 36 JOptionPane.showMessageDialog(workflowAdmin.getFrame(), 37 ResourceManager.getLanguageDependentString("ErrorTheSelectedPackageCannotBeUnloadedAtTheMoment"), 38 workflowAdmin.getAppTitle(),JOptionPane.ERROR_MESSAGE); 39 } catch (PackageInUse piu) { 40 JOptionPane.showMessageDialog(workflowAdmin.getFrame(), 41 ResourceManager.getLanguageDependentString("ErrorTheSelectedPackageCannotBeUnloadedAtTheMoment"), 42 workflowAdmin.getAppTitle(),JOptionPane.ERROR_MESSAGE); 43 } catch (Exception be) { 44 JOptionPane.showMessageDialog(workflowAdmin.getFrame(), 45 ResourceManager.getLanguageDependentString("ErrorTheSelectedPackageCannotBeUnloadedAtTheMoment"), 46 workflowAdmin.getAppTitle(),JOptionPane.ERROR_MESSAGE); 47 } 48 } 49 } 50 51 52 | Popular Tags |