1 |
mojays |
2 |
package appl.parallel.starter.client; |
2 |
|
|
|
3 |
|
|
import java.rmi.RemoteException; |
4 |
|
|
|
5 |
|
|
import appl.parallel.starter.Starter; |
6 |
|
|
|
7 |
|
|
/** |
8 |
|
|
* Just a small container class used e.g. in the |
9 |
|
|
* {@link XuluStarterControllerFrame} for display |
10 |
|
|
* |
11 |
|
|
* @author Dominik Appl |
12 |
|
|
*/ |
13 |
|
|
public class StarterContainer { |
14 |
|
|
private final Starter starter; |
15 |
|
|
|
16 |
|
|
private boolean isRunning; |
17 |
|
|
|
18 |
|
|
private final String hostInfo; |
19 |
|
|
|
20 |
|
|
/** |
21 |
|
|
* A Container for use in SwingComponents. The status ({@link #isServerRunning()} |
22 |
|
|
* is only the status at the creation of the object! |
23 |
|
|
* |
24 |
|
|
* @param starter |
25 |
|
|
* The encapsulated Starter |
26 |
|
|
* @param hostInfo |
27 |
|
|
*/ |
28 |
|
|
public StarterContainer(Starter starter, String hostInfo) { |
29 |
|
|
this.starter = starter; |
30 |
|
|
this.hostInfo = hostInfo; |
31 |
|
|
try { |
32 |
|
|
isRunning = starter.isRunning(); |
33 |
|
|
} catch (RemoteException e) { |
34 |
|
|
isRunning = false; |
35 |
|
|
} |
36 |
|
|
} |
37 |
|
|
|
38 |
|
|
public boolean isServerRunning() { |
39 |
|
|
return isRunning; |
40 |
|
|
} |
41 |
|
|
|
42 |
|
|
public Starter getStarter() { |
43 |
|
|
return starter; |
44 |
|
|
} |
45 |
|
|
|
46 |
|
|
public String toString() { |
47 |
|
|
return hostInfo; |
48 |
|
|
} |
49 |
|
|
} |