Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Portable_Interceptors / PolicyFactory / Server_ORBInitializer.cpp
blob1205fa138fb7671daa71457bd68348ae62ed429d
1 // -*- C++ -*-
2 #include "Server_ORBInitializer.h"
3 #include "IORInterceptor.h"
4 #include "PolicyFactory.h"
5 #include "testC.h"
7 #include "tao/ORB_Constants.h"
9 #include "ace/OS_NS_string.h"
11 void
12 Server_ORBInitializer::pre_init (
13 PortableInterceptor::ORBInitInfo_ptr /* info */
18 void
19 Server_ORBInitializer::post_init (
20 PortableInterceptor::ORBInitInfo_ptr info)
22 PortableInterceptor::PolicyFactory_ptr p;
23 ACE_NEW_THROW_EX (p,
24 PolicyFactory,
25 CORBA::NO_MEMORY (
26 CORBA::SystemException::_tao_minor_code (
27 TAO::VMCID,
28 ENOMEM),
29 CORBA::COMPLETED_NO));
31 PortableInterceptor::PolicyFactory_var policy_factory (p);
33 info->register_policy_factory (Test::POLICY_TYPE,
34 policy_factory.in ());
36 PortableInterceptor::IORInterceptor_ptr i;
37 ACE_NEW_THROW_EX (i,
38 IORInterceptor,
39 CORBA::NO_MEMORY (
40 CORBA::SystemException::_tao_minor_code (
41 TAO::VMCID,
42 ENOMEM),
43 CORBA::COMPLETED_NO));
45 PortableInterceptor::IORInterceptor_var ior_interceptor (i);
47 info->add_ior_interceptor (ior_interceptor.in ());