Revision 1415,
1.0 KB
checked in by wojtekp, 11 years ago
(diff) |
|
-
Property svn:mime-type set to
text/plain
|
Line | |
---|
1 | package schedframe.resources.computing.profiles.energy; |
---|
2 | |
---|
3 | import schedframe.events.Event; |
---|
4 | import schedframe.events.EventReason; |
---|
5 | import schedframe.events.EventType; |
---|
6 | |
---|
7 | |
---|
8 | public class ResourceEvent implements Event{ |
---|
9 | |
---|
10 | protected EventType type; |
---|
11 | protected EventReason reason; |
---|
12 | protected String source; |
---|
13 | protected Object data; |
---|
14 | |
---|
15 | public ResourceEvent(EventType eventType, String source){ |
---|
16 | this.type = eventType; |
---|
17 | this.source = source; |
---|
18 | setReason(EventReason.UNKNOWN); |
---|
19 | } |
---|
20 | |
---|
21 | public ResourceEvent(EventType eventType, Object data, String source){ |
---|
22 | this.type = eventType; |
---|
23 | this.data = data; |
---|
24 | this.source = source; |
---|
25 | setReason(EventReason.UNKNOWN); |
---|
26 | } |
---|
27 | |
---|
28 | public ResourceEventType getType() { |
---|
29 | ResourceEventType resEventType; |
---|
30 | try{ |
---|
31 | resEventType = (ResourceEventType)type; |
---|
32 | } catch(Exception e){ |
---|
33 | resEventType = null; |
---|
34 | } |
---|
35 | return resEventType; |
---|
36 | } |
---|
37 | |
---|
38 | public Object getData() { |
---|
39 | return data; |
---|
40 | } |
---|
41 | |
---|
42 | public String getSource() { |
---|
43 | return source; |
---|
44 | } |
---|
45 | |
---|
46 | public EventReason getReason() { |
---|
47 | return reason; |
---|
48 | } |
---|
49 | |
---|
50 | public void setReason(EventReason reason) { |
---|
51 | this.reason = reason; |
---|
52 | } |
---|
53 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.