#include <LifespanStrategyTransient.h>
Inheritance diagram for TAO::Portable_Server::LifespanStrategyTransient:
Public Member Functions | |
LifespanStrategyTransient (void) | |
virtual void | notify_startup (void) |
virtual void | notify_shutdown (void) |
char | key_type (void) const |
virtual CORBA::Boolean | is_persistent (void) const |
Do we have set persistent or not,. | |
CORBA::ULong | key_length (void) const |
virtual void | create_key (CORBA::Octet *buffer, CORBA::ULong &starting_at) |
virtual bool | validate (CORBA::Boolean is_persistent, const TAO::Portable_Server::Temporary_Creation_Time &creation_time) const |
Validate whether this matches the set lifespan strategy. | |
virtual void | check_state (void) |
Check the state of the POA. | |
virtual ::PortableServer::LifespanPolicyValue | type () const |
virtual bool | use_imr () const |
Private Attributes | |
TAO::Portable_Server::Creation_Time | creation_time_ |
Definition at line 32 of file LifespanStrategyTransient.h.
TAO::Portable_Server::LifespanStrategyTransient::LifespanStrategyTransient | ( | void | ) |
Definition at line 22 of file LifespanStrategyTransient.cpp.
00022 : 00023 creation_time_ (ACE_OS::gettimeofday ()) 00024 { 00025 }
void TAO::Portable_Server::LifespanStrategyTransient::check_state | ( | void | ) | [virtual] |
Check the state of the POA.
Implements TAO::Portable_Server::LifespanStrategy.
Definition at line 92 of file LifespanStrategyTransient.cpp.
References TAO_POA_Manager::check_state(), CORBA::COMPLETED_NO, CORBA::OMGVMCID, TAO::Portable_Server::LifespanStrategy::poa_, and TAO_Root_POA::tao_poa_manager().
00093 { 00094 if (this->poa_->tao_poa_manager ().get_state_i () == 00095 PortableServer::POAManager::INACTIVE) 00096 { 00097 throw ::CORBA::OBJECT_NOT_EXIST (CORBA::OMGVMCID | 4, CORBA::COMPLETED_NO); 00098 } 00099 else 00100 { 00101 this->poa_->tao_poa_manager ().check_state (); 00102 } 00103 }
void TAO::Portable_Server::LifespanStrategyTransient::create_key | ( | CORBA::Octet * | buffer, | |
CORBA::ULong & | starting_at | |||
) | [virtual] |
Implements TAO::Portable_Server::LifespanStrategy.
Definition at line 67 of file LifespanStrategyTransient.cpp.
References TAO::Portable_Server::Creation_Time::creation_time_length(), TAO::Portable_Server::LifespanStrategy::key_type_length(), and ACE_OS::memcpy().
00069 { 00070 // Copy the persistence byte. 00071 buffer[starting_at] = (CORBA::Octet)this->key_type (); 00072 starting_at += this->key_type_length (); 00073 00074 #if (POA_NO_TIMESTAMP == 0) 00075 // Then copy the timestamp for transient POAs. 00076 ACE_OS::memcpy (&buffer[starting_at], 00077 this->creation_time_.creation_time (), 00078 TAO::Portable_Server::Creation_Time::creation_time_length 00079 ()); 00080 starting_at += TAO::Portable_Server::Creation_Time::creation_time_length 00081 (); 00082 #endif /* POA_NO_TIMESTAMP */ 00083 }
CORBA::Boolean TAO::Portable_Server::LifespanStrategyTransient::is_persistent | ( | void | ) | const [virtual] |
Do we have set persistent or not,.
Implements TAO::Portable_Server::LifespanStrategy.
Definition at line 38 of file LifespanStrategyTransient.cpp.
CORBA::ULong TAO::Portable_Server::LifespanStrategyTransient::key_length | ( | void | ) | const [virtual] |
Returns the length of the key type
Implements TAO::Portable_Server::LifespanStrategy.
Definition at line 53 of file LifespanStrategyTransient.cpp.
References TAO::Portable_Server::Creation_Time::creation_time_length().
00054 { 00055 CORBA::ULong keylength = sizeof (char); 00056 00057 #if (POA_NO_TIMESTAMP == 0) 00058 // Calculate the space required for the timestamp. 00059 keylength += TAO::Portable_Server::Creation_Time::creation_time_length 00060 (); 00061 #endif /* POA_NO_TIMESTAMP */ 00062 00063 return keylength; 00064 }
char TAO::Portable_Server::LifespanStrategyTransient::key_type | ( | void | ) | const |
void TAO::Portable_Server::LifespanStrategyTransient::notify_shutdown | ( | void | ) | [virtual] |
Implements TAO::Portable_Server::LifespanStrategy.
Definition at line 33 of file LifespanStrategyTransient.cpp.
void TAO::Portable_Server::LifespanStrategyTransient::notify_startup | ( | void | ) | [virtual] |
Implements TAO::Portable_Server::LifespanStrategy.
Definition at line 28 of file LifespanStrategyTransient.cpp.
PortableServer::LifespanPolicyValue TAO::Portable_Server::LifespanStrategyTransient::type | ( | ) | const [virtual] |
Implements TAO::Portable_Server::LifespanStrategy.
Definition at line 112 of file LifespanStrategyTransient.cpp.
bool TAO::Portable_Server::LifespanStrategyTransient::use_imr | ( | ) | const [virtual] |
Implements TAO::Portable_Server::LifespanStrategy.
Definition at line 106 of file LifespanStrategyTransient.cpp.
bool TAO::Portable_Server::LifespanStrategyTransient::validate | ( | CORBA::Boolean | is_persistent, | |
const TAO::Portable_Server::Temporary_Creation_Time & | creation_time | |||
) | const [virtual] |
Validate whether this matches the set lifespan strategy.
Implements TAO::Portable_Server::LifespanStrategy.
Definition at line 44 of file LifespanStrategyTransient.cpp.
00048 { 00049 return (!is_persistent && this->creation_time_ == creation_time); 00050 }
TAO::Portable_Server::Creation_Time TAO::Portable_Server::LifespanStrategyTransient::creation_time_ [private] |
Definition at line 62 of file LifespanStrategyTransient.h.