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