/** ** ** MinCor-C# -Demo ** CORBA Solution for .Net with C# Language mapping ** Version: 1.0 ** ** Copyright: ** Middsol GmbH, Hamburg ** Germany 2004 ** www.Middsol.com ** info@Middsol.de ** */ using System; using System.Drawing; using System.Collections; using System.Windows.Forms; using System.Data; namespace HelloSrv { public class ServerImpl { private IFrm m_oFrm; private Middsol.CORBA.ORB m_oOrb = null; string[] m_strORBInit = { "-ORBEndpoint iiop://localhost:8545/portspan=100", "-ORBDebug Out=.\\HelloSrv.log"}; public ServerImpl( FrmHelloSrv a_oFrm) { m_oFrm = a_oFrm; m_oOrb = Middsol.CORBA._ORB.init( m_strORBInit, null); Middsol.PortableServer.POA oRootPOA = Middsol.PortableServer.POAHelper.narrow( m_oOrb.resolve_initial_references( "RootPOA" )); oRootPOA.the_POAManager.activate(); Middsol.CORBA.Object oObjRef = oRootPOA.servant_to_reference( new GreetingsImpl( this)); Middsol.CORBA._ORB.wrIORtoFile( ".\\HelloSrv.ior", oObjRef); m_oFrm.writeLog( "Server runing"); } public void destroy() { if( m_oOrb != null) { m_oOrb.destroy(); m_oOrb = null; } } public IFrm theFrm { get{ return m_oFrm; } } } public class GreetingsImpl : Example.GreetingsPOA { private ServerImpl m_oServer; public GreetingsImpl( ServerImpl a_oServer) { m_oServer = a_oServer; } override public string hello( string a_strName ) { m_oServer.theFrm.writeLog("Method executed:"); m_oServer.theFrm.writeLog(" GreetingsImpl:hello"); m_oServer.theFrm.writeLog(" Parameter:" + a_strName); return "Hallo " + a_strName ; } } }