1 package com.bull.eclipse.jonas.actions.ejb; 2 3 7 8 import java.io.File ; 9 import java.util.Vector ; 10 11 import org.eclipse.jdt.core.IPackageFragment; 12 13 import com.bull.eclipse.jonas.JonasLauncherPlugin; 14 import com.bull.eclipse.jonas.JonasProject; 15 import com.bull.eclipse.jonas.actions.JonasPackageAbstractActionDelegate; 16 17 public class UnDeployEjbActionDelegate extends JonasPackageAbstractActionDelegate { 18 19 public boolean doActionOn(IPackageFragment pack) throws Exception { 20 String packName = pack.getPath().removeFirstSegments(2).toOSString(); 21 JonasLauncherPlugin.log("PackName = " + packName); 22 String jarName = null; 23 JonasProject prj = JonasProject.create(pack.getJavaProject()); 24 Vector vec = prj.getPackageProjectFolder(); 25 if (vec != null) 26 for (int i = 0; i < vec.size(); i++) { 27 JonasLauncherPlugin.log("Element = " + vec.elementAt(i)); 28 if (vec.elementAt(i).toString().equals(packName)) { 29 JonasLauncherPlugin.log("Element = " + vec.elementAt(i)); 30 jarName = prj.getJarEjbName().elementAt(i).toString(); 31 continue; 32 } 33 } 34 if (jarName == null) { 35 jarName = packName.replace(File.separatorChar,'_'); 36 } 37 38 41 JonasLauncherPlugin.log("ejbFile = " + jarName + ".jar"); 42 String [] options = {"-r", jarName + ".jar"}; 43 JonasLauncherPlugin.getDefault().getJonasBootstrap().admin(options); 44 45 return false; 46 } 47 48 } 49 50 | Popular Tags |