001: /*
002: * Generated by Cougaar QoS FrameGen
003: * from c:\marla\mmon\cougaar\HEAD\qos\src\org\cougaar\core\qos\frame\topology\cougaar-topology-protos.xml
004: * at Mar 14, 2007 4:18:10 PM
005: *
006: * Copyright BBN Technologies 2006
007: *
008: */
009: package org.cougaar.core.qos.frame.topology;
010:
011: import org.cougaar.core.qos.frame.DataFrame;
012: import org.cougaar.core.qos.frame.FrameSet;
013: import org.cougaar.core.qos.frame.SlotDescription;
014: import org.cougaar.core.qos.metrics.Metric;
015: import org.cougaar.core.util.UID;
016:
017: public class Host extends Thing {
018: static {
019: org.cougaar.core.qos.frame.FrameMaker __fm = new org.cougaar.core.qos.frame.FrameMaker() {
020: public DataFrame makeFrame(FrameSet frameSet, UID uid) {
021: return new Host(frameSet, uid);
022: }
023: };
024: DataFrame.registerFrameMaker(
025: "org.cougaar.core.qos.frame.topology", "host", __fm);
026: }
027: private transient Metric loadAverage;
028: private transient Metric jips;
029: private transient Metric effectiveMJips;
030: private String status;
031: private transient Metric count;
032:
033: public Host(UID uid) {
034: this (null, uid);
035: }
036:
037: public Host(FrameSet frameSet, UID uid) {
038: super (frameSet, uid);
039: initializeStatus("unknown");
040: }
041:
042: public String getKind() {
043: return "host";
044: }
045:
046: protected void collectSlotValues(java.util.Properties __props) {
047: super .collectSlotValues(__props);
048: Object __value;
049: __value = getLoadAverage__AsObject();
050: __props.put("loadAverage", __value != null ? __value : NIL);
051: __value = getJips__AsObject();
052: __props.put("jips", __value != null ? __value : NIL);
053: __value = getEffectiveMJips__AsObject();
054: __props.put("effectiveMJips", __value != null ? __value : NIL);
055: __value = getStatus__AsObject();
056: __props.put("status", __value != null ? __value : NIL);
057: __value = getCount__AsObject();
058: __props.put("count", __value != null ? __value : NIL);
059: }
060:
061: public Metric getLoadAverage() {
062: return loadAverage;
063: }
064:
065: Metric getLoadAverage__NoWarn() {
066: return loadAverage;
067: }
068:
069: Object getLoadAverage__AsObject() {
070: return loadAverage;
071: }
072:
073: protected void initializeLoadAverage(Metric new_value) {
074: this .loadAverage = new_value;
075: slotInitialized("loadAverage", new_value);
076: }
077:
078: void initializeLoadAverage__AsObject(Object new_value) {
079: this .loadAverage = force_Metric(new_value);
080: slotInitialized("loadAverage", new_value);
081: }
082:
083: public Metric getJips() {
084: return jips;
085: }
086:
087: Metric getJips__NoWarn() {
088: return jips;
089: }
090:
091: Object getJips__AsObject() {
092: return jips;
093: }
094:
095: protected void initializeJips(Metric new_value) {
096: this .jips = new_value;
097: slotInitialized("jips", new_value);
098: }
099:
100: void initializeJips__AsObject(Object new_value) {
101: this .jips = force_Metric(new_value);
102: slotInitialized("jips", new_value);
103: }
104:
105: public Metric getEffectiveMJips() {
106: return effectiveMJips;
107: }
108:
109: Metric getEffectiveMJips__NoWarn() {
110: return effectiveMJips;
111: }
112:
113: Object getEffectiveMJips__AsObject() {
114: return effectiveMJips;
115: }
116:
117: protected void initializeEffectiveMJips(Metric new_value) {
118: this .effectiveMJips = new_value;
119: slotInitialized("effectiveMJips", new_value);
120: }
121:
122: void initializeEffectiveMJips__AsObject(Object new_value) {
123: this .effectiveMJips = force_Metric(new_value);
124: slotInitialized("effectiveMJips", new_value);
125: }
126:
127: public String getStatus() {
128: return status;
129: }
130:
131: String getStatus__NoWarn() {
132: return status;
133: }
134:
135: Object getStatus__AsObject() {
136: return status;
137: }
138:
139: public void setStatus(String __new_value) {
140: String __old_value = status;
141: this .status = __new_value;
142: slotModified("status", __old_value, __new_value, true, true);
143: }
144:
145: public void setStatus__AsObject(Object __new_value) {
146: Object __old_value = getStatus__AsObject();
147: this .status = force_String(__new_value);
148: slotModified("status", __old_value, __new_value, true, true);
149: }
150:
151: protected void initializeStatus(String new_value) {
152: this .status = new_value;
153: slotInitialized("status", new_value);
154: }
155:
156: void initializeStatus__AsObject(Object new_value) {
157: this .status = force_String(new_value);
158: slotInitialized("status", new_value);
159: }
160:
161: public Metric getCount() {
162: return count;
163: }
164:
165: Metric getCount__NoWarn() {
166: return count;
167: }
168:
169: Object getCount__AsObject() {
170: return count;
171: }
172:
173: protected void initializeCount(Metric new_value) {
174: this .count = new_value;
175: slotInitialized("count", new_value);
176: }
177:
178: void initializeCount__AsObject(Object new_value) {
179: this .count = force_Metric(new_value);
180: slotInitialized("count", new_value);
181: }
182:
183: protected Object getLocalValue(String __slot) {
184: String __key = __slot.intern();
185: if ("loadAverage" == __key)
186: return getLoadAverage__AsObject();
187: else if ("jips" == __key)
188: return getJips__AsObject();
189: else if ("effectiveMJips" == __key)
190: return getEffectiveMJips__AsObject();
191: else if ("status" == __key)
192: return getStatus__AsObject();
193: else if ("count" == __key)
194: return getCount__AsObject();
195: else
196: return super .getLocalValue(__slot);
197: }
198:
199: protected void setLocalValue(String __slot, Object __value) {
200: String __key = __slot.intern();
201: if ("status" == __key)
202: setStatus__AsObject(__value);
203: else
204: super .setLocalValue(__slot, __value);
205: }
206:
207: protected void initializeLocalValue(String __slot, Object __value) {
208: String __key = __slot.intern();
209: if ("loadAverage" == __key)
210: initializeLoadAverage__AsObject(__value);
211: else if ("jips" == __key)
212: initializeJips__AsObject(__value);
213: else if ("effectiveMJips" == __key)
214: initializeEffectiveMJips__AsObject(__value);
215: else if ("status" == __key)
216: initializeStatus__AsObject(__value);
217: else if ("count" == __key)
218: initializeCount__AsObject(__value);
219: else
220: super .initializeLocalValue(__slot, __value);
221: }
222:
223: protected void postInitialize() {
224: super .postInitialize();
225: java.util.Observer __observer;
226: __observer = new java.util.Observer() {
227: public void update(java.util.Observable __xxx, Object __new) {
228: Object __old = loadAverage;
229: loadAverage = (Metric) __new;
230: slotModified("loadAverage", __old, __new, true, true);
231: }
232: };
233: loadAverage = getFrameSet().getMetricValue(this ,
234: "Host($(name)):LoadAverage()");
235: getFrameSet().subscribeToMetric(this , __observer,
236: "Host($(name)):LoadAverage()");
237: __observer = new java.util.Observer() {
238: public void update(java.util.Observable __xxx, Object __new) {
239: Object __old = jips;
240: jips = (Metric) __new;
241: slotModified("jips", __old, __new, true, true);
242: }
243: };
244: jips = getFrameSet().getMetricValue(this ,
245: "Host($(name)):Jips()");
246: getFrameSet().subscribeToMetric(this , __observer,
247: "Host($(name)):Jips()");
248: __observer = new java.util.Observer() {
249: public void update(java.util.Observable __xxx, Object __new) {
250: Object __old = effectiveMJips;
251: effectiveMJips = (Metric) __new;
252: slotModified("effectiveMJips", __old, __new, true, true);
253: }
254: };
255: effectiveMJips = getFrameSet().getMetricValue(this ,
256: "Host($(name)):EffectiveMJips()");
257: getFrameSet().subscribeToMetric(this , __observer,
258: "Host($(name)):EffectiveMJips()");
259: __observer = new java.util.Observer() {
260: public void update(java.util.Observable __xxx, Object __new) {
261: Object __old = count;
262: count = (Metric) __new;
263: slotModified("count", __old, __new, true, true);
264: }
265: };
266: count = getFrameSet().getMetricValue(this ,
267: "Host($(name)):Count()");
268: getFrameSet().subscribeToMetric(this , __observer,
269: "Host($(name)):Count()");
270: }
271:
272: protected void collectSlotNames(java.util.Set<String> slots) {
273: super .collectSlotNames(slots);
274: slots.add("loadAverage");
275: slots.add("jips");
276: slots.add("effectiveMJips");
277: slots.add("status");
278: slots.add("count");
279: }
280:
281: public SlotDescription slotMetaData__LoadAverage() {
282: SlotDescription __desc = new SlotDescription();
283: __desc.name = "loadAverage";
284: __desc.prototype = "host";
285: __desc.is_writable = false;
286: Object __value;
287: __value = loadAverage;
288: if (__value != null) {
289: __desc.is_overridden = true;
290: __desc.value = __value;
291: } else {
292: __desc.is_overridden = false;
293: }
294: return __desc;
295: }
296:
297: public SlotDescription slotMetaData__Jips() {
298: SlotDescription __desc = new SlotDescription();
299: __desc.name = "jips";
300: __desc.prototype = "host";
301: __desc.is_writable = false;
302: Object __value;
303: __value = jips;
304: if (__value != null) {
305: __desc.is_overridden = true;
306: __desc.value = __value;
307: } else {
308: __desc.is_overridden = false;
309: }
310: return __desc;
311: }
312:
313: public SlotDescription slotMetaData__EffectiveMJips() {
314: SlotDescription __desc = new SlotDescription();
315: __desc.name = "effectiveMJips";
316: __desc.prototype = "host";
317: __desc.is_writable = false;
318: Object __value;
319: __value = effectiveMJips;
320: if (__value != null) {
321: __desc.is_overridden = true;
322: __desc.value = __value;
323: } else {
324: __desc.is_overridden = false;
325: }
326: return __desc;
327: }
328:
329: public SlotDescription slotMetaData__Status() {
330: SlotDescription __desc = new SlotDescription();
331: __desc.name = "status";
332: __desc.prototype = "host";
333: __desc.is_writable = true;
334: Object __value;
335: __value = status;
336: if (__value != null) {
337: __desc.is_overridden = true;
338: __desc.value = __value;
339: } else {
340: __desc.is_overridden = false;
341: __desc.value = "unknown";
342: }
343: return __desc;
344: }
345:
346: public SlotDescription slotMetaData__Count() {
347: SlotDescription __desc = new SlotDescription();
348: __desc.name = "count";
349: __desc.prototype = "host";
350: __desc.is_writable = false;
351: Object __value;
352: __value = count;
353: if (__value != null) {
354: __desc.is_overridden = true;
355: __desc.value = __value;
356: } else {
357: __desc.is_overridden = false;
358: }
359: return __desc;
360: }
361:
362: protected void collectSlotDescriptions(
363: java.util.Map<String, SlotDescription> map) {
364: super .collectSlotDescriptions(map);
365: map.put("loadAverage", slotMetaData__LoadAverage());
366: map.put("jips", slotMetaData__Jips());
367: map.put("effectiveMJips", slotMetaData__EffectiveMJips());
368: map.put("status", slotMetaData__Status());
369: map.put("count", slotMetaData__Count());
370: }
371: }
|