//Generated by the IDL-to-C#-compiler MiddCorIdl //Source: C:/project/MC/MinCorNet/DemoJava/ObjectByValue/IDL/ObjectByValue.idl //Dienstag, 22. März 2005, 19:10:22 using System; using System.Collections; using Middsol; //Types namespace ObjectByValue { namespace GreetingsPackage { } namespace InfoPackage { } namespace InfoPackage { } } //Interfaces and Value Factories namespace ObjectByValue { public interface Greetings : GreetingsOperations, Middsol.CORBA.Object, Middsol.CORBA.portable.IDLEntity { } public interface InfoValueFactory : Middsol.CORBA.portable.ValueFactory { Info create( ); } } //Interface Operations and Value Types namespace ObjectByValue { public interface GreetingsOperations { Info hello( Info a_arg0 ); } public abstract class Info : Middsol.CORBA.portable.StreamableValue { protected string message_; protected string name_; abstract public string name { set; get; } abstract public string message { set; get; } virtual public void _write( Middsol.CORBA.portable.OutputStream outpStream ) { Middsol.CORBA.WStringValueHelper.write( outpStream, this.message_); Middsol.CORBA.WStringValueHelper.write( outpStream, this.name_); } virtual public void _read( Middsol.CORBA.portable.InputStream inpStream ) { this.message_ = Middsol.CORBA.WStringValueHelper.read( inpStream ); this.name_ = Middsol.CORBA.WStringValueHelper.read( inpStream ); } private static string[] __truncatable_ids = {InfoHelper.id()}; virtual public string[] _truncatable_ids() { return __truncatable_ids; } virtual public Middsol.CORBA.TypeCode _type() { return InfoHelper.type(); } } } //Helpers namespace ObjectByValue { public class GreetingsHelper { private static string _id = "RMI:ObjectByValue.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 InfoPackage { } public class InfoHelper { private static string _id = "RMI:ObjectByValue.Info:79B946BB9422CB8F:2C73AFB6ABE269E2"; public static string id() { return _id; } Info create(Middsol.CORBA.ORB orb ) { try { InfoValueFactory factory = (InfoValueFactory) orb.lookup_value_factory(id()); return factory.create( ); } 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(InfoHelper) ) { 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[2]; 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); Middsol.CORBA.TypeCode typeCode = Middsol.CORBA._ORB.ORB().create_value_tc( id(), "Info", Middsol.CORBA.VM_NONE.value, null, members ); _active = false; return typeCode; } } public static void insert( Middsol.CORBA.Any a, Info s ) { a.type( type()); write( a.create_output_stream(), s ); } public static Info extract( Middsol.CORBA.Any a ) { return read( a.create_input_stream() ); } public static void write( Middsol.CORBA.portable.OutputStream outpStream, Info s ) { outpStream.write_value ( s, id() ); } public static Info read( Middsol.CORBA.portable.InputStream inpStream ) { return (Info) inpStream.read_value( id() ); } } } //Stubs and Value Default Factories namespace ObjectByValue { public class _GreetingsStub : Middsol.CORBA.portable.ObjectImpl, Greetings { private string[] ids = {"RMI:ObjectByValue.Greetings:0000000000000000"}; public override string[] _ids() { return ids; } public Info hello( Info a_arg0 ) { Middsol.CORBA.portable.InputStream ins = null; while( true ) { try { Middsol.CORBA.portable.OutputStream outs = _request( "hello", true ); InfoHelper.write( outs, a_arg0 ); ins = _invoke( outs ); Info result = InfoHelper.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 class InfoDefaultFactory : InfoValueFactory { public System.Object read_value( Middsol.CORBA.portable.InputStream ins ) { return ins.read_value( new InfoImpl() ); } public Info create( ) { return (Info) new InfoImpl( ); } } } //POA namespace ObjectByValue { public abstract class GreetingsPOA : Middsol.PortableServer.Servant, GreetingsOperations, Middsol.CORBA.portable.InvokeHandler { private string[] ids = {"RMI:ObjectByValue.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 Info hello( Info a_arg0 ){ return (Info)(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": { Info a_arg0 = InfoHelper.read( ins ); Info result = this.hello( a_arg0 ); outs = resh.createReply(); InfoHelper.write( outs, result ); break; } default: throw new Middsol.CORBA.BAD_OPERATION(); } return outs; } } } //POATie namespace ObjectByValue { 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 Info hello( Info a_arg0 ) { return ((GreetingsOperations)_impl).hello( a_arg0 ); } private GreetingsOperations _impl = null; private Middsol.PortableServer.POA _poa_tie = null; } }