Merge pull request #2258 from likema/log-msg-reset-ostream
[ACE_TAO.git] / TAO / orbsvcs / examples / FaultTolerance / RolyPoly / ORB_Initializer.cpp
bloba9fd605960de2f78d73c2ac42b0867fa114cbe87
1 // file : RolyPoly/ORB_Initializer.cpp
2 // author : Boris Kolpackov <boris@dre.vanderbilt.edu>
3 #include <memory>
4 #include "tao/corba.h"
5 #include "tao/PI/ORBInitInfo.h"
6 #include "tao/ORB_Core.h"
8 #include "ORB_Initializer.h"
9 #include "ReplicaController.h"
11 void
12 ORB_Initializer::pre_init (PortableInterceptor::ORBInitInfo_ptr)
16 void
17 ORB_Initializer::post_init (PortableInterceptor::ORBInitInfo_ptr info)
19 // Allocate slot id.
21 state_slot_id (info->allocate_slot_id ());
23 // Register replica controller as server request interceptor.
25 TAO_ORBInitInfo* tao_info = dynamic_cast<TAO_ORBInitInfo*> (info);
27 CORBA::ORB_var orb (tao_info->orb_core ()->orb ());
29 PortableInterceptor::ServerRequestInterceptor_var interceptor;
32 PortableInterceptor::ServerRequestInterceptor *tmp_interceptor = 0;
34 ACE_NEW_THROW_EX (tmp_interceptor,
35 ReplicaController (orb.in ()),
36 CORBA::NO_MEMORY (
37 CORBA::SystemException::_tao_minor_code (
38 TAO::VMCID,
39 ENOMEM),
40 CORBA::COMPLETED_NO));
43 interceptor = tmp_interceptor;
46 info->add_server_request_interceptor (interceptor.in ());