//Generated by the IDL-to-C#-compiler MiddCorIdl //Source: C:/project/MC/MinCorNet/DemoJava/Exceptions/IDL/Exceptions.idl //Dienstag, 22. März 2005, 19:09:29 using System; using System.Collections; using Middsol; //Types namespace Exceptions { } namespace Exceptions { public class MyUserEx: Middsol.CORBA.UserException { public Exceptions.MyUserException _value; public MyUserEx() { } public MyUserEx( Exceptions.MyUserException _value ) { this._value = _value; } public MyUserEx( string _reason, Exceptions.MyUserException _value ) { this._value = _value; } } } namespace Exceptions { namespace GreetingsPackage { } namespace MyUserExceptionPackage { } namespace MyUserExceptionPackage { } } //Interfaces and Value Factories namespace Exceptions { } namespace Exceptions { } namespace Exceptions { public interface Greetings : GreetingsOperations, Middsol.CORBA.Object, Middsol.CORBA.portable.IDLEntity { } public interface MyUserExceptionValueFactory : Middsol.CORBA.portable.ValueFactory { MyUserException create( ); MyUserException create__long( int a_arg0 ); } } //Interface Operations and Value Types namespace Exceptions { } namespace Exceptions { } namespace Exceptions { public interface GreetingsOperations { string hello( string a_arg0 ); } public abstract class MyUserException : Middsol.java.lang._Exception,Middsol.CORBA.portable.StreamableValue { public int iId; new virtual public void _write( Middsol.CORBA.portable.OutputStream outpStream ) { base._write( outpStream ); outpStream.write_long( this.iId ); } new virtual public void _read( Middsol.CORBA.portable.InputStream inpStream ) { base._read( inpStream ); this.iId = inpStream.read_long(); } private static string[] __truncatable_ids = {MyUserExceptionHelper.id()}; new virtual public string[] _truncatable_ids() { return __truncatable_ids; } new virtual public Middsol.CORBA.TypeCode _type() { return MyUserExceptionHelper.type(); } } } //Helpers namespace Exceptions { } namespace Exceptions { public class MyUserExHelper { private static string _id = "IDL:Exceptions/MyUserEx:1.0"; public static string id() { return _id; } 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(MyUserExHelper) ) { if ( _active ) { return Middsol.CORBA._ORB.ORB().create_recursive_tc( _id ); } _active = true; Middsol.CORBA.TypeCode member_typeCode = null; Middsol.CORBA.StructMember[] members = new Middsol.CORBA.StructMember[1]; member_typeCode = Exceptions.MyUserExceptionHelper.create_type(); members[0] = new Middsol.CORBA.StructMember( "value", member_typeCode, null ); Middsol.CORBA.TypeCode typeCode = Middsol.CORBA._ORB.ORB().create_exception_tc( id(), "MyUserEx", members ); _active = false; return typeCode; } } public static void insert( Middsol.CORBA.Any a, MyUserEx s ) { a.type( type()); write( a.create_output_stream(), s ); } public static MyUserEx extract( Middsol.CORBA.Any a ) { return read( a.create_input_stream() ); } public static void write( Middsol.CORBA.portable.OutputStream outpStream, MyUserEx s ) { if ( (System.Object)s == null ) { throw new Middsol.CORBA.BAD_PARAM(); } outpStream.write_string( id() ); Exceptions.MyUserExceptionHelper.write( outpStream, s._value); } public static MyUserEx read( Middsol.CORBA.portable.InputStream inpStream ) { inpStream.read_string(); MyUserEx result = new MyUserEx(); result._value = Exceptions.MyUserExceptionHelper.read( inpStream ); return result; } } } namespace Exceptions { public class GreetingsHelper { private static string _id = "RMI:Exceptions.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 MyUserExceptionPackage { } public class MyUserExceptionHelper { private static string _id = "RMI:Exceptions.MyUserException:1F360E927513D6AA:93911B07FB368230"; public static string id() { return _id; } MyUserException create(Middsol.CORBA.ORB orb ) { try { MyUserExceptionValueFactory factory = (MyUserExceptionValueFactory) orb.lookup_value_factory(id()); return factory.create( ); } catch( System.Exception ) { throw new Middsol.CORBA.BAD_PARAM (); } } MyUserException create__long(Middsol.CORBA.ORB orb ,int a_arg0 ) { try { MyUserExceptionValueFactory factory = (MyUserExceptionValueFactory) orb.lookup_value_factory(id()); return factory.create__long( a_arg0 ); } 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(MyUserExceptionHelper) ) { 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[1]; member_typeCode = Middsol.CORBA._ORB.ORB().get_primitive_tc( Middsol.CORBA.TCKind.tk_long ); members[0] = new Middsol.CORBA.ValueMember( "long", "", id(), "", member_typeCode, null, Middsol.CORBA.PUBLIC_MEMBER.value); Middsol.CORBA.TypeCode typeCode = Middsol.CORBA._ORB.ORB().create_value_tc( id(), "MyUserException", Middsol.CORBA.VM_NONE.value, Middsol.java.lang._ExceptionHelper.type(), members ); _active = false; return typeCode; } } public static void insert( Middsol.CORBA.Any a, MyUserException s ) { a.type( type()); write( a.create_output_stream(), s ); } public static MyUserException extract( Middsol.CORBA.Any a ) { return read( a.create_input_stream() ); } public static void write( Middsol.CORBA.portable.OutputStream outpStream, MyUserException s ) { outpStream.write_value ( s, id() ); } public static MyUserException read( Middsol.CORBA.portable.InputStream inpStream ) { return (MyUserException) inpStream.read_value( id() ); } } } //Stubs and Value Default Factories namespace Exceptions { } namespace Exceptions { } namespace Exceptions { public class _GreetingsStub : Middsol.CORBA.portable.ObjectImpl, Greetings { private string[] ids = {"RMI:Exceptions.Greetings:0000000000000000"}; public override string[] _ids() { return ids; } public string hello( string a_arg0 ) { Middsol.CORBA.portable.InputStream ins = null; while( true ) { try { Middsol.CORBA.portable.OutputStream outs = _request( "hello", true ); Middsol.CORBA.WStringValueHelper.write( outs, a_arg0 ); ins = _invoke( outs ); string result = Middsol.CORBA.WStringValueHelper.read( ins ); return result; } catch( Middsol.CORBA.portable.RemarshalException ) { } catch( Middsol.CORBA.portable.ApplicationException ax ) { String id = ax.getId(); if ( id == "IDL:Exceptions/MyUserEx:1.0" ) throw MyUserExHelper.read( ax.getInputStream() ); else throw new Middsol.CORBA.MARSHAL ( id ); } finally { this._releaseReply( ins ); } } } } public class MyUserExceptionDefaultFactory : MyUserExceptionValueFactory { public System.Object read_value( Middsol.CORBA.portable.InputStream ins ) { return ins.read_value( new MyUserExceptionImpl() ); } public MyUserException create( ) { return (MyUserException) new MyUserExceptionImpl( ); } public MyUserException create__long( int a_arg0 ) { return (MyUserException) new MyUserExceptionImpl( a_arg0 ); } } } //POA namespace Exceptions { } namespace Exceptions { } namespace Exceptions { public abstract class GreetingsPOA : Middsol.PortableServer.Servant, GreetingsOperations, Middsol.CORBA.portable.InvokeHandler { private string[] ids = {"RMI:Exceptions.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 string hello( string a_arg0 ){ return (string)(System.Object) null ;} 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 "hello": { try { string a_arg0 = Middsol.CORBA.WStringValueHelper.read( ins ); string result = this.hello( a_arg0 ); outs = resh.createReply(); Middsol.CORBA.WStringValueHelper.write( outs, result ); } catch ( MyUserEx ex ) { outs = resh.createExceptionReply (); MyUserExHelper.write( outs, ex ); } break; } default: throw new Middsol.CORBA.BAD_OPERATION(); } return outs; } } } //POATie namespace Exceptions { } namespace Exceptions { } namespace Exceptions { 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 string hello( string a_arg0 ) { return ((GreetingsOperations)_impl).hello( a_arg0 ); } private GreetingsOperations _impl = null; private Middsol.PortableServer.POA _poa_tie = null; } }