3 #include "tao/ORB_Core.h"
5 #include "tao/Transport_Cache_Manager.h"
6 #include "tao/Thread_Lane_Resources.h"
7 #include "ace/OS_NS_unistd.h"
9 #if !defined(__ACE_INLINE__)
11 #endif /* __ACE_INLINE__ */
14 Callback_i::shutdown ()
16 ACE_DEBUG ((LM_DEBUG
, "Performing clean shutdown\n"));
17 this->orb_
->shutdown (false);
21 Callback_i::callback_method (const CORBA::OctetSeq
&)
29 // ****************************************************************
32 Simple_Server_i::test_method (CORBA::Boolean do_callback
)
34 if (do_callback
&& this->caller_
!= 0)
44 Simple_Server_i::ow_test ()
46 int iter
= this->ow_count_
++;
47 ACE_DEBUG ((LM_DEBUG
, "%t: Invoking ow test, iter = %d\n", iter
));
51 Simple_Server_i::callback_object (Callback_ptr callback
)
53 this->caller_
= new Caller (callback
, orb_
.in ());
56 Caller::Caller (Callback_ptr callback
, CORBA::ORB_ptr orb
)
57 : cbobj_ (Callback::_duplicate (callback
))
58 , orb_ (CORBA::ORB::_duplicate (orb
))
62 this->payload_
.length (0); //10000);
63 this->activate (THR_JOINABLE
| THR_NEW_LWP
, 4);
65 ACE_DEBUG ((LM_DEBUG
, "%t returning\n"));
71 this->lock_
.acquire ();
73 this->cond_
.broadcast ();
74 this->lock_
.release ();
80 this->lock_
.acquire ();
81 ACE_DEBUG ((LM_DEBUG
, "%t Getting ready to call\n"));
82 while (!this->going_
) this->cond_
.wait ();
83 this->lock_
.release ();
88 ACE_DEBUG ((LM_DEBUG
, "%t calling, payload len = %d\n",
90 this->cbobj_
->callback_method (this->payload_
);
91 ACE_DEBUG ((LM_DEBUG
, "%t callback returned\n"));
92 ACE_Time_Value
tv (0, 100);
96 catch (const CORBA::Exception
&ex
)
98 ACE_DEBUG ((LM_DEBUG
, "%t caught: %C\n", ex
._name ()));
103 this->orb_
->shutdown (false);
105 catch (const CORBA::Exception
&ex
)
107 ACE_DEBUG ((LM_DEBUG
, "%t orb shutdown raised %C\n", ex
._name ()));
113 Simple_Server_i::shutdown ()
115 this->orb_
->shutdown (false);