1
2
3
4
5
6
7
8
9
10
11 package de.jaret.util.infoprovider;
12
13 import java.util.ArrayList;
14 import java.util.Iterator;
15 import java.util.List;
16 import java.util.Properties;
17
18
19
20
21
22
23
24 public class JavaSystemInfoProvider implements JaretInfoProvider {
25
26
27
28
29
30
31 public String getInfoProviderName() {
32 return "Java Runtime environment";
33 }
34
35
36
37
38
39
40 public int getAccess() {
41 return SysInfoEntry.ACCESS_PUBLIC;
42 }
43
44
45
46
47
48
49 public List<SysInfoEntry> getSysInfoEntries() {
50 List<SysInfoEntry> entries = new ArrayList<SysInfoEntry>();
51 Properties props = System.getProperties();
52 Iterator it = props.keySet().iterator();
53 while (it.hasNext()) {
54 String key = (String) it.next();
55 String val = props.getProperty(key);
56 entries.add(new SysInfoEntry(key, val));
57 }
58 return entries;
59 }
60
61
62
63
64
65
66 public List<JaretInfoProvider> getSubInfoProviders() {
67 return null;
68 }
69
70
71
72
73
74
75 public void addSubInfoProvider(JaretInfoProvider infoProvider) {
76 throw new RuntimeException("Not implemented");
77 }
78
79 public void remSubInfoProvider(JaretInfoProvider infoProvider) {
80 }
81
82 }