示例#1
0
    /// <summary>
    /// CargoHostInterface.  This is the constructor for this
    /// class. It publishes XI and SNM objects for CargoHost to receive notifications
    ///
    /// Arguments:
    ///
    ///
    ///
    ///     none
    /// Exceptions:
    ///     none
    /// Return:
    ///     none
    /// </summary>
    public CargoHostInterface()
    {
        try
        {
            // register the channel
            m_Channel = new IiopChannel(0); // assign port automatically
            ChannelServices.RegisterChannel(m_Channel, false);

            CorbaInit m_Init = CorbaInit.GetInit();

            string CORBA_NS_Host = (string)ConfigurationManager.AppSettings["host"];
            Int32  CORBA_NS_Port = Int32.Parse(ConfigurationManager.AppSettings["port"]);

            m_NameService = m_Init.GetNameService(CORBA_NS_Host, (int)CORBA_NS_Port);

            xrayInterface = new XI_Impl();
            NameComponent[] ncXI = GetNameComponent(xrayInterface, "xi");
        }
        catch (Exception e)
        {
            MessageBox.Show(e.StackTrace);
            return;
        }

        // Get Logger from CargoHost
        try
        {
            m_CargoHostLogger = (l3.cargo.corba.Logger)m_NameService.resolve(m_ncLogger);
        }
        catch (CargoException e1)
        {
            MessageBox.Show(e1.error_msg);
        }
        catch (omg.org.CORBA.AbstractCORBASystemException a)
        {
            MessageBox.Show(a.Message);
        }
    }
示例#2
0
    /// <summary>
    /// CargoHostInterface.  This is the constructor for this
    /// class. It publishes XI and SNM objects for CargoHost to receive notifications
    ///
    /// Arguments:
    ///
    ///
    ///
    ///     none
    /// Exceptions:
    ///     none
    /// Return:
    ///     none
    /// </summary>
    public CargoHostInterface()
    {
        try
        {
            // register the channel
            m_Channel = new IiopChannel(0); // assign port automatically
            ChannelServices.RegisterChannel(m_Channel, false);

            CorbaInit   m_Init = CorbaInit.GetInit();

            string CORBA_NS_Host = (string)ConfigurationManager.AppSettings["host"];
            Int32 CORBA_NS_Port = Int32.Parse(ConfigurationManager.AppSettings["port"]);

            m_NameService = m_Init.GetNameService(CORBA_NS_Host, (int)CORBA_NS_Port);

            xrayInterface = new XI_Impl();
            NameComponent[] ncXI = GetNameComponent(xrayInterface, "xi");
        }
        catch (Exception e)
        {
            MessageBox.Show(e.StackTrace);
            return;
        }

        // Get Logger from CargoHost
        try
        {
            m_CargoHostLogger = (l3.cargo.corba.Logger)m_NameService.resolve(m_ncLogger);
        }
        catch (CargoException e1)
        {
            MessageBox.Show(e1.error_msg);
        }
        catch ( omg.org.CORBA.AbstractCORBASystemException a)
        {
            MessageBox.Show(a.Message);
        }
    }