KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > proactive > ic2d > gui > process > JVMProcessWrapper


1 /*
2 * ################################################################
3 *
4 * ProActive: The Java(TM) library for Parallel, Distributed,
5 * Concurrent computing with Security and Mobility
6 *
7 * Copyright (C) 1997-2002 INRIA/University of Nice-Sophia Antipolis
8 * Contact: proactive-support@inria.fr
9 *
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 * USA
24 *
25 * Initial developer(s): The ProActive Team
26 * http://www.inria.fr/oasis/ProActive/contacts.html
27 * Contributor(s):
28 *
29 * ################################################################
30 */

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 /**
37 * MonitoredRSHProcess
38 */

39 public class JVMProcessWrapper {
40
41   private UniversalProcess process;
42   private MessagePanel messagePanel;
43   
44   private String JavaDoc name;
45   private String JavaDoc username;
46   private String JavaDoc hostname;
47   private String JavaDoc javaPath;
48   private String JavaDoc policyFile;
49   private String JavaDoc classpath;
50   private String JavaDoc classname;
51   private String JavaDoc parameters;
52   
53   //
54
// -- CONSTRUCTORS -----------------------------------------------
55
//
56

57   public JVMProcessWrapper(UniversalProcess process, MessagePanel messagePanel, String JavaDoc javaPath, String JavaDoc policyFile, String JavaDoc classpath, String JavaDoc classname, String JavaDoc parameters) {
58     this(process, messagePanel, javaPath, policyFile, classpath, classname, parameters, null, null);
59   }
60
61   public JVMProcessWrapper(UniversalProcess process, MessagePanel messagePanel, String JavaDoc javaPath, String JavaDoc policyFile, String JavaDoc classpath,
62                                                String JavaDoc classname, String JavaDoc parameters, String JavaDoc hostname, String JavaDoc 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   //
80
// -- PUBLIC METHODS -----------------------------------------------
81
//
82

83   public String JavaDoc getName() {
84     return name;
85   }
86
87   public String JavaDoc getClasspath() {
88     return classpath;
89   }
90   
91   public String JavaDoc getJavaPath() {
92     return javaPath;
93   }
94   
95   public String JavaDoc getPolicyFile() {
96     return policyFile;
97   }
98   
99   public String JavaDoc getClassname() {
100     return classname;
101   }
102   
103   public String JavaDoc getParameters() {
104     return parameters;
105   }
106
107   public String JavaDoc getHostname() {
108     return hostname;
109   }
110
111   public String JavaDoc getUsername() {
112     return username;
113   }
114
115   public String JavaDoc toString() {
116     return name;
117   }
118   
119   public javax.swing.JPanel JavaDoc 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 JavaDoc e) {
132       messagePanel.getMessageLogger().log("Problem when starting the process", e);
133     }
134   }
135
136   public void stopProcess() {
137     process.stopProcess();
138   }
139
140   //
141
// -- PROTECTED METHODS -----------------------------------------------
142
//
143

144   //
145
// -- PRIVATE METHODS -----------------------------------------------
146
//
147

148 }
149
Popular Tags