1 package com.bull.eclipse.jonas; 2 3 7 8 import java.io.File ; 9 import java.util.Vector ; 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 21 public class Jonas31Bootstrap extends JonasBootstrap { 22 23 private String startCommand = "org.objectweb.jonas.server.Server"; 24 private String adminCommand = "org.objectweb.jonas.adm.JonasAdmin"; 25 private String mainClass = "org.objectweb.jonas.server.Bootstrap"; 26 29 public String [] getClasspath() { 30 String [] classpath = new String [4]; 31 classpath[0] = getJonasDir() + File.separator + "lib" + File.separator + "common" + File.separator + "ow_jonas_bootstrap.jar"; 32 String toolsJarLocation = VMLauncherUtility.getVMInstall().getInstallLocation() + File.separator + "lib" + File.separator + "tools.jar"; 34 classpath[1] = toolsJarLocation; 35 String templateDir = TemplateDirUtil.getTemplateDir(); 36 classpath[2] = templateDir; 37 String jonasConfig = getJonasDir() + File.separator + "conf"; 38 classpath[3] = jonasConfig; 39 40 return classpath; 41 } 42 43 44 47 public String getMainClass() { 48 return mainClass; 49 } 50 51 54 public String getStartCommand() { 55 return startCommand; 56 } 57 58 61 public String getStopCommand() { 62 return adminCommand; 63 64 } 65 66 public String getAdminCommand() { 67 return adminCommand; 68 69 } 70 71 public String [] getPrgArgs(String command,String [] options) { 72 if ((command.equals(adminCommand)) && (options == null)) { 73 String [] prgArgs = new String [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 [] prgArgs = new String [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 String [] prgArgs = new String [1]; 91 prgArgs[0] = command; 92 return prgArgs; 93 } 94 } 95 96 97 } 98 99 100 103 public String [] getVmArgs() { 104 String [] vmArgs = new String [8]; 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 116 return vmArgs; 117 } 118 119 120 123 public String getLabel() { 124 return "Jonas 3.1.x, 3.2.x, 3.3.x"; 125 } 126 127 130 public Vector getJonasJarPath() { 131 Vector vec = new Vector (); 132 IPath libPath = new Path("lib").append("jonas.jar"); 133 vec.add(libPath); 134 return vec; 135 } 136 137 138 141 public Vector getJonasWebJarPath() { 142 Vector vec = new Vector (); 143 IPath libPath = new Path("lib").append("web_catalina.jar"); 144 vec.add(libPath); 145 146 return vec; 147 } 148 } 149 150 | Popular Tags |