typename COMP_SVNT::_stub_ptr_type
Home_Servant_Impl<BASE_SKEL,
                  EXEC,
                  COMP_SVNT,
                  CONTAINER>::_ciao_activate_component (
                      typename COMP_SVNT::_exec_type::_ptr_type exe)
{
    CIAO_TRACE ("Home_Servant_Impl<>::_ciao_activate_component");

    typename CONTAINER::_var_type cnt_safe =
        CONTAINER::_duplicate (this->container_.in());

    CORBA::Object_var hobj = cnt_safe->get_objref (this);

    Components::CCMHome_var home =
        Components::CCMHome::_narrow (hobj.in ());

    char buffer[256];
    unsigned long const serial = this->serial_number_++;
    if (ACE_OS::sprintf (buffer, "%ld", serial) < 0)
    {
        throw CORBA::INTERNAL ();
    }

    typedef typename COMP_SVNT::_stub_type stub_type;
    COMP_SVNT *svt = 0;
    ACE_NEW_THROW_EX (svt,
                      COMP_SVNT (exe,
                                 home.in (),
                                 (this->ins_name_ + buffer).c_str (),
                                 this,
                                 cnt_safe),
                      CORBA::NO_MEMORY ());

    PortableServer::ServantBase_var safe (svt);
    PortableServer::ObjectId_var oid;

    CORBA::Object_var objref =
        cnt_safe->install_servant (svt,
                                   Container_Types::COMPONENT_t,
                                   oid.out ());
    typedef typename COMP_SVNT::_stub_type stub_type;
    typename COMP_SVNT::_stub_var_type ho = stub_type::_narrow (objref.in ());

    Components::CCMObject_var ccmobjref =
        Components::CCMObject::_narrow (objref.in ());

    this->objref_map_.bind (
        oid.in (),
        Components::CCMObject::_duplicate (ccmobjref.in ()));
    return ho._retn ();
}
Beispiel #2
0
	Components::CCMObject_var
	create_sender(CIAO::Session_Container_i &a_container, Components::CCMHome_var a_home)
	{
		a_container.init("container");
		a_home = a_container.install_home("RateGen_exec",
												 "create_HUDisplay_RateGenHome_Impl",
												 "RateGen_svnt",
												 "create_HUDisplay_RateGenHome_Servant",
												 "HUDisplay-RateGen-idd",
												 ACE_DEFAULT_SHLIB_MODE);
		assert(a_home.operator->());

		Components::KeylessCCMHome_var keyless_home;
		keyless_home = Components::KeylessCCMHome::_narrow(a_home.in());
		Components::CCMObject_var component = keyless_home->create_component();
		return component;
	}