//Generated by the IDL-to-C#-compiler MiddCorIdl //Source: C:/project/MC/MinCorNet/Demo/Excep/excep.idl //Sonntag, 16. Januar 2005, 22:47:37 using System; using System.Collections; using Middsol; //Types namespace Excep { namespace IGreetingsPackage { public class ExcpName: Middsol.CORBA.UserException { public string strWhy; public int lErrorCode; public ExcpName() { } public ExcpName( string strWhy, int lErrorCode ) { this.strWhy = strWhy; this.lErrorCode = lErrorCode; } public ExcpName( string _reason, string strWhy, int lErrorCode ) { this.strWhy = strWhy; this.lErrorCode = lErrorCode; } } } } //Interfaces and Value Factories namespace Excep { public interface IGreetings : IGreetingsOperations, Middsol.CORBA.Object, Middsol.CORBA.portable.IDLEntity { } } //Interface Operations and Value Types namespace Excep { public interface IGreetingsOperations { string hello( string a_strName ); } } //Helpers namespace Excep { public class IGreetingsHelper { private static string _id = "IDL:Excep/IGreetings:1.0"; 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(), "IGreetings" ); return typeCode; } public static void insert( Middsol.CORBA.Any a, IGreetings s ) { a.type( type()); write( a.create_output_stream(), s ); } public static IGreetings extract( Middsol.CORBA.Any a ) { return read( a.create_input_stream() ); } public static void write( Middsol.CORBA.portable.OutputStream outpStream, IGreetings s ) { outpStream.write_Object ((Middsol.CORBA.Object) s); } public static IGreetings read( Middsol.CORBA.portable.InputStream inpStream ) { return narrow ( inpStream.read_Object() ); } public static IGreetings narrow( Middsol.CORBA.Object obj ) { if( obj == null ) { return null; } if ( obj is IGreetings ) { return (IGreetings) obj; } if( obj._is_a( id() ) ) { _IGreetingsStub stub = new _IGreetingsStub(); stub._set_delegate(((Middsol.CORBA.portable.ObjectImpl)obj)._get_delegate()); return stub; } throw new Middsol.CORBA.BAD_PARAM("Narrow failed"); } } namespace IGreetingsPackage { public class ExcpNameHelper { private static string _id = "IDL:Excep/IGreetings/ExcpName: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(ExcpNameHelper) ) { 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[2]; member_typeCode = Middsol.CORBA._ORB.ORB().create_string_tc(0); members[0] = new Middsol.CORBA.StructMember( "strWhy", member_typeCode, null ); member_typeCode = Middsol.CORBA._ORB.ORB().get_primitive_tc( Middsol.CORBA.TCKind.tk_long ); members[1] = new Middsol.CORBA.StructMember( "lErrorCode", member_typeCode, null ); Middsol.CORBA.TypeCode typeCode = Middsol.CORBA._ORB.ORB().create_exception_tc( id(), "ExcpName", members ); _active = false; return typeCode; } } public static void insert( Middsol.CORBA.Any a, ExcpName s ) { a.type( type()); write( a.create_output_stream(), s ); } public static ExcpName extract( Middsol.CORBA.Any a ) { return read( a.create_input_stream() ); } public static void write( Middsol.CORBA.portable.OutputStream outpStream, ExcpName s ) { if ( (System.Object)s == null ) { throw new Middsol.CORBA.BAD_PARAM(); } outpStream.write_string( id() ); outpStream.write_string( s.strWhy ); outpStream.write_long( s.lErrorCode ); } public static ExcpName read( Middsol.CORBA.portable.InputStream inpStream ) { inpStream.read_string(); ExcpName result = new ExcpName(); result.strWhy = inpStream.read_string(); result.lErrorCode = inpStream.read_long(); return result; } } } } //Stubs and Value Default Factories namespace Excep { public class _IGreetingsStub : Middsol.CORBA.portable.ObjectImpl, IGreetings { private string[] ids = {"IDL:Excep/IGreetings:1.0"}; public override string[] _ids() { return ids; } public string hello( string a_strName ) { Middsol.CORBA.portable.InputStream ins = null; while( true ) { try { Middsol.CORBA.portable.OutputStream outs = _request( "hello", true ); outs.write_string( a_strName ); ins = _invoke( outs ); string result = ins.read_string(); return result; } catch( Middsol.CORBA.portable.RemarshalException ) { } catch( Middsol.CORBA.portable.ApplicationException ax ) { String id = ax.getId(); if ( id == "IDL:Excep/IGreetings/ExcpName:1.0" ) throw IGreetingsPackage.ExcpNameHelper.read( ax.getInputStream() ); else throw new Middsol.CORBA.MARSHAL ( id ); } finally { this._releaseReply( ins ); } } } } } //POA namespace Excep { public abstract class IGreetingsPOA : Middsol.PortableServer.Servant, IGreetingsOperations, Middsol.CORBA.portable.InvokeHandler { private string[] ids = {"IDL:Excep/IGreetings:1.0"}; public override string[] _all_interfaces(Middsol.PortableServer.POA poa, byte[] objectId) { return ids; } public IGreetings _this() { return IGreetingsHelper.narrow( base._this_object( ) ); } public IGreetings _this( Middsol.CORBA.ORB orb ) { return IGreetingsHelper.narrow( base._this_object( orb ) ); } virtual public string hello( string a_strName ){ 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_strName = ins.read_string(); string result = this.hello( a_strName ); outs = resh.createReply(); outs.write_string( result ); } catch ( IGreetingsPackage.ExcpName ex ) { outs = resh.createExceptionReply (); IGreetingsPackage.ExcpNameHelper.write( outs, ex ); } break; } default: throw new Middsol.CORBA.BAD_OPERATION(); } return outs; } } } //POATie namespace Excep { public class IGreetingsPOATie : IGreetingsPOA { public IGreetingsPOATie( IGreetingsOperations impl ) { this._impl = impl; } public IGreetingsPOATie( IGreetingsOperations impl, Middsol.PortableServer.POA poa ) { this._impl = impl; this._poa_tie = poa; } public IGreetingsOperations _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_strName ) { return ((IGreetingsOperations)_impl).hello( a_strName ); } private IGreetingsOperations _impl = null; private Middsol.PortableServer.POA _poa_tie = null; } }