001: /*
002: * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025: /*
026: * File: ./org/omg/CosNaming/_BindingIteratorImplBase.java
027: * From: nameservice.idl
028: * Date: Tue Aug 11 03:12:09 1998
029: * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18
030: * @deprecated Deprecated in JDK 1.4.
031: */
032:
033: package org.omg.CosNaming;
034:
035: public abstract class _BindingIteratorImplBase extends
036: org.omg.CORBA.DynamicImplementation implements
037: org.omg.CosNaming.BindingIterator {
038: // Constructor
039: public _BindingIteratorImplBase() {
040: super ();
041: }
042:
043: // Type strings for this class and its superclases
044: private static final String _type_ids[] = { "IDL:omg.org/CosNaming/BindingIterator:1.0" };
045:
046: public String[] _ids() {
047: return (String[]) _type_ids.clone();
048: }
049:
050: private static java.util.Dictionary _methods = new java.util.Hashtable();
051: static {
052: _methods.put("next_one", new java.lang.Integer(0));
053: _methods.put("next_n", new java.lang.Integer(1));
054: _methods.put("destroy", new java.lang.Integer(2));
055: }
056:
057: // DSI Dispatch call
058: public void invoke(org.omg.CORBA.ServerRequest r) {
059: switch (((java.lang.Integer) _methods.get(r.op_name()))
060: .intValue()) {
061: case 0: // org.omg.CosNaming.BindingIterator.next_one
062: {
063: org.omg.CORBA.NVList _list = _orb().create_list(0);
064: org.omg.CORBA.Any _b = _orb().create_any();
065: _b.type(org.omg.CosNaming.BindingHelper.type());
066: _list.add_value("b", _b, org.omg.CORBA.ARG_OUT.value);
067: r.params(_list);
068: org.omg.CosNaming.BindingHolder b;
069: b = new org.omg.CosNaming.BindingHolder();
070: boolean ___result;
071: ___result = this .next_one(b);
072: org.omg.CosNaming.BindingHelper.insert(_b, b.value);
073: org.omg.CORBA.Any __result = _orb().create_any();
074: __result.insert_boolean(___result);
075: r.result(__result);
076: }
077: break;
078: case 1: // org.omg.CosNaming.BindingIterator.next_n
079: {
080: org.omg.CORBA.NVList _list = _orb().create_list(0);
081: org.omg.CORBA.Any _how_many = _orb().create_any();
082: _how_many.type(org.omg.CORBA.ORB.init().get_primitive_tc(
083: org.omg.CORBA.TCKind.tk_ulong));
084: _list.add_value("how_many", _how_many,
085: org.omg.CORBA.ARG_IN.value);
086: org.omg.CORBA.Any _bl = _orb().create_any();
087: _bl.type(org.omg.CosNaming.BindingListHelper.type());
088: _list.add_value("bl", _bl, org.omg.CORBA.ARG_OUT.value);
089: r.params(_list);
090: int how_many;
091: how_many = _how_many.extract_ulong();
092: org.omg.CosNaming.BindingListHolder bl;
093: bl = new org.omg.CosNaming.BindingListHolder();
094: boolean ___result;
095: ___result = this .next_n(how_many, bl);
096: org.omg.CosNaming.BindingListHelper.insert(_bl, bl.value);
097: org.omg.CORBA.Any __result = _orb().create_any();
098: __result.insert_boolean(___result);
099: r.result(__result);
100: }
101: break;
102: case 2: // org.omg.CosNaming.BindingIterator.destroy
103: {
104: org.omg.CORBA.NVList _list = _orb().create_list(0);
105: r.params(_list);
106: this .destroy();
107: org.omg.CORBA.Any __return = _orb().create_any();
108: __return.type(_orb().get_primitive_tc(
109: org.omg.CORBA.TCKind.tk_void));
110: r.result(__return);
111: }
112: break;
113: default:
114: throw new org.omg.CORBA.BAD_OPERATION(0,
115: org.omg.CORBA.CompletionStatus.COMPLETED_MAYBE);
116: }
117: }
118: }
|