2 #include "ace/Get_Opt.h"
5 #include "FOO_Client_ORBInitializer.h"
7 #include "tao/ORBInitializer_Registry.h"
9 const ACE_TCHAR
*ior
= ACE_TEXT("file://test.ior");
12 parse_args (int argc
, ACE_TCHAR
*argv
[])
14 ACE_Get_Opt
get_opts (argc
, argv
, ACE_TEXT("k:"));
17 while ((c
= get_opts ()) != -1)
21 ior
= get_opts
.opt_arg ();
24 ACE_ERROR_RETURN ((LM_ERROR
,
35 ACE_TMAIN(int argc
, ACE_TCHAR
*argv
[])
39 #if TAO_HAS_INTERCEPTORS == 1
40 PortableInterceptor::ORBInitializer_ptr temp_initializer
=
41 PortableInterceptor::ORBInitializer::_nil ();
43 ACE_NEW_RETURN (temp_initializer
,
44 FOO_Client_ORBInitializer
,
45 -1); // No exceptions yet!
46 PortableInterceptor::ORBInitializer_var orb_initializer
=
49 PortableInterceptor::register_orb_initializer (orb_initializer
.in ());
50 #endif /* TAO_HAS_INTERCEPTORS == 1 */
53 CORBA::ORB_init (argc
, argv
, "client_orb");
55 if (parse_args (argc
, argv
) != 0)
58 CORBA::Object_var obj
=
59 orb
->string_to_object (ior
);
61 FOO::test_var server
=
62 FOO::test::_narrow (obj
.in ());
64 if (CORBA::is_nil (server
.in ()))
66 ACE_ERROR_RETURN ((LM_ERROR
,
67 "Object reference <%s> is nil.\n",
76 catch (const CORBA::Exception
& ex
)
78 ex
._tao_print_exception ("IORInterceptor test (client-side):");