//Generated by the IDL-to-C#-compiler MiddCorIdl //Source: C:/project/MC/MinCorNet/DemoJava/Collections/IDL/Collections.idl //Dienstag, 22. März 2005, 19:09:15 using System; using System.Collections; using Middsol; //Types namespace Collections { namespace GreetingsPackage { } namespace CompanyAddrPackage { } namespace CompanyAddrPackage { } namespace HomeAddrPackage { } namespace HomeAddrPackage { } } //Interfaces and Value Factories namespace Collections { public interface Greetings : GreetingsOperations, Middsol.CORBA.Object, Middsol.CORBA.portable.IDLEntity { } public interface CompanyAddrValueFactory : Middsol.CORBA.portable.ValueFactory { CompanyAddr create( string a_arg0, string a_arg1, string a_arg2 ); } public interface HomeAddrValueFactory : Middsol.CORBA.portable.ValueFactory { HomeAddr create( string a_arg0, string a_arg1, string a_arg2, string a_arg3 ); } } //Interface Operations and Value Types namespace Collections { public interface GreetingsOperations { System.Collections.Hashtable queryAddresses( ); System.Collections.ArrayList queryCustomers( ); void newAddressList( System.Collections.Hashtable a_arg0 ); } public abstract class CompanyAddr : Middsol.CORBA.portable.StreamableValue { protected string City; protected string Name; protected string Zip; abstract public string theName( ); abstract public string theZipCode( ); abstract public string theCity( ); virtual public void _write( Middsol.CORBA.portable.OutputStream outpStream ) { Middsol.CORBA.WStringValueHelper.write( outpStream, this.City); Middsol.CORBA.WStringValueHelper.write( outpStream, this.Name); Middsol.CORBA.WStringValueHelper.write( outpStream, this.Zip); } virtual public void _read( Middsol.CORBA.portable.InputStream inpStream ) { this.City = Middsol.CORBA.WStringValueHelper.read( inpStream ); this.Name = Middsol.CORBA.WStringValueHelper.read( inpStream ); this.Zip = Middsol.CORBA.WStringValueHelper.read( inpStream ); } private static string[] __truncatable_ids = {CompanyAddrHelper.id()}; virtual public string[] _truncatable_ids() { return __truncatable_ids; } virtual public Middsol.CORBA.TypeCode _type() { return CompanyAddrHelper.type(); } } public abstract class HomeAddr : Middsol.CORBA.portable.StreamableValue { protected bool Male; protected string City; protected string FirstName; protected string LastName; protected string Zip; abstract public string theZipCode( ); abstract public string theCity( ); abstract public string theFirstName( ); abstract public string theLastName( ); virtual public void _write( Middsol.CORBA.portable.OutputStream outpStream ) { outpStream.write_boolean( this.Male ); Middsol.CORBA.WStringValueHelper.write( outpStream, this.City); Middsol.CORBA.WStringValueHelper.write( outpStream, this.FirstName); Middsol.CORBA.WStringValueHelper.write( outpStream, this.LastName); Middsol.CORBA.WStringValueHelper.write( outpStream, this.Zip); } virtual public void _read( Middsol.CORBA.portable.InputStream inpStream ) { this.Male = inpStream.read_boolean(); this.City = Middsol.CORBA.WStringValueHelper.read( inpStream ); this.FirstName = Middsol.CORBA.WStringValueHelper.read( inpStream ); this.LastName = Middsol.CORBA.WStringValueHelper.read( inpStream ); this.Zip = Middsol.CORBA.WStringValueHelper.read( inpStream ); } private static string[] __truncatable_ids = {HomeAddrHelper.id()}; virtual public string[] _truncatable_ids() { return __truncatable_ids; } virtual public Middsol.CORBA.TypeCode _type() { return HomeAddrHelper.type(); } } } //Helpers namespace Collections { public class GreetingsHelper { private static string _id = "RMI:Collections.Greetings:0000000000000000"; public static string id() { return _id; } private static Middsol.CORBA.TypeCode _typeCode = null; public static Middsol.CORBA.TypeCode type() { if ( _typeCode==null ) _typeCode = create_type(); return _typeCode; } public static Middsol.CORBA.TypeCode create_type() { Middsol.CORBA.TypeCode typeCode = Middsol.CORBA._ORB.ORB().create_interface_tc( id(), "Greetings" ); return typeCode; } public static void insert( Middsol.CORBA.Any a, Greetings s ) { a.type( type()); write( a.create_output_stream(), s ); } public static Greetings extract( Middsol.CORBA.Any a ) { return read( a.create_input_stream() ); } public static void write( Middsol.CORBA.portable.OutputStream outpStream, Greetings s ) { outpStream.write_Object ((Middsol.CORBA.Object) s); } public static Greetings read( Middsol.CORBA.portable.InputStream inpStream ) { return narrow ( inpStream.read_Object() ); } public static Greetings narrow( Middsol.CORBA.Object obj ) { if( obj == null ) { return null; } if ( obj is Greetings ) { return (Greetings) obj; } if( obj._is_a( id() ) ) { _GreetingsStub stub = new _GreetingsStub(); stub._set_delegate(((Middsol.CORBA.portable.ObjectImpl)obj)._get_delegate()); return stub; } throw new Middsol.CORBA.BAD_PARAM("Narrow failed"); } } namespace GreetingsPackage { } namespace CompanyAddrPackage { } public class CompanyAddrHelper { private static string _id = "RMI:Collections.CompanyAddr:F44D96E81B47E53B:C07FC94898B75922"; public static string id() { return _id; } CompanyAddr create(Middsol.CORBA.ORB orb ,string a_arg0 ,string a_arg1 ,string a_arg2 ) { try { CompanyAddrValueFactory factory = (CompanyAddrValueFactory) orb.lookup_value_factory(id()); return factory.create( a_arg0, a_arg1, a_arg2 ); } catch( System.Exception ) { throw new Middsol.CORBA.BAD_PARAM (); } } private static Middsol.CORBA.TypeCode _typeCode = null; private static bool _active = false; public static Middsol.CORBA.TypeCode type() { if ( _typeCode==null ) _typeCode = create_type(); return _typeCode; } public static Middsol.CORBA.TypeCode create_type() { lock( typeof(CompanyAddrHelper) ) { if ( _active ) { return Middsol.CORBA._ORB.ORB().create_recursive_tc( _id ); } _active = true; Middsol.CORBA.TypeCode member_typeCode = null; Middsol.CORBA.ValueMember[] members = new Middsol.CORBA.ValueMember[3]; member_typeCode = Middsol.CORBA.WStringValueHelper.create_type(); members[0] = new Middsol.CORBA.ValueMember( "Middsol.CORBA.WStringValue", Middsol.CORBA.WStringValueHelper.id(), id(), "", member_typeCode, null, Middsol.CORBA.PRIVATE_MEMBER.value); member_typeCode = Middsol.CORBA.WStringValueHelper.create_type(); members[1] = new Middsol.CORBA.ValueMember( "Middsol.CORBA.WStringValue", Middsol.CORBA.WStringValueHelper.id(), id(), "", member_typeCode, null, Middsol.CORBA.PRIVATE_MEMBER.value); member_typeCode = Middsol.CORBA.WStringValueHelper.create_type(); members[2] = new Middsol.CORBA.ValueMember( "Middsol.CORBA.WStringValue", Middsol.CORBA.WStringValueHelper.id(), id(), "", member_typeCode, null, Middsol.CORBA.PRIVATE_MEMBER.value); Middsol.CORBA.TypeCode typeCode = Middsol.CORBA._ORB.ORB().create_value_tc( id(), "CompanyAddr", Middsol.CORBA.VM_NONE.value, null, members ); _active = false; return typeCode; } } public static void insert( Middsol.CORBA.Any a, CompanyAddr s ) { a.type( type()); write( a.create_output_stream(), s ); } public static CompanyAddr extract( Middsol.CORBA.Any a ) { return read( a.create_input_stream() ); } public static void write( Middsol.CORBA.portable.OutputStream outpStream, CompanyAddr s ) { outpStream.write_value ( s, id() ); } public static CompanyAddr read( Middsol.CORBA.portable.InputStream inpStream ) { return (CompanyAddr) inpStream.read_value( id() ); } } namespace HomeAddrPackage { } public class HomeAddrHelper { private static string _id = "RMI:Collections.HomeAddr:FA1284CFA7820DA4:CCB91AAEF3495F10"; public static string id() { return _id; } HomeAddr create(Middsol.CORBA.ORB orb ,string a_arg0 ,string a_arg1 ,string a_arg2 ,string a_arg3 ) { try { HomeAddrValueFactory factory = (HomeAddrValueFactory) orb.lookup_value_factory(id()); return factory.create( a_arg0, a_arg1, a_arg2, a_arg3 ); } catch( System.Exception ) { throw new Middsol.CORBA.BAD_PARAM (); } } private static Middsol.CORBA.TypeCode _typeCode = null; private static bool _active = false; public static Middsol.CORBA.TypeCode type() { if ( _typeCode==null ) _typeCode = create_type(); return _typeCode; } public static Middsol.CORBA.TypeCode create_type() { lock( typeof(HomeAddrHelper) ) { if ( _active ) { return Middsol.CORBA._ORB.ORB().create_recursive_tc( _id ); } _active = true; Middsol.CORBA.TypeCode member_typeCode = null; Middsol.CORBA.ValueMember[] members = new Middsol.CORBA.ValueMember[5]; member_typeCode = Middsol.CORBA._ORB.ORB().get_primitive_tc( Middsol.CORBA.TCKind.tk_boolean ); members[0] = new Middsol.CORBA.ValueMember( "boolean", "", id(), "", member_typeCode, null, Middsol.CORBA.PRIVATE_MEMBER.value); member_typeCode = Middsol.CORBA.WStringValueHelper.create_type(); members[1] = new Middsol.CORBA.ValueMember( "Middsol.CORBA.WStringValue", Middsol.CORBA.WStringValueHelper.id(), id(), "", member_typeCode, null, Middsol.CORBA.PRIVATE_MEMBER.value); member_typeCode = Middsol.CORBA.WStringValueHelper.create_type(); members[2] = new Middsol.CORBA.ValueMember( "Middsol.CORBA.WStringValue", Middsol.CORBA.WStringValueHelper.id(), id(), "", member_typeCode, null, Middsol.CORBA.PRIVATE_MEMBER.value); member_typeCode = Middsol.CORBA.WStringValueHelper.create_type(); members[3] = new Middsol.CORBA.ValueMember( "Middsol.CORBA.WStringValue", Middsol.CORBA.WStringValueHelper.id(), id(), "", member_typeCode, null, Middsol.CORBA.PRIVATE_MEMBER.value); member_typeCode = Middsol.CORBA.WStringValueHelper.create_type(); members[4] = new Middsol.CORBA.ValueMember( "Middsol.CORBA.WStringValue", Middsol.CORBA.WStringValueHelper.id(), id(), "", member_typeCode, null, Middsol.CORBA.PRIVATE_MEMBER.value); Middsol.CORBA.TypeCode typeCode = Middsol.CORBA._ORB.ORB().create_value_tc( id(), "HomeAddr", Middsol.CORBA.VM_NONE.value, null, members ); _active = false; return typeCode; } } public static void insert( Middsol.CORBA.Any a, HomeAddr s ) { a.type( type()); write( a.create_output_stream(), s ); } public static HomeAddr extract( Middsol.CORBA.Any a ) { return read( a.create_input_stream() ); } public static void write( Middsol.CORBA.portable.OutputStream outpStream, HomeAddr s ) { outpStream.write_value ( s, id() ); } public static HomeAddr read( Middsol.CORBA.portable.InputStream inpStream ) { return (HomeAddr) inpStream.read_value( id() ); } } } //Stubs and Value Default Factories namespace Collections { public class _GreetingsStub : Middsol.CORBA.portable.ObjectImpl, Greetings { private string[] ids = {"RMI:Collections.Greetings:0000000000000000"}; public override string[] _ids() { return ids; } public System.Collections.Hashtable queryAddresses( ) { Middsol.CORBA.portable.InputStream ins = null; while( true ) { try { Middsol.CORBA.portable.OutputStream outs = _request( "queryAddresses", true ); ins = _invoke( outs ); System.Collections.Hashtable result = Middsol.java.util.HashtableHelper.read( ins ); return result; } catch( Middsol.CORBA.portable.RemarshalException ) { } catch( Middsol.CORBA.portable.ApplicationException ax ) { String id = ax.getId(); throw new Middsol.CORBA.MARSHAL ( id ); } finally { this._releaseReply( ins ); } } } public System.Collections.ArrayList queryCustomers( ) { Middsol.CORBA.portable.InputStream ins = null; while( true ) { try { Middsol.CORBA.portable.OutputStream outs = _request( "queryCustomers", true ); ins = _invoke( outs ); System.Collections.ArrayList result = Middsol.java.util.ArrayListHelper.read( ins ); return result; } catch( Middsol.CORBA.portable.RemarshalException ) { } catch( Middsol.CORBA.portable.ApplicationException ax ) { String id = ax.getId(); throw new Middsol.CORBA.MARSHAL ( id ); } finally { this._releaseReply( ins ); } } } public void newAddressList( System.Collections.Hashtable a_arg0 ) { Middsol.CORBA.portable.InputStream ins = null; while( true ) { try { Middsol.CORBA.portable.OutputStream outs = _request( "newAddressList", true ); Middsol.java.util.HashtableHelper.write( outs, a_arg0 ); ins = _invoke( outs ); return; } catch( Middsol.CORBA.portable.RemarshalException ) { } catch( Middsol.CORBA.portable.ApplicationException ax ) { String id = ax.getId(); throw new Middsol.CORBA.MARSHAL ( id ); } finally { this._releaseReply( ins ); } } } } public class CompanyAddrDefaultFactory : CompanyAddrValueFactory { public System.Object read_value( Middsol.CORBA.portable.InputStream ins ) { return ins.read_value( new CompanyAddrImpl() ); } public CompanyAddr create( string a_arg0, string a_arg1, string a_arg2 ) { return (CompanyAddr) new CompanyAddrImpl( a_arg0, a_arg1, a_arg2 ); } } public class HomeAddrDefaultFactory : HomeAddrValueFactory { public System.Object read_value( Middsol.CORBA.portable.InputStream ins ) { return ins.read_value( new HomeAddrImpl() ); } public HomeAddr create( string a_arg0, string a_arg1, string a_arg2, string a_arg3 ) { return (HomeAddr) new HomeAddrImpl( a_arg0, a_arg1, a_arg2, a_arg3 ); } } } //POA namespace Collections { public abstract class GreetingsPOA : Middsol.PortableServer.Servant, GreetingsOperations, Middsol.CORBA.portable.InvokeHandler { private string[] ids = {"RMI:Collections.Greetings:0000000000000000"}; public override string[] _all_interfaces(Middsol.PortableServer.POA poa, byte[] objectId) { return ids; } public Greetings _this() { return GreetingsHelper.narrow( base._this_object( ) ); } public Greetings _this( Middsol.CORBA.ORB orb ) { return GreetingsHelper.narrow( base._this_object( orb ) ); } virtual public System.Collections.Hashtable queryAddresses( ){ return (System.Collections.Hashtable)(System.Object) null ;} virtual public System.Collections.ArrayList queryCustomers( ){ return (System.Collections.ArrayList)(System.Object) null ;} virtual public void newAddressList( System.Collections.Hashtable a_arg0 ){ ;} public Middsol.CORBA.portable.OutputStream _invoke( string method, Middsol.CORBA.portable.InputStream ins, Middsol.CORBA.portable.ResponseHandler resh ) { Middsol.CORBA.portable.OutputStream outs = null; switch( method ) { case "queryAddresses": { System.Collections.Hashtable result = this.queryAddresses( ); outs = resh.createReply(); Middsol.java.util.HashtableHelper.write( outs, result ); break; } case "queryCustomers": { System.Collections.ArrayList result = this.queryCustomers( ); outs = resh.createReply(); Middsol.java.util.ArrayListHelper.write( outs, result ); break; } case "newAddressList": { System.Collections.Hashtable a_arg0 = Middsol.java.util.HashtableHelper.read( ins ); this.newAddressList( a_arg0 ); outs = resh.createReply(); break; } default: throw new Middsol.CORBA.BAD_OPERATION(); } return outs; } } } //POATie namespace Collections { public class GreetingsPOATie : GreetingsPOA { public GreetingsPOATie( GreetingsOperations impl ) { this._impl = impl; } public GreetingsPOATie( GreetingsOperations impl, Middsol.PortableServer.POA poa ) { this._impl = impl; this._poa_tie = poa; } public GreetingsOperations _delegate { set { this._impl = value; } get { return this._impl; } } override public Middsol.PortableServer.POA _default_POA() { if(_poa_tie != null) { return _poa_tie; } else { return base._default_POA(); } } override public System.Collections.Hashtable queryAddresses( ) { return ((GreetingsOperations)_impl).queryAddresses( ); } override public System.Collections.ArrayList queryCustomers( ) { return ((GreetingsOperations)_impl).queryCustomers( ); } override public void newAddressList( System.Collections.Hashtable a_arg0 ) { ((GreetingsOperations)_impl).newAddressList( a_arg0 ); } private GreetingsOperations _impl = null; private Middsol.PortableServer.POA _poa_tie = null; } }