2 #include "tid_to_int.h"
3 #include "tao/ORB_Core.h"
4 #include "tao/ORB_Table.h"
5 #include "tao/ORB_Core_Auto_Ptr.h"
7 Hello::Hello (CORBA::ORB_ptr orb
)
8 : orb_ (CORBA::ORB::_duplicate (orb
))
13 Hello::get_string (::Test::ThreadId caller_threadid
)
16 "(%P|%t) Upcall in process ..\n"));
18 if (ACE_thread_t_to_integer
< ::Test::ThreadId
> (ACE_Thread::self ()) != caller_threadid
)
20 // this means a remote call was made
22 if (this->orb_
->orb_core ()->optimize_collocation_objects () &&
23 this->orb_
->orb_core ()->use_global_collocation ())
26 "(%P|%t) ERROR: A remote call has been made "
30 else if (this->orb_
->orb_core ()->optimize_collocation_objects () &&
31 this->orb_
->orb_core ()->use_global_collocation () == 0)
33 TAO::ORB_Table
* const orb_table
=
34 TAO::ORB_Table::instance ();
36 TAO_ORB_Core_Auto_Ptr
tmp (orb_table
->find ("server_orb"));
37 if (tmp
.get () == nullptr)
39 // We are running on a single ORB and this is an error.
41 "(%P|%t) ERROR: A remote call has been made "
49 return CORBA::string_dup ("Hello there!");
55 // Give the client thread time to return from the collocated
56 // call to this method before shutting down the ORB. We sleep
57 // to avoid BAD_INV_ORDER exceptions on fast dual processor machines.
59 this->orb_
->shutdown (false);