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.util.UID;
015:
016: public class CpuIndicator extends Indicator {
017: static {
018: org.cougaar.core.qos.frame.FrameMaker __fm = new org.cougaar.core.qos.frame.FrameMaker() {
019: public DataFrame makeFrame(FrameSet frameSet, UID uid) {
020: return new CpuIndicator(frameSet, uid);
021: }
022: };
023: DataFrame.registerFrameMaker(
024: "org.cougaar.core.qos.frame.topology", "cpuIndicator",
025: __fm);
026: }
027: private double calmThreshold;
028: private double idleThreshold;
029: private String watchSlot;
030: private double normalThreshold;
031: private double franticThreshold;
032: private double busyThreshold;
033:
034: public CpuIndicator(UID uid) {
035: this (null, uid);
036: }
037:
038: public CpuIndicator(FrameSet frameSet, UID uid) {
039: super (frameSet, uid);
040: initializeCalmThreshold(0.2);
041: initializeIdleThreshold(0.0);
042: initializeWatchSlot("cpuLoadAverage");
043: initializeNormalThreshold(0.5);
044: initializeFranticThreshold(2.0);
045: initializeBusyThreshold(1.0);
046: }
047:
048: public String getKind() {
049: return "cpuIndicator";
050: }
051:
052: protected void collectSlotValues(java.util.Properties __props) {
053: super .collectSlotValues(__props);
054: Object __value;
055: __value = getCalmThreshold__AsObject();
056: __props.put("calmThreshold", __value != null ? __value : NIL);
057: __value = getIdleThreshold__AsObject();
058: __props.put("idleThreshold", __value != null ? __value : NIL);
059: __value = getWatchSlot__AsObject();
060: __props.put("watchSlot", __value != null ? __value : NIL);
061: __value = getNormalThreshold__AsObject();
062: __props.put("normalThreshold", __value != null ? __value : NIL);
063: __value = getFranticThreshold__AsObject();
064: __props
065: .put("franticThreshold", __value != null ? __value
066: : NIL);
067: __value = getBusyThreshold__AsObject();
068: __props.put("busyThreshold", __value != null ? __value : NIL);
069: }
070:
071: public double getCalmThreshold() {
072: return calmThreshold;
073: }
074:
075: double getCalmThreshold__NoWarn() {
076: return calmThreshold;
077: }
078:
079: Object getCalmThreshold__AsObject() {
080: return new Double(calmThreshold);
081: }
082:
083: public void setCalmThreshold(double __new_value) {
084: double __old_value = calmThreshold;
085: this .calmThreshold = __new_value;
086: slotModified("calmThreshold", new Double(__old_value),
087: new Double(__new_value), true, true);
088: }
089:
090: public void setCalmThreshold__AsObject(Object __new_value) {
091: Object __old_value = getCalmThreshold__AsObject();
092: this .calmThreshold = force_double(__new_value);
093: slotModified("calmThreshold", __old_value, __new_value, true,
094: true);
095: }
096:
097: protected void initializeCalmThreshold(double new_value) {
098: this .calmThreshold = new_value;
099: slotInitialized("calmThreshold", new Double(new_value));
100: }
101:
102: void initializeCalmThreshold__AsObject(Object new_value) {
103: this .calmThreshold = force_double(new_value);
104: slotInitialized("calmThreshold", new_value);
105: }
106:
107: public double getIdleThreshold() {
108: return idleThreshold;
109: }
110:
111: double getIdleThreshold__NoWarn() {
112: return idleThreshold;
113: }
114:
115: Object getIdleThreshold__AsObject() {
116: return new Double(idleThreshold);
117: }
118:
119: public void setIdleThreshold(double __new_value) {
120: double __old_value = idleThreshold;
121: this .idleThreshold = __new_value;
122: slotModified("idleThreshold", new Double(__old_value),
123: new Double(__new_value), true, true);
124: }
125:
126: public void setIdleThreshold__AsObject(Object __new_value) {
127: Object __old_value = getIdleThreshold__AsObject();
128: this .idleThreshold = force_double(__new_value);
129: slotModified("idleThreshold", __old_value, __new_value, true,
130: true);
131: }
132:
133: protected void initializeIdleThreshold(double new_value) {
134: this .idleThreshold = new_value;
135: slotInitialized("idleThreshold", new Double(new_value));
136: }
137:
138: void initializeIdleThreshold__AsObject(Object new_value) {
139: this .idleThreshold = force_double(new_value);
140: slotInitialized("idleThreshold", new_value);
141: }
142:
143: public String getWatchSlot() {
144: return watchSlot;
145: }
146:
147: String getWatchSlot__NoWarn() {
148: return watchSlot;
149: }
150:
151: Object getWatchSlot__AsObject() {
152: return watchSlot;
153: }
154:
155: public void setWatchSlot(String __new_value) {
156: String __old_value = watchSlot;
157: this .watchSlot = __new_value;
158: slotModified("watchSlot", __old_value, __new_value, true, true);
159: }
160:
161: public void setWatchSlot__AsObject(Object __new_value) {
162: Object __old_value = getWatchSlot__AsObject();
163: this .watchSlot = force_String(__new_value);
164: slotModified("watchSlot", __old_value, __new_value, true, true);
165: }
166:
167: protected void initializeWatchSlot(String new_value) {
168: this .watchSlot = new_value;
169: slotInitialized("watchSlot", new_value);
170: }
171:
172: void initializeWatchSlot__AsObject(Object new_value) {
173: this .watchSlot = force_String(new_value);
174: slotInitialized("watchSlot", new_value);
175: }
176:
177: public double getNormalThreshold() {
178: return normalThreshold;
179: }
180:
181: double getNormalThreshold__NoWarn() {
182: return normalThreshold;
183: }
184:
185: Object getNormalThreshold__AsObject() {
186: return new Double(normalThreshold);
187: }
188:
189: public void setNormalThreshold(double __new_value) {
190: double __old_value = normalThreshold;
191: this .normalThreshold = __new_value;
192: slotModified("normalThreshold", new Double(__old_value),
193: new Double(__new_value), true, true);
194: }
195:
196: public void setNormalThreshold__AsObject(Object __new_value) {
197: Object __old_value = getNormalThreshold__AsObject();
198: this .normalThreshold = force_double(__new_value);
199: slotModified("normalThreshold", __old_value, __new_value, true,
200: true);
201: }
202:
203: protected void initializeNormalThreshold(double new_value) {
204: this .normalThreshold = new_value;
205: slotInitialized("normalThreshold", new Double(new_value));
206: }
207:
208: void initializeNormalThreshold__AsObject(Object new_value) {
209: this .normalThreshold = force_double(new_value);
210: slotInitialized("normalThreshold", new_value);
211: }
212:
213: public double getFranticThreshold() {
214: return franticThreshold;
215: }
216:
217: double getFranticThreshold__NoWarn() {
218: return franticThreshold;
219: }
220:
221: Object getFranticThreshold__AsObject() {
222: return new Double(franticThreshold);
223: }
224:
225: public void setFranticThreshold(double __new_value) {
226: double __old_value = franticThreshold;
227: this .franticThreshold = __new_value;
228: slotModified("franticThreshold", new Double(__old_value),
229: new Double(__new_value), true, true);
230: }
231:
232: public void setFranticThreshold__AsObject(Object __new_value) {
233: Object __old_value = getFranticThreshold__AsObject();
234: this .franticThreshold = force_double(__new_value);
235: slotModified("franticThreshold", __old_value, __new_value,
236: true, true);
237: }
238:
239: protected void initializeFranticThreshold(double new_value) {
240: this .franticThreshold = new_value;
241: slotInitialized("franticThreshold", new Double(new_value));
242: }
243:
244: void initializeFranticThreshold__AsObject(Object new_value) {
245: this .franticThreshold = force_double(new_value);
246: slotInitialized("franticThreshold", new_value);
247: }
248:
249: public double getBusyThreshold() {
250: return busyThreshold;
251: }
252:
253: double getBusyThreshold__NoWarn() {
254: return busyThreshold;
255: }
256:
257: Object getBusyThreshold__AsObject() {
258: return new Double(busyThreshold);
259: }
260:
261: public void setBusyThreshold(double __new_value) {
262: double __old_value = busyThreshold;
263: this .busyThreshold = __new_value;
264: slotModified("busyThreshold", new Double(__old_value),
265: new Double(__new_value), true, true);
266: }
267:
268: public void setBusyThreshold__AsObject(Object __new_value) {
269: Object __old_value = getBusyThreshold__AsObject();
270: this .busyThreshold = force_double(__new_value);
271: slotModified("busyThreshold", __old_value, __new_value, true,
272: true);
273: }
274:
275: protected void initializeBusyThreshold(double new_value) {
276: this .busyThreshold = new_value;
277: slotInitialized("busyThreshold", new Double(new_value));
278: }
279:
280: void initializeBusyThreshold__AsObject(Object new_value) {
281: this .busyThreshold = force_double(new_value);
282: slotInitialized("busyThreshold", new_value);
283: }
284:
285: protected Object getLocalValue(String __slot) {
286: String __key = __slot.intern();
287: if ("calmThreshold" == __key)
288: return getCalmThreshold__AsObject();
289: else if ("idleThreshold" == __key)
290: return getIdleThreshold__AsObject();
291: else if ("watchSlot" == __key)
292: return getWatchSlot__AsObject();
293: else if ("normalThreshold" == __key)
294: return getNormalThreshold__AsObject();
295: else if ("franticThreshold" == __key)
296: return getFranticThreshold__AsObject();
297: else if ("busyThreshold" == __key)
298: return getBusyThreshold__AsObject();
299: else
300: return super .getLocalValue(__slot);
301: }
302:
303: protected void setLocalValue(String __slot, Object __value) {
304: String __key = __slot.intern();
305: if ("calmThreshold" == __key)
306: setCalmThreshold__AsObject(__value);
307: else if ("idleThreshold" == __key)
308: setIdleThreshold__AsObject(__value);
309: else if ("watchSlot" == __key)
310: setWatchSlot__AsObject(__value);
311: else if ("normalThreshold" == __key)
312: setNormalThreshold__AsObject(__value);
313: else if ("franticThreshold" == __key)
314: setFranticThreshold__AsObject(__value);
315: else if ("busyThreshold" == __key)
316: setBusyThreshold__AsObject(__value);
317: else
318: super .setLocalValue(__slot, __value);
319: }
320:
321: protected void initializeLocalValue(String __slot, Object __value) {
322: String __key = __slot.intern();
323: if ("calmThreshold" == __key)
324: initializeCalmThreshold__AsObject(__value);
325: else if ("idleThreshold" == __key)
326: initializeIdleThreshold__AsObject(__value);
327: else if ("watchSlot" == __key)
328: initializeWatchSlot__AsObject(__value);
329: else if ("normalThreshold" == __key)
330: initializeNormalThreshold__AsObject(__value);
331: else if ("franticThreshold" == __key)
332: initializeFranticThreshold__AsObject(__value);
333: else if ("busyThreshold" == __key)
334: initializeBusyThreshold__AsObject(__value);
335: else
336: super .initializeLocalValue(__slot, __value);
337: }
338:
339: protected void collectSlotNames(java.util.Set<String> slots) {
340: super .collectSlotNames(slots);
341: slots.add("calmThreshold");
342: slots.add("idleThreshold");
343: slots.add("watchSlot");
344: slots.add("normalThreshold");
345: slots.add("franticThreshold");
346: slots.add("busyThreshold");
347: }
348:
349: public SlotDescription slotMetaData__CalmThreshold() {
350: SlotDescription __desc = new SlotDescription();
351: __desc.name = "calmThreshold";
352: __desc.prototype = "cpuIndicator";
353: __desc.is_writable = true;
354: Object __value;
355: __value = new Double(calmThreshold);
356: if (__value != null) {
357: __desc.is_overridden = true;
358: __desc.value = __value;
359: } else {
360: __desc.is_overridden = false;
361: __desc.value = new Double(0.2);
362: }
363: return __desc;
364: }
365:
366: public SlotDescription slotMetaData__IdleThreshold() {
367: SlotDescription __desc = new SlotDescription();
368: __desc.name = "idleThreshold";
369: __desc.prototype = "cpuIndicator";
370: __desc.is_writable = true;
371: Object __value;
372: __value = new Double(idleThreshold);
373: if (__value != null) {
374: __desc.is_overridden = true;
375: __desc.value = __value;
376: } else {
377: __desc.is_overridden = false;
378: __desc.value = new Double(0.0);
379: }
380: return __desc;
381: }
382:
383: public SlotDescription slotMetaData__WatchSlot() {
384: SlotDescription __desc = new SlotDescription();
385: __desc.name = "watchSlot";
386: __desc.prototype = "cpuIndicator";
387: __desc.is_writable = true;
388: Object __value;
389: __value = watchSlot;
390: if (__value != null) {
391: __desc.is_overridden = true;
392: __desc.value = __value;
393: } else {
394: __desc.is_overridden = false;
395: __desc.value = "cpuLoadAverage";
396: }
397: return __desc;
398: }
399:
400: public SlotDescription slotMetaData__NormalThreshold() {
401: SlotDescription __desc = new SlotDescription();
402: __desc.name = "normalThreshold";
403: __desc.prototype = "cpuIndicator";
404: __desc.is_writable = true;
405: Object __value;
406: __value = new Double(normalThreshold);
407: if (__value != null) {
408: __desc.is_overridden = true;
409: __desc.value = __value;
410: } else {
411: __desc.is_overridden = false;
412: __desc.value = new Double(0.5);
413: }
414: return __desc;
415: }
416:
417: public SlotDescription slotMetaData__FranticThreshold() {
418: SlotDescription __desc = new SlotDescription();
419: __desc.name = "franticThreshold";
420: __desc.prototype = "cpuIndicator";
421: __desc.is_writable = true;
422: Object __value;
423: __value = new Double(franticThreshold);
424: if (__value != null) {
425: __desc.is_overridden = true;
426: __desc.value = __value;
427: } else {
428: __desc.is_overridden = false;
429: __desc.value = new Double(2.0);
430: }
431: return __desc;
432: }
433:
434: public SlotDescription slotMetaData__BusyThreshold() {
435: SlotDescription __desc = new SlotDescription();
436: __desc.name = "busyThreshold";
437: __desc.prototype = "cpuIndicator";
438: __desc.is_writable = true;
439: Object __value;
440: __value = new Double(busyThreshold);
441: if (__value != null) {
442: __desc.is_overridden = true;
443: __desc.value = __value;
444: } else {
445: __desc.is_overridden = false;
446: __desc.value = new Double(1.0);
447: }
448: return __desc;
449: }
450:
451: protected void collectSlotDescriptions(
452: java.util.Map<String, SlotDescription> map) {
453: super .collectSlotDescriptions(map);
454: map.put("calmThreshold", slotMetaData__CalmThreshold());
455: map.put("idleThreshold", slotMetaData__IdleThreshold());
456: map.put("watchSlot", slotMetaData__WatchSlot());
457: map.put("normalThreshold", slotMetaData__NormalThreshold());
458: map.put("franticThreshold", slotMetaData__FranticThreshold());
459: map.put("busyThreshold", slotMetaData__BusyThreshold());
460: }
461: }
|