Ejemplo n.º 1
0
void
TAO_CosNotify_Service::init_i2 (CORBA::ORB_ptr orb, CORBA::ORB_ptr dispatching_orb)
{
  // Obtain the Root POA
  CORBA::Object_var object  =
    orb->resolve_initial_references("RootPOA");

  if (CORBA::is_nil (object.in ()))
    ORBSVCS_ERROR ((LM_ERROR, " (%P|%t) Unable to resolve the RootPOA.\n"));

  PortableServer::POA_var default_poa = PortableServer::POA::_narrow (object.in ());

  // Set the properties
  TAO_Notify_Properties* properties = TAO_Notify_PROPERTIES::instance();

  properties->orb (orb);
  properties->dispatching_orb (dispatching_orb);
  properties->separate_dispatching_orb (true);

  properties->default_poa (default_poa.in ());

  // Init the factory and builder
  this->factory_.reset (this->create_factory ());
  ACE_ASSERT( this->factory_.get() != 0 );
  TAO_Notify_PROPERTIES::instance()->factory (this->factory_.get());

  this->builder_.reset (this->create_builder ());
  ACE_ASSERT( this->builder_.get() != 0 );
  TAO_Notify_PROPERTIES::instance()->builder (this->builder_.get());
}
Ejemplo n.º 2
0
void
TAO_Notify_EventChannelFactory::destroy (void)
{
    if (this->shutdown () == 1)
        return;

    TAO_Notify_Properties* properties = TAO_Notify_PROPERTIES::instance();

    // Reset references to CORBA objects.
    properties->orb (CORBA::ORB::_nil ());
    properties->default_poa (PortableServer::POA::_nil ());

    ec_container_.reset( 0 );
}
Ejemplo n.º 3
0
void
TAO_Notify_FilterAdmin::save_persistent (TAO_Notify::Topology_Saver& saver)
{
  if (this->filter_list_.current_size() == 0)
    return;

  bool changed = true;

  TAO_Notify::NVPList attrs;
  bool want_children = saver.begin_object(0, "filter_admin", attrs, changed);
  if (want_children)
  {
    FILTER_LIST::ITERATOR iter (this->filter_list_);
    FILTER_LIST::ENTRY* entry;

    TAO_Notify_Properties* properties = TAO_Notify_PROPERTIES::instance();
    CORBA::ORB_var orb = properties->orb();
    ACE_ASSERT(! CORBA::is_nil(orb.in()));

    for (; iter.next(entry) != 0; iter.advance())
    {
      TAO_Notify::NVPList fattrs;
      CORBA::Long id = entry->ext_id_;

      //TBD: this presume the filter always collocated.
      //otherwise we need modify the filter interface to add get_filter_id()

      TAO_Notify_FilterFactory* factory = ec_->default_filter_factory_servant ();
      TAO_Notify_Object::ID mapid = factory->get_filter_id (entry->int_id_.in ());

      fattrs.push_back(TAO_Notify::NVP("MapId", mapid));
      saver.begin_object(id, "filter", fattrs, changed);
      saver.end_object(id, "filter");
    }
  }

  saver.end_object(0, "filter_admin");
}