2 #include "tao/ORB_Core.h"
3 #include "tao/ORB_Table.h"
4 #include "tao/ORB_Core_Auto_Ptr.h"
6 HelloAgain::HelloAgain (CORBA::ORB_ptr orb
,
8 : orb_ (CORBA::ORB::_duplicate (orb
))
13 HelloAgain::get_string_again ()
16 "(%P|%t) Upcall get_string_again in process ..\n"));
18 /// Use portable thread IDs
19 ACE_Thread_ID self_ID
;
20 // Thread ID from Server
21 ACE_Thread_ID this_ID
;
22 this_ID
.id(this->thr_id_
);
24 // Servant Thread ID same as Thread ID server, so a remote call,
25 // in case of a collocation the servant runs in calling thread (Client)
26 if (self_ID
== this_ID
)
28 ACE_ERROR ((LM_ERROR
,"(%P|%t) ERROR: A remote call has been made \n"));
32 if (this->orb_
->orb_core ()->optimize_collocation_objects () &&
33 this->orb_
->orb_core ()->use_global_collocation ())
36 "(%P|%t)OK: An expected collocated call has been made \n"));
39 return CORBA::string_dup ("Bye!");
43 HelloAgain::get_string ()
46 "(%P|%t) HelloAgain::get_string Upcall get_string in process ..\n"));
48 // Use portable thread IDs
49 ACE_Thread_ID self_ID
;
50 // Thread ID from Server
51 ACE_Thread_ID this_ID
;
52 this_ID
.id(this->thr_id_
);
54 // Servant Thread ID same as Thread ID server, so a remote call,
55 // in case of a collocation the servant runs in calling thread (Client)
56 if (self_ID
== this_ID
)
58 ACE_ERROR ((LM_ERROR
,"(%P|%t) ERROR: A remote call has been made \n"));
62 if (this->orb_
->orb_core ()->optimize_collocation_objects () &&
63 this->orb_
->orb_core ()->use_global_collocation ())
66 "(%P|%t) OK: An expected collocated call has been made \n"));
69 return CORBA::string_dup ("Hello there!");
72 HelloAgain::shutdown ()
74 // Give the client thread time to return from the collocated
75 // call to this method before shutting down the ORB. We sleep
76 // to avoid BAD_INV_ORDER exceptions on fast dual processor machines.
78 this->orb_
->shutdown (false);