2 #include "ace/Get_Opt.h"
3 #include "tao/PortableInterceptorC.h"
4 #include "ClientORBInitializer.h"
5 #include "tao/ORBInitializer_Registry.h"
6 #include "orbsvcs/FaultTolerance/FT_ClientService_Activate.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 ();
26 ACE_ERROR_RETURN ((LM_ERROR
,
33 // Indicates successful parsing of the command line
38 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
42 PortableInterceptor::ORBInitializer_ptr temp_orb_initializer
=
43 PortableInterceptor::ORBInitializer::_nil ();
44 PortableInterceptor::ORBInitializer_var orb_initializer
;
46 // Register the ClientRequest_Interceptor ORBInitializer.
47 ACE_NEW_RETURN (temp_orb_initializer
,
51 orb_initializer
= temp_orb_initializer
;
53 PortableInterceptor::register_orb_initializer (orb_initializer
.in ());
55 CORBA::ORB_var orb
= CORBA::ORB_init (argc
, argv
);
57 if (parse_args (argc
, argv
) != 0)
60 CORBA::Object_var tmp
=
61 orb
->string_to_object (ior
);
63 Test::Hello_var hello
=
64 Test::Hello::_narrow(tmp
.in ());
66 if (CORBA::is_nil (hello
.in ()))
68 ACE_ERROR_RETURN ((LM_DEBUG
,
69 "Nil Test::Hello reference <%s>\n",
74 ACE_DEBUG ((LM_DEBUG
, "Client about to make method call that is doomed to failure...\n"));
76 CORBA::String_var the_string
=
79 ACE_ERROR_RETURN ((LM_DEBUG
,
80 "Error - the remote call succeeded which is bloody miraculous given that no server is running !!\n"),
83 catch (const CORBA::Exception
&)
85 if (ClientRequest_Interceptor::success_flag_
)
87 ACE_DEBUG ((LM_DEBUG
, "Success - the server was unreachable and PI receive_exception was invoked.\n"));
92 ACE_ERROR_RETURN ((LM_DEBUG
,
93 "Error: regression failed - interceptor receive_exception interception point was not invoked !!\n"),