Example #1
0
void
IdAssignment::destroy_consumer_admin (
    CosNotifyChannelAdmin::ChannelID channel_id,
    CosNotifyChannelAdmin::AdminID admin_id
  )
{
  CosNotifyChannelAdmin::EventChannel_var ec =
    this->notify_factory_->get_event_channel (channel_id);


  if (CORBA::is_nil (ec.in ()))
    {
      ACE_ERROR((LM_ERROR,
                 " (%P|%t) Unable to find event channel\n"));
      return;
    }

  CosNotifyChannelAdmin::ConsumerAdmin_var consumer_admin =
    ec->get_consumeradmin (admin_id);

  if (CORBA::is_nil (consumer_admin.in()))
    {
      ACE_ERROR ((LM_ERROR,
                  " (%P|%t) Unable to get consumer admin\n"));
    }

  consumer_admin->destroy ();

  if (TAO_debug_level)
    ACE_DEBUG ((LM_DEBUG,
                "destroyed consumer admin\n"));
}
Example #2
0
bool
IdAssignment::default_consumer_admin_test (CosNotifyChannelAdmin::ChannelID channel_id)
{
  CosNotifyChannelAdmin::EventChannel_var ec =
    this->notify_factory_->get_event_channel (channel_id);

  if (CORBA::is_nil (ec.in ()))
    {
      ACE_ERROR((LM_ERROR,
                 " (%P|%t) Unable to find event channel\n"));
      return false;
    }

  CosNotifyChannelAdmin::ConsumerAdmin_var default_consumer_admin =
    ec->get_consumeradmin (0);

  if (CORBA::is_nil (default_consumer_admin.in()))
    {
      ACE_ERROR_RETURN ((LM_ERROR,
                  " (%P|%t) Unable to create default consumer admin\n"),
                  false);
    }

  CosNotifyChannelAdmin::ConsumerAdmin_var def = ec->default_consumer_admin ();
  if (CORBA::is_nil (default_consumer_admin.in()))
    {
      ACE_ERROR_RETURN ((LM_ERROR,
                  " (%P|%t) Unable to get default consumer admin\n"),
                  false);
    }

  if (! default_consumer_admin->_is_equivalent(def.in ()))
    {
      ACE_ERROR_RETURN ((LM_ERROR,
        " (%P|%t) failed for default consumer admin checking\n"),
        false);
    }

  if (TAO_debug_level)
    ACE_DEBUG ((LM_DEBUG,
                "passed default consumer admin test.\n"));

  return true;
}