KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > bull > eclipse > jonas > actions > ejb > ExportJarActionDelegate


1 package com.bull.eclipse.jonas.actions.ejb;
2
3
4 import java.util.Properties JavaDoc;
5 import java.util.Vector JavaDoc;
6
7 import com.bull.eclipse.jonas.JonasLauncherPlugin;
8 import com.bull.eclipse.jonas.JonasProject;
9 import com.bull.eclipse.jonas.actions.JonasProjectAbstractActionDelegate;
10 import com.bull.eclipse.jonas.utils.AntUtils;
11 import com.bull.eclipse.jonas.utils.UpdatePropsFile;
12 import com.bull.eclipse.newbean.JopeUpdateBean;
13
14
15
16 public class ExportJarActionDelegate extends JonasProjectAbstractActionDelegate
17 {
18
19     public boolean doActionOn(JonasProject prj) throws Exception JavaDoc {
20         // Update build.properties with JONAS_ROOT
21
Properties JavaDoc props = new Properties JavaDoc();
22         props.setProperty("jonas.root", JonasLauncherPlugin.getDefault().getJonasDir());
23         UpdatePropsFile.updatePropsProject(prj);
24
25         
26         String JavaDoc jonasRoot = JonasLauncherPlugin.getDefault().getJonasDir();
27         Vector JavaDoc pkgListe = prj.getPackageProjectFolder();
28         if (pkgListe == null) {
29             throw new Exception JavaDoc("There is no EJB");
30         } else if (pkgListe.isEmpty()) {
31             throw new Exception JavaDoc("There is no EJB");
32         }
33         JopeUpdateBean jub = new JopeUpdateBean(pkgListe,prj);
34         jub.generate();
35
36         AntUtils.runAnt(prj.getProject().getFullPath().append(prj.getSrcEJBDir()).append("/build.xml").toOSString());
37
38         //TODO Deploy EJB
39
/*
40         Vector jarName = prj.getJarEjbName();
41         Enumeration e = jarName.elements();
42         while (e.hasMoreElements()){
43             DeployEjbActionDelegate.deploy((String)e.nextElement() + ".jar");
44         }
45         */

46         
47         return false;
48     }
49
50
51     /**
52      * Create a new array : [ s1, s2, s3 ]
53      * (TODO move this method to StringUtil)
54      */

55     public static String JavaDoc[] concat( String JavaDoc[] s1, String JavaDoc s2, String JavaDoc s3 )
56     {
57         String JavaDoc[] full = new String JavaDoc[ s1.length + 2 ];
58         System.arraycopy( s1, 0, full, 0, s1.length );
59         full[ full.length-2 ] = s2;
60         full[ full.length-1 ] = s3;
61         return full;
62     }
63
64     /**
65      * Create a new array : [ s1, s2 ]
66      * (TODO move this method to StringUtil)
67      */

68     public static String JavaDoc[] concat( String JavaDoc[] s1, String JavaDoc s2 )
69     {
70         String JavaDoc[] full = new String JavaDoc[ s1.length + 1 ];
71         System.arraycopy( s1, 0, full, 0, s1.length );
72         full[ full.length-1 ] = s2;
73         return full;
74     }
75
76 }
77
78
Popular Tags