1 #include "tao/ORB_Core.h"
2 #include "tao/SystemException.h"
3 #include "tao/PolicyC.h"
4 #include "ace/Get_Opt.h"
6 const ACE_TCHAR
*ior
= ACE_TEXT ("corbaloc:iiop:localhost:12345/MyObjectKey");
9 parse_args (int argc
, ACE_TCHAR
*argv
[])
11 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:"));
14 while ((c
= get_opts ()) != -1)
18 ior
= get_opts
.opt_arg ();
23 ACE_ERROR_RETURN ((LM_ERROR
,
30 // Indicates successful parsing of the command line
35 int ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
39 CORBA::ORB_var orb
= CORBA::ORB_init (argc
, argv
);
41 if (parse_args (argc
, argv
) != 0)
44 CORBA::Object_var obj
= orb
->string_to_object (ior
);
45 CORBA::PolicyList_var policies
;
46 CORBA::Boolean result
= obj
->_validate_connection (policies
.out());
49 ACE_ERROR_RETURN ((LM_ERROR
,
50 " (%P|%t) got true from _validate_connection\n"),
54 catch (const CORBA::TRANSIENT
&)
56 ACE_DEBUG ((LM_DEBUG
, "Caught transient as expected\n"));
58 catch (const CORBA::Exception
& ex
)
60 ex
._tao_print_exception ("Exception caught:");