#include <Non_Servant_Upcall.h>
Collaboration diagram for TAO::Portable_Server::Non_Servant_Upcall:

Public Member Functions | |
| Non_Servant_Upcall (::TAO_Root_POA &poa) | |
| Constructor. | |
| ~Non_Servant_Upcall (void) | |
| Destructor. | |
| ::TAO_Root_POA & | poa (void) const |
Protected Attributes | |
| TAO_Object_Adapter & | object_adapter_ |
| TAO_Root_POA & | poa_ |
| Non_Servant_Upcall * | previous_ |
Definition at line 50 of file Non_Servant_Upcall.h.
|
|
Constructor.
Definition at line 21 of file Non_Servant_Upcall.cpp. References ACE_ASSERT, TAO_Object_Adapter::lock(), TAO_Object_Adapter::non_servant_upcall_in_progress_, TAO_Object_Adapter::non_servant_upcall_nesting_level_, TAO_Object_Adapter::non_servant_upcall_thread_, object_adapter_, ACE_Lock::release(), and ACE_OS::thr_self().
00022 : object_adapter_ (poa.object_adapter ()), 00023 poa_ (poa), 00024 previous_ (0) 00025 { 00026 // Check if this is a nested non_servant_upcall. 00027 if (this->object_adapter_.non_servant_upcall_nesting_level_ != 0) 00028 { 00029 // Remember previous instance of non_servant_upcall. 00030 this->previous_ = 00031 this->object_adapter_.non_servant_upcall_in_progress_; 00032 00033 // Assert that the thread is the same as the one before. 00034 ACE_ASSERT (ACE_OS::thr_equal ( 00035 this->object_adapter_.non_servant_upcall_thread_, 00036 ACE_OS::thr_self ())); 00037 } 00038 00039 // Remember which thread is calling the adapter activators. 00040 this->object_adapter_.non_servant_upcall_thread_ = ACE_OS::thr_self (); 00041 00042 // Mark the fact that a non-servant upcall is in progress. 00043 this->object_adapter_.non_servant_upcall_in_progress_ = this; 00044 00045 // Adjust the nesting level. 00046 this->object_adapter_.non_servant_upcall_nesting_level_++; 00047 00048 // We always release 00049 this->object_adapter_.lock ().release (); 00050 } |
|
|
Destructor.
Definition at line 52 of file Non_Servant_Upcall.cpp. References ACE_Lock::acquire(), TAO_Root_POA::complete_destruction_i(), TAO_Object_Adapter::enable_locking_, TAO_Object_Adapter::lock(), TAO_Object_Adapter::non_servant_upcall_condition_, TAO_Object_Adapter::non_servant_upcall_in_progress_, TAO_Object_Adapter::non_servant_upcall_nesting_level_, TAO_Object_Adapter::non_servant_upcall_thread_, object_adapter_, TAO_Root_POA::outstanding_requests(), and TAO_Root_POA::waiting_destruction().
00053 {
00054 // Reacquire the Object Adapter lock.
00055 this->object_adapter_.lock ().acquire ();
00056
00057 // Adjust the nesting level.
00058 this->object_adapter_.non_servant_upcall_nesting_level_--;
00059
00060 // We are done with this nested upcall.
00061 this->object_adapter_.non_servant_upcall_in_progress_ = this->previous_;
00062
00063 // If we are at the outer nested upcall.
00064 if (this->object_adapter_.non_servant_upcall_nesting_level_ == 0)
00065 {
00066 // Reset thread id.
00067 this->object_adapter_.non_servant_upcall_thread_ =
00068 ACE_OS::NULL_thread;
00069
00070 // Check if all pending requests are over.
00071 if (this->poa_.waiting_destruction () &&
00072 this->poa_.outstanding_requests () == 0)
00073 {
00074 try
00075 {
00076 this->poa_.complete_destruction_i ();
00077 }
00078 catch (const::CORBA::Exception&ex)
00079 {
00080 // Ignore exceptions
00081 ex._tao_print_exception ("TAO_POA::complete_destruction_i");
00082 }
00083 }
00084
00085 // If locking is enabled.
00086 if (this->object_adapter_.enable_locking_)
00087 // Wakeup all waiting threads.
00088 this->object_adapter_.non_servant_upcall_condition_.broadcast ();
00089 }
00090 }
|
|
|
Definition at line 12 of file Non_Servant_Upcall.inl. Referenced by TAO_Root_POA::destroy_i().
00013 {
00014 return this->poa_;
00015 }
|
|
|
Definition at line 64 of file Non_Servant_Upcall.h. Referenced by Non_Servant_Upcall(), and ~Non_Servant_Upcall(). |
|
|
Definition at line 65 of file Non_Servant_Upcall.h. |
|
|
Definition at line 66 of file Non_Servant_Upcall.h. |
1.3.6