2 * @file RTPOA_Setup.cpp
4 * @author Carlos O'Ryan <coryan@uci.edu>
7 #include "RTPOA_Setup.h"
8 #include "RIR_Narrow.h"
9 #include "RTCORBA_Setup.h"
10 #include "tao/RTCORBA/RTCORBA.h"
12 #include "ace/Log_Msg.h"
14 #if !defined(__ACE_INLINE__)
15 #include "RTPOA_Setup.inl"
16 #endif /* __ACE_INLINE__ */
18 RTPOA_Setup::RTPOA_Setup (CORBA::ORB_ptr orb
,
19 const RTCORBA_Setup
&rtcorba_setup
)
21 RTPortableServer::POA_var root_poa
=
22 RIR_Narrow
<RTPortableServer::POA
>::resolve (orb
,
25 RTCORBA::RTORB_var rtorb
=
26 RIR_Narrow
<RTCORBA::RTORB
>::resolve (orb
,
29 const CORBA::ULong stacksize
= 1024 * 1024; // 1 Mb
30 const RTCORBA::ThreadpoolLanes
&lanes
= rtcorba_setup
.lanes ();
31 const CORBA::Boolean allow_borrowing
= 0;
32 const CORBA::Boolean allow_request_buffering
= 0;
33 const CORBA::ULong max_buffered_requests
= 0; // dummy value
34 const CORBA::ULong max_request_buffer_size
= 0; // dummy value
36 RTCORBA::ThreadpoolId pool_id
=
37 rtorb
->create_threadpool_with_lanes (stacksize
,
40 allow_request_buffering
,
41 max_buffered_requests
,
42 max_request_buffer_size
);
44 // @@ We need an 'auto_ptr for thread pools' here!
45 CORBA::PolicyList
policies (4); policies
.length (4);
47 rtorb
->create_priority_model_policy (RTCORBA::CLIENT_PROPAGATED
,
48 rtcorba_setup
.process_priority ());
51 root_poa
->create_id_assignment_policy (PortableServer::SYSTEM_ID
);
54 root_poa
->create_implicit_activation_policy (PortableServer::IMPLICIT_ACTIVATION
);
60 rtorb
->create_threadpool_policy (pool_id
);
63 PortableServer::POAManager_var poa_manager
=
64 root_poa
->the_POAManager ();
67 root_poa
->create_POA ("RTEC_Perf",
71 for (CORBA::ULong i
= 0; i
!= policies
.length (); ++i
)
73 policies
[i
]->destroy ();