Example #1
0
int
Locator_Repository::remove_activator (const ACE_CString& name)
{
  int err = sync_load ();
  if (err != 0)
    {
      return err;
    }

  int ret = activators().unbind (lcase(name));
  if (ret != 0)
    {
      return ret;
    }

  Locator_Repository::SIMap::ENTRY* sientry = 0;
  Locator_Repository::SIMap::ITERATOR siit (servers ());
  for (; siit.next (sientry); siit.advance() )
  {
    Server_Info *info = sientry->int_id_->active_info ();

    if (info->death_notify && info->activator == name)
      {
        info->death_notify = false;
      }
  }

  return persistent_remove(name, true);
}
Example #2
0
void
persistent_reset (url dir, string key) {
  string v= local_prefix (dir) * key;
  persistent_init_key (dir, key);
  persistent_remove (dir, key, persistent_file [v], persistent_hash [v]);
  persistent_has (v)= false;
  persistent_cache->reset (v);
}
Example #3
0
void
persistent_remove (url dir, string key, url file, unsigned int code) {
  string v= local_prefix (dir) * key;
  if (is_directory (file)) {
    persistent_update_key (dir, key, file, code);
    persistent_remove (dir, key, persistent_file [v], persistent_hash [v]);
  }
  else if (is_regular (file)) {
    hashmap<string,string> map= persistent_read_map (file);
    if (map->contains (key)) {
      map->reset (key);
      persistent_write_map (file, map);
    }
  }
}
Example #4
0
int
Locator_Repository::remove_server (const ACE_CString& name)
{
  int err = sync_load ();
  if (err != 0)
    {
      return err;
    }
  Server_Info_Ptr si;
  this->servers().find (name, si);
  int ret = this->servers().unbind (name);
  if (ret != 0)
    {
      return ret;
    }

  if (!si->alt_info_.null ())
    {
      // name is a peer to another an must be removed from other list
      bool found = false;
      for (CORBA::ULong i = 0; i < si->alt_info_->peers.length(); i++)
        {
          if (!found && si->poa_name == si->alt_info_->peers[i])
            {
              found = true;
              continue;
            }
          if (found)
            {
              si->alt_info_->peers[i-1] = si->alt_info_->peers[i];
            }
        }
      si->alt_info_->peers.length (si->alt_info_->peers.length() - 1);
    }
  else if (si->peers.length () > 0)
    {
      for (CORBA::ULong i = 0; i < si->peers.length(); i++)
        {
          ACE_CString key;
          ACE_CString peer (si->peers[i]);
          Server_Info::gen_key (si->server_id, peer, key);

          this->servers ().unbind (key);
          this->persistent_remove (key, false);
        }
    }
  return persistent_remove (name, false);
}
Example #5
0
void
htsmsg_store_remove(const char *key)
{
  loaded_msg_t *lm;

  hts_mutex_lock(&loaded_msg_mutex);

  LIST_FOREACH(lm, &loaded_msgs, lm_link)
    if(!strcmp(lm->lm_key, key))
      break;

  if(lm != NULL) {
    lm->lm_dirty = 0;
    lm_destroy(lm, 0);
    persistent_store_sync();
  }

  persistent_remove("settings", key);

  hts_mutex_unlock(&loaded_msg_mutex);
}