TAO::Portable_Server::LifespanStrategyTransient Class Reference

#include <LifespanStrategyTransient.h>

Inheritance diagram for TAO::Portable_Server::LifespanStrategyTransient:

Inheritance graph
[legend]
Collaboration diagram for TAO::Portable_Server::LifespanStrategyTransient:

Collaboration graph
[legend]
List of all members.

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_

Constructor & Destructor Documentation

TAO::Portable_Server::LifespanStrategyTransient::LifespanStrategyTransient void   ) 
 

Definition at line 22 of file LifespanStrategyTransient.cpp.

00022                                                           :
00023       creation_time_ (ACE_OS::gettimeofday ())
00024     {
00025     }


Member Function Documentation

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(), TAO_POA_Manager::get_state_i(), 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 key_type(), 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.

00039     {
00040       return false;
00041     }

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.

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
 

Definition at line 86 of file LifespanStrategyTransient.cpp.

Referenced by create_key().

00087     {
00088       return 'T';
00089     }

void TAO::Portable_Server::LifespanStrategyTransient::notify_shutdown void   )  [virtual]
 

Implements TAO::Portable_Server::LifespanStrategy.

Definition at line 33 of file LifespanStrategyTransient.cpp.

00034     {
00035     }

void TAO::Portable_Server::LifespanStrategyTransient::notify_startup void   )  [virtual]
 

Implements TAO::Portable_Server::LifespanStrategy.

Definition at line 28 of file LifespanStrategyTransient.cpp.

00029     {
00030     }

PortableServer::LifespanPolicyValue TAO::Portable_Server::LifespanStrategyTransient::type  )  const [virtual]
 

Implements TAO::Portable_Server::LifespanStrategy.

Definition at line 112 of file LifespanStrategyTransient.cpp.

00113     {
00114       return ::PortableServer::TRANSIENT;
00115     }

bool TAO::Portable_Server::LifespanStrategyTransient::use_imr  )  const [virtual]
 

Implements TAO::Portable_Server::LifespanStrategy.

Definition at line 106 of file LifespanStrategyTransient.cpp.

00107     {
00108       return false;
00109     }

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.

References creation_time_.

00048     {
00049       return (!is_persistent && this->creation_time_ == creation_time);
00050     }


Member Data Documentation

TAO::Portable_Server::Creation_Time TAO::Portable_Server::LifespanStrategyTransient::creation_time_ [private]
 

Definition at line 62 of file LifespanStrategyTransient.h.

Referenced by validate().


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 13:29:04 2008 for TAO_PortableServer by doxygen 1.3.6