001: package org.cougaar.qos.ResourceStatus;
002:
003: /**
004: * org/cougaar/qos/ResourceStatus/_ResourceStatusServiceStub.java .
005: * Generated by the IDL-to-Java compiler (portable), version "3.2"
006: * from qrs.idl
007: * Tuesday, August 7, 2007 11:57:30 AM EDT
008: */
009:
010: // syntactic problem with the argument.
011: public class _ResourceStatusServiceStub extends
012: org.omg.CORBA.portable.ObjectImpl implements
013: org.cougaar.qos.ResourceStatus.ResourceStatusService {
014:
015: // This call is non-blocking by design.
016: public boolean query(
017: org.cougaar.qos.ResourceStatus.ResourceNode[] formula,
018: org.cougaar.qos.ResourceStatus.DataValueHolder result) {
019: org.omg.CORBA.portable.InputStream $in = null;
020: try {
021: org.omg.CORBA.portable.OutputStream $out = _request(
022: "query", true);
023: org.cougaar.qos.ResourceStatus.ResourceDescriptionHelper
024: .write($out, formula);
025: $in = _invoke($out);
026: boolean $result = $in.read_boolean();
027: result.value = org.cougaar.qos.ResourceStatus.DataValueHelper
028: .read($in);
029: return $result;
030: } catch (org.omg.CORBA.portable.ApplicationException $ex) {
031: $in = $ex.getInputStream();
032: String _id = $ex.getId();
033: throw new org.omg.CORBA.MARSHAL(_id);
034: } catch (org.omg.CORBA.portable.RemarshalException $rm) {
035: return query(formula, result);
036: } finally {
037: _releaseReply($in);
038: }
039: } // query
040:
041: public boolean query_s(String formula,
042: org.cougaar.qos.ResourceStatus.DataValueHolder result)
043: throws org.cougaar.qos.ResourceStatus.ResourceDescriptionParseException {
044: org.omg.CORBA.portable.InputStream $in = null;
045: try {
046: org.omg.CORBA.portable.OutputStream $out = _request(
047: "query_s", true);
048: $out.write_string(formula);
049: $in = _invoke($out);
050: boolean $result = $in.read_boolean();
051: result.value = org.cougaar.qos.ResourceStatus.DataValueHelper
052: .read($in);
053: return $result;
054: } catch (org.omg.CORBA.portable.ApplicationException $ex) {
055: $in = $ex.getInputStream();
056: String _id = $ex.getId();
057: if (_id
058: .equals("IDL:org/cougaar/qos/ResourceStatus/ResourceDescriptionParseException:1.0"))
059: throw org.cougaar.qos.ResourceStatus.ResourceDescriptionParseExceptionHelper
060: .read($in);
061: else
062: throw new org.omg.CORBA.MARSHAL(_id);
063: } catch (org.omg.CORBA.portable.RemarshalException $rm) {
064: return query_s(formula, result);
065: } finally {
066: _releaseReply($in);
067: }
068: } // query_s
069:
070: // an exception in the former case.
071: public boolean blockingQuery(
072: org.cougaar.qos.ResourceStatus.ResourceNode[] formula,
073: long timeout,
074: org.cougaar.qos.ResourceStatus.DataValueHolder result) {
075: org.omg.CORBA.portable.InputStream $in = null;
076: try {
077: org.omg.CORBA.portable.OutputStream $out = _request(
078: "blockingQuery", true);
079: org.cougaar.qos.ResourceStatus.ResourceDescriptionHelper
080: .write($out, formula);
081: $out.write_longlong(timeout);
082: $in = _invoke($out);
083: boolean $result = $in.read_boolean();
084: result.value = org.cougaar.qos.ResourceStatus.DataValueHelper
085: .read($in);
086: return $result;
087: } catch (org.omg.CORBA.portable.ApplicationException $ex) {
088: $in = $ex.getInputStream();
089: String _id = $ex.getId();
090: throw new org.omg.CORBA.MARSHAL(_id);
091: } catch (org.omg.CORBA.portable.RemarshalException $rm) {
092: return blockingQuery(formula, timeout, result);
093: } finally {
094: _releaseReply($in);
095: }
096: } // blockingQuery
097:
098: public boolean blockingQuery_s(String formula, long timeout,
099: org.cougaar.qos.ResourceStatus.DataValueHolder result)
100: throws org.cougaar.qos.ResourceStatus.ResourceDescriptionParseException {
101: org.omg.CORBA.portable.InputStream $in = null;
102: try {
103: org.omg.CORBA.portable.OutputStream $out = _request(
104: "blockingQuery_s", true);
105: $out.write_string(formula);
106: $out.write_longlong(timeout);
107: $in = _invoke($out);
108: boolean $result = $in.read_boolean();
109: result.value = org.cougaar.qos.ResourceStatus.DataValueHelper
110: .read($in);
111: return $result;
112: } catch (org.omg.CORBA.portable.ApplicationException $ex) {
113: $in = $ex.getInputStream();
114: String _id = $ex.getId();
115: if (_id
116: .equals("IDL:org/cougaar/qos/ResourceStatus/ResourceDescriptionParseException:1.0"))
117: throw org.cougaar.qos.ResourceStatus.ResourceDescriptionParseExceptionHelper
118: .read($in);
119: else
120: throw new org.omg.CORBA.MARSHAL(_id);
121: } catch (org.omg.CORBA.portable.RemarshalException $rm) {
122: return blockingQuery_s(formula, timeout, result);
123: } finally {
124: _releaseReply($in);
125: }
126: } // blockingQuery_s
127:
128: // one corresponds to a given callback invocation.
129: public boolean unqualifiedSubscribe(
130: org.cougaar.qos.ResourceStatus.RSSSubscriber listener,
131: org.cougaar.qos.ResourceStatus.ResourceNode[] formula,
132: int callback_id) {
133: org.omg.CORBA.portable.InputStream $in = null;
134: try {
135: org.omg.CORBA.portable.OutputStream $out = _request(
136: "unqualifiedSubscribe", true);
137: org.cougaar.qos.ResourceStatus.RSSSubscriberHelper.write(
138: $out, listener);
139: org.cougaar.qos.ResourceStatus.ResourceDescriptionHelper
140: .write($out, formula);
141: $out.write_long(callback_id);
142: $in = _invoke($out);
143: boolean $result = $in.read_boolean();
144: return $result;
145: } catch (org.omg.CORBA.portable.ApplicationException $ex) {
146: $in = $ex.getInputStream();
147: String _id = $ex.getId();
148: throw new org.omg.CORBA.MARSHAL(_id);
149: } catch (org.omg.CORBA.portable.RemarshalException $rm) {
150: return unqualifiedSubscribe(listener, formula, callback_id);
151: } finally {
152: _releaseReply($in);
153: }
154: } // unqualifiedSubscribe
155:
156: public boolean unqualifiedSubscribe_s(
157: org.cougaar.qos.ResourceStatus.RSSSubscriber listener,
158: String formula, int callback_id)
159: throws org.cougaar.qos.ResourceStatus.ResourceDescriptionParseException {
160: org.omg.CORBA.portable.InputStream $in = null;
161: try {
162: org.omg.CORBA.portable.OutputStream $out = _request(
163: "unqualifiedSubscribe_s", true);
164: org.cougaar.qos.ResourceStatus.RSSSubscriberHelper.write(
165: $out, listener);
166: $out.write_string(formula);
167: $out.write_long(callback_id);
168: $in = _invoke($out);
169: boolean $result = $in.read_boolean();
170: return $result;
171: } catch (org.omg.CORBA.portable.ApplicationException $ex) {
172: $in = $ex.getInputStream();
173: String _id = $ex.getId();
174: if (_id
175: .equals("IDL:org/cougaar/qos/ResourceStatus/ResourceDescriptionParseException:1.0"))
176: throw org.cougaar.qos.ResourceStatus.ResourceDescriptionParseExceptionHelper
177: .read($in);
178: else
179: throw new org.omg.CORBA.MARSHAL(_id);
180: } catch (org.omg.CORBA.portable.RemarshalException $rm) {
181: return unqualifiedSubscribe_s(listener, formula,
182: callback_id);
183: } finally {
184: _releaseReply($in);
185: }
186: } // unqualifiedSubscribe_s
187:
188: // qualifier.
189: public boolean qualifiedSubscribe(
190: org.cougaar.qos.ResourceStatus.RSSSubscriber listener,
191: org.cougaar.qos.ResourceStatus.ResourceNode[] formula,
192: int callback_id,
193: org.cougaar.qos.ResourceStatus.Qualifier qualifier_) {
194: org.omg.CORBA.portable.InputStream $in = null;
195: try {
196: org.omg.CORBA.portable.OutputStream $out = _request(
197: "qualifiedSubscribe", true);
198: org.cougaar.qos.ResourceStatus.RSSSubscriberHelper.write(
199: $out, listener);
200: org.cougaar.qos.ResourceStatus.ResourceDescriptionHelper
201: .write($out, formula);
202: $out.write_long(callback_id);
203: org.cougaar.qos.ResourceStatus.QualifierHelper.write($out,
204: qualifier_);
205: $in = _invoke($out);
206: boolean $result = $in.read_boolean();
207: return $result;
208: } catch (org.omg.CORBA.portable.ApplicationException $ex) {
209: $in = $ex.getInputStream();
210: String _id = $ex.getId();
211: throw new org.omg.CORBA.MARSHAL(_id);
212: } catch (org.omg.CORBA.portable.RemarshalException $rm) {
213: return qualifiedSubscribe(listener, formula, callback_id,
214: qualifier_);
215: } finally {
216: _releaseReply($in);
217: }
218: } // qualifiedSubscribe
219:
220: public boolean qualifiedSubscribe_s(
221: org.cougaar.qos.ResourceStatus.RSSSubscriber listener,
222: String formula, int callback_id,
223: org.cougaar.qos.ResourceStatus.Qualifier qualifier_)
224: throws org.cougaar.qos.ResourceStatus.ResourceDescriptionParseException {
225: org.omg.CORBA.portable.InputStream $in = null;
226: try {
227: org.omg.CORBA.portable.OutputStream $out = _request(
228: "qualifiedSubscribe_s", true);
229: org.cougaar.qos.ResourceStatus.RSSSubscriberHelper.write(
230: $out, listener);
231: $out.write_string(formula);
232: $out.write_long(callback_id);
233: org.cougaar.qos.ResourceStatus.QualifierHelper.write($out,
234: qualifier_);
235: $in = _invoke($out);
236: boolean $result = $in.read_boolean();
237: return $result;
238: } catch (org.omg.CORBA.portable.ApplicationException $ex) {
239: $in = $ex.getInputStream();
240: String _id = $ex.getId();
241: if (_id
242: .equals("IDL:org/cougaar/qos/ResourceStatus/ResourceDescriptionParseException:1.0"))
243: throw org.cougaar.qos.ResourceStatus.ResourceDescriptionParseExceptionHelper
244: .read($in);
245: else
246: throw new org.omg.CORBA.MARSHAL(_id);
247: } catch (org.omg.CORBA.portable.RemarshalException $rm) {
248: return qualifiedSubscribe_s(listener, formula, callback_id,
249: qualifier_);
250: } finally {
251: _releaseReply($in);
252: }
253: } // qualifiedSubscribe_s
254:
255: // given listener.
256: public void unsubscribe(
257: org.cougaar.qos.ResourceStatus.RSSSubscriber listener,
258: org.cougaar.qos.ResourceStatus.ResourceNode[] formula) {
259: org.omg.CORBA.portable.InputStream $in = null;
260: try {
261: org.omg.CORBA.portable.OutputStream $out = _request(
262: "unsubscribe", true);
263: org.cougaar.qos.ResourceStatus.RSSSubscriberHelper.write(
264: $out, listener);
265: org.cougaar.qos.ResourceStatus.ResourceDescriptionHelper
266: .write($out, formula);
267: $in = _invoke($out);
268: return;
269: } catch (org.omg.CORBA.portable.ApplicationException $ex) {
270: $in = $ex.getInputStream();
271: String _id = $ex.getId();
272: throw new org.omg.CORBA.MARSHAL(_id);
273: } catch (org.omg.CORBA.portable.RemarshalException $rm) {
274: unsubscribe(listener, formula);
275: } finally {
276: _releaseReply($in);
277: }
278: } // unsubscribe
279:
280: public void unsubscribe_s(
281: org.cougaar.qos.ResourceStatus.RSSSubscriber listener,
282: String formula)
283: throws org.cougaar.qos.ResourceStatus.ResourceDescriptionParseException {
284: org.omg.CORBA.portable.InputStream $in = null;
285: try {
286: org.omg.CORBA.portable.OutputStream $out = _request(
287: "unsubscribe_s", true);
288: org.cougaar.qos.ResourceStatus.RSSSubscriberHelper.write(
289: $out, listener);
290: $out.write_string(formula);
291: $in = _invoke($out);
292: return;
293: } catch (org.omg.CORBA.portable.ApplicationException $ex) {
294: $in = $ex.getInputStream();
295: String _id = $ex.getId();
296: if (_id
297: .equals("IDL:org/cougaar/qos/ResourceStatus/ResourceDescriptionParseException:1.0"))
298: throw org.cougaar.qos.ResourceStatus.ResourceDescriptionParseExceptionHelper
299: .read($in);
300: else
301: throw new org.omg.CORBA.MARSHAL(_id);
302: } catch (org.omg.CORBA.portable.RemarshalException $rm) {
303: unsubscribe_s(listener, formula);
304: } finally {
305: _releaseReply($in);
306: }
307: } // unsubscribe_s
308:
309: // request a Qualifier.
310: public org.cougaar.qos.ResourceStatus.QualifierFactory getQualifierFactory(
311: org.cougaar.qos.ResourceStatus.QualifierKind kind) {
312: org.omg.CORBA.portable.InputStream $in = null;
313: try {
314: org.omg.CORBA.portable.OutputStream $out = _request(
315: "getQualifierFactory", true);
316: org.cougaar.qos.ResourceStatus.QualifierKindHelper.write(
317: $out, kind);
318: $in = _invoke($out);
319: org.cougaar.qos.ResourceStatus.QualifierFactory $result = org.cougaar.qos.ResourceStatus.QualifierFactoryHelper
320: .read($in);
321: return $result;
322: } catch (org.omg.CORBA.portable.ApplicationException $ex) {
323: $in = $ex.getInputStream();
324: String _id = $ex.getId();
325: throw new org.omg.CORBA.MARSHAL(_id);
326: } catch (org.omg.CORBA.portable.RemarshalException $rm) {
327: return getQualifierFactory(kind);
328: } finally {
329: _releaseReply($in);
330: }
331: } // getQualifierFactory
332:
333: // context rather than a formula.
334: public boolean invoke(
335: org.cougaar.qos.ResourceStatus.ResourceNode[] resource_context,
336: String method_name, String[] args)
337: throws org.cougaar.qos.ResourceStatus.NoSuchMethodException {
338: org.omg.CORBA.portable.InputStream $in = null;
339: try {
340: org.omg.CORBA.portable.OutputStream $out = _request(
341: "invoke", true);
342: org.cougaar.qos.ResourceStatus.ResourceDescriptionHelper
343: .write($out, resource_context);
344: $out.write_string(method_name);
345: org.cougaar.qos.ResourceStatus.ParameterListHelper.write(
346: $out, args);
347: $in = _invoke($out);
348: boolean $result = $in.read_boolean();
349: return $result;
350: } catch (org.omg.CORBA.portable.ApplicationException $ex) {
351: $in = $ex.getInputStream();
352: String _id = $ex.getId();
353: if (_id
354: .equals("IDL:org/cougaar/qos/ResourceStatus/NoSuchMethodException:1.0"))
355: throw org.cougaar.qos.ResourceStatus.NoSuchMethodExceptionHelper
356: .read($in);
357: else
358: throw new org.omg.CORBA.MARSHAL(_id);
359: } catch (org.omg.CORBA.portable.RemarshalException $rm) {
360: return invoke(resource_context, method_name, args);
361: } finally {
362: _releaseReply($in);
363: }
364: } // invoke
365:
366: public boolean invoke_s(String resource_context,
367: String method_name, String[] args)
368: throws org.cougaar.qos.ResourceStatus.NoSuchMethodException,
369: org.cougaar.qos.ResourceStatus.ResourceDescriptionParseException {
370: org.omg.CORBA.portable.InputStream $in = null;
371: try {
372: org.omg.CORBA.portable.OutputStream $out = _request(
373: "invoke_s", true);
374: $out.write_string(resource_context);
375: $out.write_string(method_name);
376: org.cougaar.qos.ResourceStatus.ParameterListHelper.write(
377: $out, args);
378: $in = _invoke($out);
379: boolean $result = $in.read_boolean();
380: return $result;
381: } catch (org.omg.CORBA.portable.ApplicationException $ex) {
382: $in = $ex.getInputStream();
383: String _id = $ex.getId();
384: if (_id
385: .equals("IDL:org/cougaar/qos/ResourceStatus/NoSuchMethodException:1.0"))
386: throw org.cougaar.qos.ResourceStatus.NoSuchMethodExceptionHelper
387: .read($in);
388: else if (_id
389: .equals("IDL:org/cougaar/qos/ResourceStatus/ResourceDescriptionParseException:1.0"))
390: throw org.cougaar.qos.ResourceStatus.ResourceDescriptionParseExceptionHelper
391: .read($in);
392: else
393: throw new org.omg.CORBA.MARSHAL(_id);
394: } catch (org.omg.CORBA.portable.RemarshalException $rm) {
395: return invoke_s(resource_context, method_name, args);
396: } finally {
397: _releaseReply($in);
398: }
399: } // invoke_s
400:
401: // raw value.
402: public void pushString(String key, String raw_value) {
403: org.omg.CORBA.portable.InputStream $in = null;
404: try {
405: org.omg.CORBA.portable.OutputStream $out = _request(
406: "pushString", true);
407: $out.write_string(key);
408: $out.write_string(raw_value);
409: $in = _invoke($out);
410: return;
411: } catch (org.omg.CORBA.portable.ApplicationException $ex) {
412: $in = $ex.getInputStream();
413: String _id = $ex.getId();
414: throw new org.omg.CORBA.MARSHAL(_id);
415: } catch (org.omg.CORBA.portable.RemarshalException $rm) {
416: pushString(key, raw_value);
417: } finally {
418: _releaseReply($in);
419: }
420: } // pushString
421:
422: public void pushLong(String key, int raw_value) {
423: org.omg.CORBA.portable.InputStream $in = null;
424: try {
425: org.omg.CORBA.portable.OutputStream $out = _request(
426: "pushLong", true);
427: $out.write_string(key);
428: $out.write_long(raw_value);
429: $in = _invoke($out);
430: return;
431: } catch (org.omg.CORBA.portable.ApplicationException $ex) {
432: $in = $ex.getInputStream();
433: String _id = $ex.getId();
434: throw new org.omg.CORBA.MARSHAL(_id);
435: } catch (org.omg.CORBA.portable.RemarshalException $rm) {
436: pushLong(key, raw_value);
437: } finally {
438: _releaseReply($in);
439: }
440: } // pushLong
441:
442: // soon go away.
443: public void addDependency(
444: org.cougaar.qos.ResourceStatus.ResourceNode resource,
445: org.cougaar.qos.ResourceStatus.ResourceNode[] node_dependencies,
446: org.cougaar.qos.ResourceStatus.ResourceStatusService[] rss_dependencies) {
447: org.omg.CORBA.portable.InputStream $in = null;
448: try {
449: org.omg.CORBA.portable.OutputStream $out = _request(
450: "addDependency", true);
451: org.cougaar.qos.ResourceStatus.ResourceNodeHelper.write(
452: $out, resource);
453: org.cougaar.qos.ResourceStatus.ResourceNodeSeqHelper.write(
454: $out, node_dependencies);
455: org.cougaar.qos.ResourceStatus.RSSSeqHelper.write($out,
456: rss_dependencies);
457: $in = _invoke($out);
458: return;
459: } catch (org.omg.CORBA.portable.ApplicationException $ex) {
460: $in = $ex.getInputStream();
461: String _id = $ex.getId();
462: throw new org.omg.CORBA.MARSHAL(_id);
463: } catch (org.omg.CORBA.portable.RemarshalException $rm) {
464: addDependency(resource, node_dependencies, rss_dependencies);
465: } finally {
466: _releaseReply($in);
467: }
468: } // addDependency
469:
470: // Type-specific CORBA::Object operations
471: private static String[] __ids = { "IDL:org/cougaar/qos/ResourceStatus/ResourceStatusService:1.0" };
472:
473: public String[] _ids() {
474: return (String[]) __ids.clone();
475: }
476:
477: private void readObject(java.io.ObjectInputStream s)
478: throws java.io.IOException {
479: String str = s.readUTF();
480: String[] args = null;
481: java.util.Properties props = null;
482: org.omg.CORBA.Object obj = org.omg.CORBA.ORB.init(args, props)
483: .string_to_object(str);
484: org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl) obj)
485: ._get_delegate();
486: _set_delegate(delegate);
487: }
488:
489: private void writeObject(java.io.ObjectOutputStream s)
490: throws java.io.IOException {
491: String[] args = null;
492: java.util.Properties props = null;
493: String str = org.omg.CORBA.ORB.init(args, props)
494: .object_to_string(this );
495: s.writeUTF(str);
496: }
497: } // class _ResourceStatusServiceStub
|