예제 #1
0
void
Worker::run_test (void)
{
  CORBA::Object_var object =
    this->orb_->string_to_object (ior);

  Simple_Server_var server =
    Simple_Server::_narrow (object.in ());

  if (CORBA::is_nil (server.in ()))
    {
      ACE_ERROR ((LM_ERROR,
                  "Object reference <%s> is nil.\n",
                  ior));
      return;
    }

  CORBA::Boolean r =
    server->test_is_a ("IDL:Foo:1.0");

  if (r != 0)
    ACE_DEBUG ((LM_DEBUG,
                "(%P|%t) unexpected result = %d\n",
                r));
}
예제 #2
0
파일: client.cpp 프로젝트: OspreyHub/ATCD
int
Worker::svc (void)
{
  try
    {
      CORBA::Object_var object =
        this->orb_->string_to_object (ior);

      Simple_Server_var server =
        Simple_Server::_narrow (object.in ());

      if (CORBA::is_nil (server.in ()))
        {
          ACE_ERROR ((LM_ERROR,
                      "Object reference <%s> is nil.\n",
                      ior));
          return 0;
        }

      try {
        CORBA::Boolean r =
          server->test_is_a ("IDL:Foo:1.0");

        this->invocation_completed_ = true;

        if (r != 0)
          ACE_DEBUG ((LM_DEBUG,
                      "(%P|%t) unexpected result = %d\n",
                      r));

      }
      catch (const CORBA::OBJECT_NOT_EXIST &)
        {
          ACE_DEBUG ((LM_DEBUG, "(%P|%t)received OBJECT_NOT_EXIST \n"));
          if (!this->done_)
            {
              ++ this->num_received_ex_;
              received_ex_kind_ |= TAO::FOE_OBJECT_NOT_EXIST;
            }
        }
      catch (const CORBA::COMM_FAILURE &)
        {
          ACE_DEBUG ((LM_DEBUG, "(%P|%t)received COMM_FAILURE \n"));
          if (!this->done_)
            {
              ++ this->num_received_ex_;
              received_ex_kind_ |= TAO::FOE_COMM_FAILURE;
            }
        }
      catch (const CORBA::TRANSIENT &)
        {
          ACE_DEBUG ((LM_DEBUG, "(%P|%t)received TRANSIENT \n"));
          if (!this->done_)
            {
              ++ this->num_received_ex_;
              received_ex_kind_ |= TAO::FOE_TRANSIENT;
            }
        }
      catch (const CORBA::INV_OBJREF &)
        {
          ACE_DEBUG ((LM_DEBUG, "(%P|%t)received INV_OBJREF \n"));
          if (!this->done_)
            {
              ++ this->num_received_ex_;
              received_ex_kind_ |= TAO::FOE_INV_OBJREF;
            }
        }
    }
  catch (const CORBA::Exception& ex)
    {
      ex._tao_print_exception ("Unexpected exception caught");
    }

  return 0;
}