#include <EC_Lifetime_Utils.h>
Public Member Functions | |
TAO_EC_Object_Deactivator (void) | |
TAO_EC_Object_Deactivator (PortableServer::POA_ptr poa, PortableServer::ObjectId const &id) | |
~TAO_EC_Object_Deactivator (void) | |
void | set_values (PortableServer::POA_ptr poa, PortableServer::ObjectId const &id) |
void | set_values (TAO_EC_Object_Deactivator &deactivator) |
Take on the state of deactivator. deactivator loses its state. | |
void | allow_deactivation (void) |
void | disallow_deactivation (void) |
void | deactivate (void) |
PortableServer::POA_var | poa (void) const |
Accessor for the POA used in deactivation. | |
Private Member Functions | |
TAO_EC_Object_Deactivator (const TAO_EC_Object_Deactivator &rhs) | |
TAO_EC_Object_Deactivator & | operator= (const TAO_EC_Object_Deactivator &rhs) |
Private Attributes | |
PortableServer::POA_var | poa_ |
POA from which the object will be deactivated. | |
PortableServer::ObjectId | id_ |
ObjectId of the object to be deactivated. | |
int | deactivate_ |
Maintains state necessary to deactivate a servant from POA. Can be told to deactivate a servant explicitly or can do so automagically, in its destructor.
Definition at line 41 of file EC_Lifetime_Utils.h.
|
Default constructor. Deactivation info can be supplied later through set_values (). Definition at line 8 of file EC_Lifetime_Utils.i.
00009 : poa_ () 00010 , id_ () 00011 , deactivate_ (0) 00012 { 00013 } |
|
Constructor. Set id which will be deactivated from @ poa in the deactivator's destructor, unless deactivate () or disallow_deactivation () are invoked before the destruction. Definition at line 16 of file EC_Lifetime_Utils.i.
00019 : poa_ (PortableServer::POA::_duplicate (poa)) 00020 , id_ (id) 00021 , deactivate_ (1) 00022 { 00023 } |
|
Destructor. Deactivates id_ from poa_ if those values have been set, and neither deactivate() nor disallow_deactivation() have been invoked. Definition at line 46 of file EC_Lifetime_Utils.i. References deactivate().
00047 { 00048 this->deactivate (); 00049 } |
|
|
|
Explicitly enable deactivation to happen in destructor or when deactivate() is called. Definition at line 58 of file EC_Lifetime_Utils.i. References deactivate_.
00059 { 00060 this->deactivate_ = 1; 00061 } |
|
Perform deactivation now if and values have been set, and deactivation hasn't happened yet nor has it been explicitly disallowed. CORBA exceptions occurring during deactivation are not propagated. Deactivation will NOT happen in the destructor. Definition at line 26 of file EC_Lifetime_Utils.i. References ACE_CATCHANY, ACE_DECLARE_NEW_CORBA_ENV, ACE_ENDTRY, ACE_ENV_ARG_PARAMETER, ACE_TRY, ACE_TRY_CHECK, deactivate_, and CORBA::is_nil(). Referenced by TAO_ECG_UDP_Sender::shutdown(), TAO_ECG_UDP_Receiver::shutdown(), TAO_ECG_Mcast_EH::Observer::shutdown(), and ~TAO_EC_Object_Deactivator().
00027 { 00028 if (this->deactivate_ && !CORBA::is_nil (this->poa_.in ())) 00029 { 00030 ACE_DECLARE_NEW_CORBA_ENV; 00031 ACE_TRY 00032 { 00033 this->deactivate_ = 0; 00034 this->poa_->deactivate_object (id_ ACE_ENV_ARG_PARAMETER); 00035 ACE_TRY_CHECK; 00036 } 00037 ACE_CATCHANY 00038 { 00039 // The deactivation can throw... 00040 } 00041 ACE_ENDTRY; 00042 } 00043 } |
|
Explicitly disable deactivation from happening in destructor or when deactivate() is called. Definition at line 64 of file EC_Lifetime_Utils.i. References deactivate_. Referenced by TAO_ECG_Mcast_Gateway::run(), and TAO_EC_Deactivated_Object::~TAO_EC_Deactivated_Object().
00065 { 00066 this->deactivate_ = 0; 00067 } |
|
|
|
Accessor for the POA used in deactivation.
Definition at line 52 of file EC_Lifetime_Utils.i.
00053 { 00054 return this->poa_; 00055 } |
|
Take on the state of deactivator. deactivator loses its state.
Definition at line 79 of file EC_Lifetime_Utils.i. References deactivate_, id_, and poa_.
00080 { 00081 if (this == &deactivator) 00082 return; 00083 00084 this->poa_ = deactivator.poa_._retn (); 00085 this->id_ = deactivator.id_; 00086 this->deactivate_ = deactivator.deactivate_; 00087 deactivator.deactivate_ = 0; 00088 } |
|
Set which will be deactivated from in the deactivator's destructor, unless deactivate () or disallow_deactivation () are invoked before the destruction. Definition at line 70 of file EC_Lifetime_Utils.i. References deactivate_. Referenced by TAO_EC_Deactivated_Object::set_deactivator().
00072 { 00073 this->poa_ = PortableServer::POA::_duplicate (poa); 00074 this->id_ = id; 00075 this->deactivate_ = 1; 00076 } |
|
Flag indicating whether deactivation will be attempted. The flag is set to false if and haven't been set yet, or if deactivation already happened, or if disallow_deactivation () method is invoked. Definition at line 103 of file EC_Lifetime_Utils.h. Referenced by allow_deactivation(), deactivate(), disallow_deactivation(), and set_values(). |
|
ObjectId of the object to be deactivated.
Definition at line 97 of file EC_Lifetime_Utils.h. Referenced by set_values(). |
|
POA from which the object will be deactivated.
Definition at line 94 of file EC_Lifetime_Utils.h. Referenced by set_values(). |