Ejemplo n.º 1
0
void
TAO_Notify_Admin::save_persistent (TAO_Notify::Topology_Saver& saver)
{
  bool changed = this->children_changed_;
  this->children_changed_ = false;
  this->self_changed_ = false;

  if (is_persistent ())
    {
      TAO_Notify::NVPList attrs;
      this->save_attrs(attrs);

      const char* type = this->get_admin_type_name();

      bool want_all_children =
        saver.begin_object(this->id(), type, attrs, changed);

      if (want_all_children || this->filter_admin_.is_changed ())
        {
          this->filter_admin_.save_persistent(saver);
        }
      if (want_all_children || this->subscribed_types_.is_changed ())
        {
          this->subscribed_types_.save_persistent(saver);
        }

      TAO_Notify::Save_Persist_Worker<TAO_Notify_Proxy>
        wrk(saver, want_all_children);
      this->proxy_container().collection()->for_each(&wrk);

      saver.end_object(this->id(), type);
    }
}
Ejemplo n.º 2
0
// TAO_Notify::Topology_Object
void
TAO_Notify_EventTypeSeq::save_persistent (TAO_Notify::Topology_Saver& saver)
{
    bool changed = this->self_changed_;
    this->self_changed_ = false;
    this->children_changed_ = false;
    TAO_Notify::NVPList attrs;

    TAO_Notify_EventTypeSeq::ITERATOR iter (*this);
    TAO_Notify_EventType* event_type;

    if (this->size() != 0)
    {
        saver.begin_object(0, "subscriptions", attrs, changed);
        for (iter.first (); iter.next (event_type) != 0; iter.advance ())
        {
            event_type->save_persistent(saver);
        }
// todo:
//    for all deleted children
//    {
//      saver.delete_child(child_type, child_id);
//    }
        saver.end_object(0, "subscriptions");
    }
}
Ejemplo n.º 3
0
void
TAO_Notify_EventChannelFactory::save_persistent (TAO_Notify::Topology_Saver& saver)
{
    bool changed = this->self_changed_;
    this->self_changed_ = false;
    this->children_changed_ = false;

    TAO_Notify::NVPList attrs; // ECF has no attributes

    bool want_all_children =
        saver.begin_object(0, "channel_factory", attrs, changed);

    // for each deleted child
    //  delete_child  // if the child has persistence.

    TAO_Notify::Save_Persist_Worker<TAO_Notify_EventChannel> wrk(saver, want_all_children);

    this->ec_container().collection()->for_each(&wrk);

    if (want_all_children || this->reconnect_registry_.is_changed ())
    {
        this->reconnect_registry_.save_persistent(saver);
    }
    saver.end_object(0, "channel_factory");
}
Ejemplo n.º 4
0
void
TAO_Notify_Proxy::save_persistent (TAO_Notify::Topology_Saver& saver)
{
  bool changed = this->children_changed_;
  this->children_changed_ = false;
  this->self_changed_ = false;

  if (is_persistent ())
  {
    TAO_Notify::NVPList attrs;
    this->save_attrs(attrs);

    const char * type_name = this->get_proxy_type_name ();
    bool want_all_children = saver.begin_object(this->id(), type_name, attrs, changed);

    if (want_all_children || this->filter_admin_.is_changed ())
    {
      this->filter_admin_.save_persistent(saver);
    }

    if (want_all_children || this->subscribed_types_.is_changed ())
    {
      this->subscribed_types_.save_persistent(saver);
    }

    // todo: handle removed children

    saver.end_object(this->id(), type_name);
  }
}
Ejemplo n.º 5
0
TAO_END_VERSIONED_NAMESPACE_DECL


void
TAO_Notify_ETCL_FilterFactory::save_persistent (TAO_Notify::Topology_Saver& saver)
{
  bool changed = true;
  TAO_Notify::NVPList attrs; // ECF has no attributes

  ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mtx_);
  saver.begin_object(0, "filter_factory", attrs, changed);

  if (this->filters_.current_size () > 0)
  {
    int index = 0;
    FILTERMAP::ITERATOR iterator (this->filters_);

    for (FILTERMAP::ENTRY *entry = 0;
      iterator.next (entry) != 0;
      iterator.advance (), ++index)
    {
      entry->int_id_->save_persistent (saver);
    }
  }

  saver.end_object(0, "filter_factory");
}
Ejemplo n.º 6
0
void
TAO_Notify_EventChannel::save_persistent (TAO_Notify::Topology_Saver& saver)
{
  bool changed = this->self_changed_;
  this->self_changed_ = false;
  this->children_changed_ = false;

  if (is_persistent ())
  {
    TAO_Notify::NVPList attrs;
    this->save_attrs(attrs);

    bool want_all_children = saver.begin_object(
      this->id(), "channel", attrs, changed);

    this->default_filter_factory_servant_->save_persistent (saver);

    TAO_Notify::Save_Persist_Worker<TAO_Notify_ConsumerAdmin> ca_wrk(saver, want_all_children);

    this->ca_container().collection()->for_each(&ca_wrk);

    TAO_Notify::Save_Persist_Worker<TAO_Notify_SupplierAdmin> sa_wrk(saver, want_all_children);
    this->sa_container().collection()->for_each(&sa_wrk);

    saver.end_object(this->id(), "channel");
  }
}
Ejemplo n.º 7
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");
}