Merge pull request #2222 from jwillemsen/jwi-dllexportwarning
[ACE_TAO.git] / TAO / tests / POA / On_Demand_Act_Direct_Coll / test_i.cpp
blob067f17801654ca18b925a0694beaafcc0d59c7a2
1 #include "test_i.h"
2 #include "ace/OS_NS_unistd.h"
3 #include "ace/OS_NS_string.h"
5 // Constructor
6 test_i::test_i (CORBA::ORB_ptr orb,
7 PortableServer::POA_ptr poa,
8 ACE_thread_t thrid)
9 : orb_ (CORBA::ORB::_duplicate (orb))
10 ,poa_ (PortableServer::POA::_duplicate (poa))
11 ,thr_id_ (thrid)
15 void
16 test_i::method ()
20 char *
21 test_i::get_string ()
23 ACE_DEBUG ((LM_DEBUG,
24 "(%P|%t) Upcall in process ..\n"));
25 // Use portable thread IDs
26 ACE_Thread_ID self_ID;
27 // Thread ID from Server
28 ACE_Thread_ID this_ID;
29 this_ID.id(this->thr_id_);
31 // Servant Thread ID same as Thread ID server, so a remote call,
32 // in case of a collocation the servant runs in calling thread (Client)
33 if (self_ID == this_ID)
35 ACE_ERROR ((LM_ERROR,
36 "(%P|%t) ERROR: A remote call has been made "
37 " exiting ..\n"));
38 ACE_OS::abort ();
40 else
42 ACE_DEBUG ((LM_DEBUG,
43 "(%P|%t) OK: A collocated invocation has been made.\n"));
45 return CORBA::string_dup ("Hello there!");