KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > bull > eclipse > jonas > utils > EjbManagement


1 /*
2  * Created on 9 mars 2004
3  *
4  * To change the template for this generated file go to
5  * Window>Preferences>Java>Code Generation>Code and Comments
6  */

7 package com.bull.eclipse.jonas.utils;
8
9 import java.util.Iterator JavaDoc;
10 import java.util.Vector JavaDoc;
11
12 import com.bull.eclipse.jonas.JonasProject;
13
14 /**
15  * @author riase
16  *
17  * To change the template for this generated type comment go to
18  * Window>Preferences>Java>Code Generation>Code and Comments
19  */

20 public class EjbManagement {
21     
22     public static Vector JavaDoc getPackageNames(Vector JavaDoc ejbNames, JonasProject prj) {
23         Iterator JavaDoc it = ejbNames.iterator();
24         Vector JavaDoc ejbNameInProject = prj.getJarEjbName();
25         Vector JavaDoc pkgName = prj.getPackageProjectFolder();
26         Vector JavaDoc vec = new Vector JavaDoc();
27         while (it.hasNext()) {
28             String JavaDoc ejbName = (String JavaDoc) it.next();
29             for (int i=0;i<ejbNameInProject.size();i++) {
30                  if (ejbName.equals(ejbNameInProject.elementAt(i))) {
31                     vec.add(pkgName.elementAt(i));
32                     continue;
33                  }
34             }
35         }
36         return vec;
37     }
38
39
40     public static String JavaDoc getEjbName(String JavaDoc packEjb, JonasProject prj) {
41         Vector JavaDoc vec = prj.getPackageProjectFolder();
42         Vector JavaDoc ejbNames = prj.getJarEjbName();
43         for(int i=0;i<vec.size();i++) {
44             if (((String JavaDoc)vec.elementAt(i)).equals(packEjb)) {
45                 return ejbNames.elementAt(i).toString();
46             }
47         }
48         return null;
49     }
50
51 }
52
Popular Tags