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
)
18 CORBA::Object_var obj
=
19 info
->resolve_initial_references ("POACurrent");
21 PortableServer::Current_var poa_current
=
22 PortableServer::Current::_narrow (obj
.in ());
24 ACE_ASSERT (!CORBA::is_nil (poa_current
.in ()));
27 CORBA::String_var orb_id
= info
->orb_id ();
29 // Create and register the test's ServerRequestInterceptor
31 PortableInterceptor::ServerRequestInterceptor_ptr tmp
;
32 ACE_NEW_THROW_EX (tmp
,
33 ServerRequestInterceptor (orb_id
.in (),
36 CORBA::SystemException::_tao_minor_code (
39 CORBA::COMPLETED_NO
));
41 PortableInterceptor::ServerRequestInterceptor_var server_interceptor
= tmp
;
43 info
->add_server_request_interceptor (server_interceptor
.in ());
46 // Create and register the test's IORInterceptor
48 PortableInterceptor::IORInterceptor_ptr ort_test_interceptor
;
49 ACE_NEW_THROW_EX (ort_test_interceptor
,
50 ORT_test_IORInterceptor
,
52 CORBA::SystemException::_tao_minor_code (
55 CORBA::COMPLETED_NO
));
57 PortableInterceptor::IORInterceptor_var ior_interceptor
=
60 info
->add_ior_interceptor (ior_interceptor
.in ());