2 #include "tao/ORB_Core.h"
3 #include "tao/ORB_Table.h"
4 #include "tao/ORB_Core_Auto_Ptr.h"
6 Hello::Hello (CORBA::ORB_ptr orb
,
8 : orb_ (CORBA::ORB::_duplicate (orb
))
14 Hello::get_string (void)
17 "(%P|%t) Upcall in process ..\n"));
19 // Use portable thread IDs
20 ACE_Thread_ID self_ID
;
21 ACE_Thread_ID this_ID
;
22 this_ID
.id(this->thr_id_
);
24 if (self_ID
== this_ID
)
26 if (this->orb_
->orb_core ()->optimize_collocation_objects () &&
27 this->orb_
->orb_core ()->use_global_collocation ())
30 "(%P|%t) ERROR: A remote call has been made "
34 else if (this->orb_
->orb_core ()->optimize_collocation_objects () &&
35 this->orb_
->orb_core ()->use_global_collocation () == 0)
37 TAO::ORB_Table
* const orb_table
=
38 TAO::ORB_Table::instance ();
40 TAO_ORB_Core_Auto_Ptr
tmp (orb_table
->find ("server_orb"));
43 // We are running on a single ORB and this is an error.
45 "(%P|%t) ERROR: A remote call has been made "
53 return CORBA::string_dup ("Hello there!");
57 Hello::shutdown (void)
59 // Give the client thread time to return from the collocated
60 // call to this method before shutting down the ORB. We sleep
61 // to avoid BAD_INV_ORDER exceptions on fast dual processor machines.
63 this->orb_
->shutdown (0);