1 #include "ServerORBInitializer.h"
2 #include "ServerRequestInterceptor.h"
3 #include "ORT_test_IORInterceptor.h"
5 #include "tao/ORB_Constants.h"
6 #include "tao/PortableServer/PortableServer.h"
9 ServerORBInitializer::pre_init (
10 PortableInterceptor::ORBInitInfo_ptr
/* info */)
15 ServerORBInitializer::post_init (
16 PortableInterceptor::ORBInitInfo_ptr info
)
19 CORBA::Object_var obj
=
20 info
->resolve_initial_references ("POACurrent");
22 PortableServer::Current_var poa_current
=
23 PortableServer::Current::_narrow (obj
.in ());
25 ACE_ASSERT (!CORBA::is_nil (poa_current
.in ()));
28 CORBA::String_var orb_id
= info
->orb_id ();
30 // Create and register the test's ServerRequestInterceptor
32 PortableInterceptor::ServerRequestInterceptor_ptr tmp
;
33 ACE_NEW_THROW_EX (tmp
,
34 ServerRequestInterceptor (orb_id
.in (),
37 CORBA::SystemException::_tao_minor_code (
40 CORBA::COMPLETED_NO
));
42 PortableInterceptor::ServerRequestInterceptor_var server_interceptor
= tmp
;
44 info
->add_server_request_interceptor (server_interceptor
.in ());
47 // Create and register the test's IORInterceptor
49 PortableInterceptor::IORInterceptor_ptr ort_test_interceptor
;
50 ACE_NEW_THROW_EX (ort_test_interceptor
,
51 ORT_test_IORInterceptor
,
53 CORBA::SystemException::_tao_minor_code (
56 CORBA::COMPLETED_NO
));
58 PortableInterceptor::IORInterceptor_var ior_interceptor
=
61 info
->add_ior_interceptor (ior_interceptor
.in ());