2 #include "tao/ORB_Core.h"
3 #include "tao/ORB_Table.h"
4 #include "tao/ORB_Core_Auto_Ptr.h"
5 #include "./tao/Collocation_Strategy.h"
7 Hello::Hello (CORBA::ORB_ptr orb
,
9 : orb_ (CORBA::ORB::_duplicate (orb
))
18 "(%P|%t) Upcall in process ..\n"));
20 // Use portable thread IDs
21 ACE_Thread_ID self_ID
;
22 ACE_Thread_ID this_ID
;
23 this_ID
.id(this->thr_id_
);
25 if (self_ID
== this_ID
)
27 if (this->orb_
->orb_core ()->optimize_collocation_objects () &&
28 this->orb_
->orb_core ()->use_global_collocation ())
31 "(%P|%t) ERROR: A remote call has been made "
35 else if (this->orb_
->orb_core ()->optimize_collocation_objects () &&
36 this->orb_
->orb_core ()->use_global_collocation () == 0)
38 TAO::ORB_Table
* const orb_table
=
39 TAO::ORB_Table::instance ();
41 TAO_ORB_Core_Auto_Ptr
tmp (orb_table
->find ("server_orb"));
42 if (tmp
.get () == nullptr)
44 // We are running on a single ORB and this is an error.
46 "(%P|%t) ERROR: A remote call has been made "
54 return CORBA::string_dup ("Hello there!");
60 // Give the client thread time to return from the collocated
61 // call to this method before shutting down the ORB. We sleep
62 // to avoid BAD_INV_ORDER exceptions on fast dual processor machines.
64 this->orb_
->shutdown (false);