2 #include "Client_ORBInitializer.h"
4 #if TAO_HAS_INTERCEPTORS == 1
6 #include "Client_Request_Interceptor.h"
7 #include "tao/StringSeqC.h"
8 #include "tao/ORB_Constants.h"
9 #include "ace/OS_NS_string.h"
12 Client_ORBInitializer::pre_init (
13 PortableInterceptor::ORBInitInfo_ptr
)
18 Client_ORBInitializer::post_init (
19 PortableInterceptor::ORBInitInfo_ptr info
)
21 CORBA::String_var orb_id
= info
->orb_id ();
23 CORBA::StringSeq_var args
= info
->arguments ();
25 CORBA::String_var forward_str
;
27 // Extract the last forward reference from the argument list.
28 CORBA::ULong args_len
= args
->length ();
29 for (CORBA::ULong i
= 0; i
< args_len
; ++i
)
30 if (ACE_OS::strcmp ("-s", args
[i
]) == 0
31 && i
< (args_len
- 1))
32 forward_str
= args
[i
+ 1];
34 PortableInterceptor::ClientRequestInterceptor_ptr interceptor
=
35 PortableInterceptor::ClientRequestInterceptor::_nil ();
37 // Install the client request interceptor.
38 ACE_NEW_THROW_EX (interceptor
,
39 Client_Request_Interceptor (orb_id
.in (),
42 CORBA::SystemException::_tao_minor_code (
45 CORBA::COMPLETED_NO
));
47 PortableInterceptor::ClientRequestInterceptor_var
48 client_interceptor
= interceptor
;
50 info
->add_client_request_interceptor (client_interceptor
.in ());
53 #endif /* TAO_HAS_INTERCEPTORS == 1 */