Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / Collocation_Oneway_Tests / Hello.cpp
blob84b661ef194fb2906be36fc96e887ecfbfafc503
1 #include "Hello.h"
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,
7 ACE_thread_t thrid)
8 : orb_ (CORBA::ORB::_duplicate (orb))
9 , thr_id_ (thrid)
13 void
14 Hello::onewayTest (void)
16 ACE_DEBUG ((LM_DEBUG,
17 "(%P|%t) onewayTest() Upcall in process ..\n"));
18 return;
22 char *
23 Hello::get_string (void)
25 ACE_DEBUG ((LM_DEBUG,
26 "(%P|%t) Upcall in process ..\n"));
28 // Use portable thread IDs
29 ACE_Thread_ID self_ID;
30 ACE_Thread_ID this_ID;
31 this_ID.id(this->thr_id_);
33 if (self_ID == this_ID)
35 if (this->orb_->orb_core ()->optimize_collocation_objects () &&
36 this->orb_->orb_core ()->use_global_collocation ())
38 ACE_ERROR ((LM_ERROR,
39 "(%P|%t) ERROR: A remote call has been made "
40 " exiting ..\n"));
41 ACE_OS::abort ();
43 else if (this->orb_->orb_core ()->optimize_collocation_objects () &&
44 this->orb_->orb_core ()->use_global_collocation () == 0)
46 TAO::ORB_Table * const orb_table =
47 TAO::ORB_Table::instance ();
49 TAO_ORB_Core_Auto_Ptr tmp (orb_table->find ("server_orb"));
50 if (tmp.get () == 0)
52 // We are running on a single ORB and this is an error.
53 ACE_ERROR ((LM_ERROR,
54 "(%P|%t) ERROR: A remote call has been made "
55 " with a single ORB "
56 " exiting ..\n"));
57 ACE_OS::abort ();
62 return CORBA::string_dup ("Hello there!");
65 void
66 Hello::shutdown (void)
68 this->orb_->shutdown (0);