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
,
9 : orb_ (CORBA::ORB::_duplicate (orb
))
15 Hello::get_string (::Test::ThreadId caller_threadid
)
18 "(%P|%t) Upcall in process ..\n"));
20 if (ACE_thread_t_to_integer
< ::Test::ThreadId
> (ACE_Thread::self ()) != caller_threadid
)
22 // this means a remote call was made
24 if (this->orb_
->orb_core ()->optimize_collocation_objects () &&
25 this->orb_
->orb_core ()->use_global_collocation ())
28 "(%P|%t) ERROR: A remote call has been made "
32 else if (this->orb_
->orb_core ()->optimize_collocation_objects () &&
33 this->orb_
->orb_core ()->use_global_collocation () == 0)
35 TAO::ORB_Table
* const orb_table
=
36 TAO::ORB_Table::instance ();
38 TAO_ORB_Core_Auto_Ptr
tmp (orb_table
->find ("server_orb"));
41 // We are running on a single ORB and this is an error.
43 "(%P|%t) ERROR: A remote call has been made "
51 return CORBA::string_dup ("Hello there!");
55 Hello::shutdown (void)
57 // Give the client thread time to return from the collocated
58 // call to this method before shutting down the ORB. We sleep
59 // to avoid BAD_INV_ORDER exceptions on fast dual processor machines.
61 this->orb_
->shutdown (0);