KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > bull > eclipse > jonas > Jonas41Bootstrap


1 package com.bull.eclipse.jonas;
2
3 /*
4  * (c) Copyright Bull SA 2003.
5  * All Rights Reserved.
6  */

7
8 import java.io.File JavaDoc;
9 import java.util.Vector JavaDoc;
10
11 import org.eclipse.core.runtime.IPath;
12 import org.eclipse.core.runtime.Path;
13
14 import com.bull.eclipse.jonas.utils.TemplateDirUtil;
15 import com.bull.eclipse.jonas.utils.VMLauncherUtility;
16
17
18 /**
19  * See %JONAS_ROOT/bin/nt/jonas.bat
20  */

21 public class Jonas41Bootstrap extends JonasBootstrap {
22     
23     private String JavaDoc startCommand = "org.objectweb.jonas.server.Server";
24     private String JavaDoc adminCommand = "org.objectweb.jonas.adm.JonasAdmin";
25     private String JavaDoc mainClass = "org.objectweb.jonas.server.Bootstrap";
26     /*
27      * @see JonasBootstrap#getClasspath()
28      */

29     public String JavaDoc[] getClasspath() {
30         String JavaDoc[] classpath = new String JavaDoc[4];
31         classpath[0] = getJonasDir() + File.separator + "lib" + File.separator + "common" + File.separator + "ow_jonas_bootstrap.jar";
32         // Add tools.jar JDK file to classpath
33
String JavaDoc toolsJarLocation = VMLauncherUtility.getVMInstall().getInstallLocation() + File.separator + "lib" + File.separator + "tools.jar";
34         classpath[1] = toolsJarLocation;
35         String JavaDoc templateDir = TemplateDirUtil.getTemplateDir();
36         classpath[2] = templateDir;
37         String JavaDoc jonasConfig = getBaseDir() + File.separator + "conf";
38         classpath[3] = jonasConfig;
39
40         return classpath;
41     }
42
43
44     /*
45      * @see JonasBootstrap#getMainClass()
46      */

47     public String JavaDoc getMainClass() {
48         return mainClass;
49     }
50
51     /*
52      * @see JonasBootstrap#getStartCommand()
53      */

54     public String JavaDoc getStartCommand() {
55         return startCommand;
56     }
57
58     /*
59      * @see JonasBootstrap#getStopCommand()
60      */

61     public String JavaDoc getStopCommand() {
62         return adminCommand;
63
64     }
65
66     public String JavaDoc getAdminCommand() {
67         return adminCommand;
68
69     }
70
71     public String JavaDoc[] getPrgArgs(String JavaDoc command,String JavaDoc[] options) {
72         if ((command.equals(adminCommand)) && (options == null)) {
73             // Stop JOnAS
74
String JavaDoc[] prgArgs = new String JavaDoc[2];
75             prgArgs[0] = adminCommand;
76             prgArgs[1] = "-s";
77             return prgArgs;
78         } else {
79             if (options != null) {
80                 int nbOptions = options.length;
81                 String JavaDoc [] prgArgs = new String JavaDoc[nbOptions + 1];
82                 prgArgs[0] = adminCommand;
83                 for (int i=0; i<nbOptions; i++) {
84                         JonasLauncherPlugin.log("Option " + i + " =" + options[i]);
85                         prgArgs[i+1] = options[i];
86                 }
87                 return prgArgs;
88             } else {
89                 // On démarre JOnAS
90
String JavaDoc[] prgArgs = new String JavaDoc[1];
91                 prgArgs[0] = command;
92                 return prgArgs;
93             }
94         }
95     
96         
97     }
98
99
100     /*
101      * @see JonasBootstrap#getVmArgs()
102      */

103     public String JavaDoc[] getVmArgs() {
104         String JavaDoc[] vmArgs = new String JavaDoc[11];
105         
106         vmArgs[0] = "-Dinstall.root=" + getJonasDir();
107     
108         vmArgs[1] = "-Djava.security.policy=" + getJonasDir() + File.separator + "conf" + File.separator + "java.policy";
109         vmArgs[2] = "-Dobjectweb.orb=";
110         vmArgs[3] = "-Djonas.base=" + getBaseDir();
111         vmArgs[4] = "-Djonas.classpath=" + getXtraClasspath();
112         vmArgs[5] = "-Djonas.default.classloader=true";
113         vmArgs[6] = "-Djavax.rmi.CORBA.PortableRemoteObjectClass=org.objectweb.carol.rmi.multi.MultiPRODelegate";
114         vmArgs[7] = "-Djava.naming.factory.initial=org.objectweb.carol.jndi.spi.MultiOrbInitialContextFactory";
115         vmArgs[8] = "-Djava.security.auth.login.config=" + getBaseDir() + File.separator + "conf" + File.separator + "jaas.config";
116         vmArgs[9] = "-Djava.endorsed.dirs=" + getJonasDir() + File.separator + "lib" + File.separator + "endorsed";
117         vmArgs[10] = "-Djava.rmi.server.RMIClassLoaderSpi=org.objectweb.jonas.server.RemoteClassLoaderSpi";
118
119                     
120         return vmArgs;
121     }
122
123     
124     /**
125      * @see JonasBootstrap#getLabel()
126      */

127     public String JavaDoc getLabel() {
128         return "Jonas 4.1";
129     }
130
131     /**
132      * @see JonasBootstrap#getJonasRMIJarPath()
133      */

134     public Vector JavaDoc getJonasJarPath() {
135         Vector JavaDoc vec = new Vector JavaDoc();
136         IPath libPath = new Path("lib").append("common").append("j2ee").append("mail").append("mail.jar");
137         vec.add(libPath);
138         libPath = new Path("lib").append("common").append("j2ee").append("jts").append("jts-spec1_0.jar");
139         vec.add(libPath);
140         libPath = new Path("lib").append("common").append("j2ee").append("jta").append("jta-spec1_0_1.jar");
141         vec.add(libPath);
142         libPath = new Path("lib").append("common").append("j2ee").append("jms").append("jms.jar");
143         vec.add(libPath);
144         libPath = new Path("lib").append("common").append("j2ee").append("jacc").append("jacc-1_0.jar");
145         vec.add(libPath);
146         libPath = new Path("lib").append("common").append("j2ee").append("j2eemanagement").append("javax77.jar");
147         vec.add(libPath);
148         libPath = new Path("lib").append("common").append("j2ee").append("ejb").append("ejb-2_1-api.jar");
149         vec.add(libPath);
150         //libPath = new Path("lib").append("common").append("j2ee").append("ejb").append("deployment").append("deployment-1_1.jar");
151
//vec.add(libPath);
152
libPath = new Path("lib").append("common").append("j2ee").append("connector").append("connector-1_5.jar");
153         vec.add(libPath);
154         libPath = new Path("lib").append("common").append("j2ee").append("activation").append("activation.jar");
155         vec.add(libPath);
156         libPath = new Path("lib").append("common").append("ws").append("axis").append("axis.jar");
157         vec.add(libPath);
158         libPath = new Path("lib").append("common").append("ws").append("axis").append("jaxrpc.jar");
159         vec.add(libPath);
160         libPath = new Path("lib").append("common").append("ws").append("axis").append("commons-discovery.jar");
161         vec.add(libPath);
162         libPath = new Path("lib").append("common").append("ws").append("axis").append("saaj.jar");
163         vec.add(libPath);
164         libPath = new Path("lib").append("common").append("jakarta").append("commons-logging").append("commons-logging-api.jar");
165         vec.add(libPath);
166         libPath = new Path("lib").append("common").append("ow_jonas.jar");
167         vec.add(libPath);
168         libPath = new Path("lib").append("common").append("jotm").append("jotm.jar");
169         vec.add(libPath);
170         libPath = new Path("lib").append("common").append("carol").append("ow_carol_core.jar");
171         vec.add(libPath);
172
173         return vec;
174     }
175     
176
177     /**
178      * @see JonasBootstrap#getJonasWebJarPath()
179      */

180     public Vector JavaDoc getJonasWebJarPath() {
181         Vector JavaDoc vec = new Vector JavaDoc();
182         IPath libPath = new Path("lib").append("common").append("j2ee").append("jsp").append("jsp-2_0.jar");
183         vec.add(libPath);
184         libPath = new Path("lib").append("common").append("j2ee").append("servlet").append("servlet-2_4.jar");
185         vec.add(libPath);
186         
187         return vec;
188     }
189 }
190
191
Popular Tags