Merge pull request #2222 from jwillemsen/jwi-dllexportwarning
[ACE_TAO.git] / TAO / tests / ORT / ServerORBInitializer.cpp
blob1ec3e480fecf8b52ed52de33ffd50ec1fb7b3293
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"
8 void
9 ServerORBInitializer::pre_init (
10 PortableInterceptor::ORBInitInfo_ptr /* info */)
14 void
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 (),
34 poa_current.in ()),
35 CORBA::NO_MEMORY (
36 CORBA::SystemException::_tao_minor_code (
37 TAO::VMCID,
38 ENOMEM),
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,
51 CORBA::NO_MEMORY (
52 CORBA::SystemException::_tao_minor_code (
53 TAO::VMCID,
54 ENOMEM),
55 CORBA::COMPLETED_NO));
57 PortableInterceptor::IORInterceptor_var ior_interceptor =
58 ort_test_interceptor;
60 info->add_ior_interceptor (ior_interceptor.in ());