1 31 package org.objectweb.proactive.ic2d.gui.process; 32 33 import org.objectweb.proactive.core.process.UniversalProcess; 34 import org.objectweb.proactive.ic2d.gui.util.MessagePanel; 35 36 39 public class JVMProcessWrapper { 40 41 private UniversalProcess process; 42 private MessagePanel messagePanel; 43 44 private String name; 45 private String username; 46 private String hostname; 47 private String javaPath; 48 private String policyFile; 49 private String classpath; 50 private String classname; 51 private String parameters; 52 53 57 public JVMProcessWrapper(UniversalProcess process, MessagePanel messagePanel, String javaPath, String policyFile, String classpath, String classname, String parameters) { 58 this(process, messagePanel, javaPath, policyFile, classpath, classname, parameters, null, null); 59 } 60 61 public JVMProcessWrapper(UniversalProcess process, MessagePanel messagePanel, String javaPath, String policyFile, String classpath, 62 String classname, String parameters, String hostname, String username) { 63 this.process = process; 64 this.messagePanel = messagePanel; 65 this.javaPath = javaPath; 66 this.policyFile = policyFile; 67 this.classpath = classpath; 68 this.classname = classname; 69 this.parameters = parameters; 70 this.username = username; 71 this.hostname = hostname; 72 if (hostname != null) { 73 this.name = hostname+" | "+classpath; 74 } else { 75 this.name = "local | "+classpath; 76 } 77 } 78 79 83 public String getName() { 84 return name; 85 } 86 87 public String getClasspath() { 88 return classpath; 89 } 90 91 public String getJavaPath() { 92 return javaPath; 93 } 94 95 public String getPolicyFile() { 96 return policyFile; 97 } 98 99 public String getClassname() { 100 return classname; 101 } 102 103 public String getParameters() { 104 return parameters; 105 } 106 107 public String getHostname() { 108 return hostname; 109 } 110 111 public String getUsername() { 112 return username; 113 } 114 115 public String toString() { 116 return name; 117 } 118 119 public javax.swing.JPanel getPanel() { 120 return messagePanel; 121 } 122 123 public UniversalProcess getProcess() { 124 return process; 125 } 126 127 128 public void startProcess() { 129 try { 130 process.startProcess(); 131 } catch (java.io.IOException e) { 132 messagePanel.getMessageLogger().log("Problem when starting the process", e); 133 } 134 } 135 136 public void stopProcess() { 137 process.stopProcess(); 138 } 139 140 144 148 } 149 | Popular Tags |