2 #include "Client_ORBInitializer.h"
4 #if TAO_HAS_INTERCEPTORS == 1
6 #include "Client_Request_Interceptor.h"
8 #include "ace/OS_NS_string.h"
11 Client_ORBInitializer::pre_init (
12 PortableInterceptor::ORBInitInfo_ptr
)
17 Client_ORBInitializer::post_init (
18 PortableInterceptor::ORBInitInfo_ptr info
)
20 CORBA::String_var orb_id
= info
->orb_id ();
22 CORBA::StringSeq_var args
= info
->arguments ();
24 CORBA::String_var forward_str
;
26 // Extract the last forward reference from the argument list.
27 CORBA::ULong args_len
= args
->length ();
28 for (CORBA::ULong i
= 0; i
< args_len
; ++i
)
29 if (ACE_OS::strcmp ("-k", args
[i
]) == 0
30 && i
< (args_len
- 1))
31 forward_str
= args
[i
+ 1];
33 PortableInterceptor::ClientRequestInterceptor_ptr interceptor
=
34 PortableInterceptor::ClientRequestInterceptor::_nil ();
36 // Install the client request interceptor.
37 ACE_NEW_THROW_EX (interceptor
,
38 Client_Request_Interceptor (orb_id
.in (),
41 CORBA::SystemException::_tao_minor_code (
44 CORBA::COMPLETED_NO
));
46 PortableInterceptor::ClientRequestInterceptor_var
47 client_interceptor
= interceptor
;
49 info
->add_client_request_interceptor (client_interceptor
.in ());
52 #endif /* TAO_HAS_INTERCEPTORS == 1 */