1 |
mojays |
2 |
package appl.parallel; |
2 |
|
|
|
3 |
|
|
|
4 |
|
|
/** |
5 |
|
|
* Encapsulates {@link ComputingResource ComputingResources} and their meta |
6 |
|
|
* Information (for fast access) |
7 |
|
|
* |
8 |
|
|
* @author Dominik Appl |
9 |
|
|
*/ |
10 |
|
|
public class ComputingResourceContainer { |
11 |
|
|
|
12 |
|
|
private final ComputingResource resource; |
13 |
|
|
|
14 |
|
|
private final ComputingResourceProperties information; |
15 |
|
|
|
16 |
|
|
private boolean supportsSimpleRemoteExecution = false; |
17 |
|
|
|
18 |
|
|
/** |
19 |
|
|
* @param resource |
20 |
|
|
* @param information |
21 |
|
|
*/ |
22 |
|
|
public ComputingResourceContainer(ComputingResource resource, |
23 |
|
|
ComputingResourceProperties information) { |
24 |
|
|
this.resource = resource; |
25 |
|
|
this.information = information; |
26 |
|
|
} |
27 |
|
|
|
28 |
|
|
/** |
29 |
|
|
* @return the information |
30 |
|
|
*/ |
31 |
|
|
public ComputingResourceProperties getInformation() { |
32 |
|
|
return information; |
33 |
|
|
} |
34 |
|
|
|
35 |
|
|
/** |
36 |
|
|
* @return the resource |
37 |
|
|
*/ |
38 |
|
|
public ComputingResource getResource() { |
39 |
|
|
return resource; |
40 |
|
|
} |
41 |
|
|
|
42 |
|
|
public String toString() { |
43 |
|
|
if (information != null) |
44 |
|
|
return information.getProperty("Name"); |
45 |
|
|
else |
46 |
|
|
return "Unknown Resource(No Information available)"; |
47 |
|
|
} |
48 |
|
|
|
49 |
|
|
public boolean supportsSimpleRemoteExecution() { |
50 |
|
|
return supportsSimpleRemoteExecution; |
51 |
|
|
} |
52 |
|
|
|
53 |
|
|
} |