TAO_Fault_Tolerance_Service Class Reference

TAO_Fault_Tolerant_Service. More...

#include <Fault_Tolerance_Service.h>

Collaboration diagram for TAO_Fault_Tolerance_Service:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_Fault_Tolerance_Service (void)
 Ctor.

 ~TAO_Fault_Tolerance_Service (void)
 Dtor.

void init (TAO_ORB_Core *orb_core)
 Initialise the internal data structures.

TAO_Service_Callbacksservice_callback (void)
 Return the underlying callback object.

const ACE_CStringclient_id (void)
 Return the underlying .

void client_id (const char *id)
 Set the client id.

CORBA::Long retention_id (void)
 Generate and return a new retention id.


Private Attributes

TAO_Service_Callbacksft_service_callback_
 hook to callback on to the service

ACE_CString ft_object_id_
 The object id that would be used if the ft service is loaded.

CORBA::Long ft_object_retention_id_
ACE_Lockft_object_retention_id_lock_
 Lock for the retention id.


Detailed Description

TAO_Fault_Tolerant_Service.

A collection of ORB & ORB_Core related stuff that is needed at the ORB level. The ORB Core would carry an instance of this class and invoke methods on this. Note: This collection would be really useful when we have logging in place. The contents of this class can be logged at regular check point intervals.

Definition at line 52 of file Fault_Tolerance_Service.h.


Constructor & Destructor Documentation

TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE TAO_Fault_Tolerance_Service::TAO_Fault_Tolerance_Service void   ) 
 

Ctor.

Definition at line 8 of file Fault_Tolerance_Service.i.

00009   : ft_service_callback_ (0),
00010     ft_object_id_ (),
00011     ft_object_retention_id_ (-1),
00012     ft_object_retention_id_lock_ (0)
00013 {
00014 }

TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Fault_Tolerance_Service::~TAO_Fault_Tolerance_Service void   ) 
 

Dtor.

Definition at line 18 of file Fault_Tolerance_Service.cpp.

References ft_object_retention_id_lock_, and ft_service_callback_.

00019 {
00020   delete this->ft_service_callback_;
00021   delete this->ft_object_retention_id_lock_;
00022 }


Member Function Documentation

ACE_INLINE void TAO_Fault_Tolerance_Service::client_id const char *  id  ) 
 

Set the client id.

Definition at line 29 of file Fault_Tolerance_Service.i.

References ft_object_id_.

00030 {
00031   this->ft_object_id_ = id;
00032 }

ACE_INLINE const ACE_CString & TAO_Fault_Tolerance_Service::client_id void   ) 
 

Return the underlying .

Definition at line 23 of file Fault_Tolerance_Service.i.

References ft_object_id_.

Referenced by CORBA::ORB::_tao_ft_client_id().

00024 {
00025   return this->ft_object_id_;
00026 }

void TAO_Fault_Tolerance_Service::init TAO_ORB_Core orb_core  ) 
 

Initialise the internal data structures.

Definition at line 25 of file Fault_Tolerance_Service.cpp.

References TAO_Services_Activate::activate_services(), TAO_ORB_Core::client_factory(), TAO_Client_Strategy_Factory::create_ft_service_retention_id_lock(), ft_object_id_, ft_object_retention_id_lock_, and ft_service_callback_.

Referenced by TAO_ORB_Core::services_callbacks_init().

00026 {
00027   // Look in to the svc conf stuff to get an instance of the
00028   // FT_Service.
00029   if (this->ft_service_callback_ == 0)
00030     {
00031       TAO_Services_Activate *service =
00032         ACE_Dynamic_Service <TAO_Services_Activate>::instance ("FT_ClientService_Activate");
00033 
00034       // Activate the callback
00035       if (service)
00036         this->ft_service_callback_ = service->activate_services (orb_core);
00037     }
00038 
00039   // If we have a valid service then we instantiate our lock and the
00040   // client id
00041   if (this->ft_service_callback_)
00042     {
00043       // Initialize the lock
00044       this->ft_object_retention_id_lock_ =
00045         orb_core->client_factory ()
00046           ->create_ft_service_retention_id_lock ();
00047 
00048       // Initialize the client id
00049       this->ft_object_id_ = "TAO_Client";
00050     }
00051 
00052   return;
00053 }

CORBA::Long TAO_Fault_Tolerance_Service::retention_id void   ) 
 

Generate and return a new retention id.

Definition at line 56 of file Fault_Tolerance_Service.cpp.

References ACE_GUARD_RETURN, and ft_object_retention_id_.

00057 {
00058   ACE_MT (ACE_GUARD_RETURN (ACE_Lock,
00059                             guard,
00060                             *this->ft_object_retention_id_lock_,
00061                             0));
00062 
00063   return ++this->ft_object_retention_id_;
00064 }

ACE_INLINE TAO_Service_Callbacks * TAO_Fault_Tolerance_Service::service_callback void   ) 
 

Return the underlying callback object.

Definition at line 17 of file Fault_Tolerance_Service.i.

References ft_service_callback_.

Referenced by TAO_ORB_Core::hash_service(), TAO_ORB_Core::is_profile_equivalent(), TAO_ORB_Core::object_is_nil(), TAO_ORB_Core::reset_service_profile_flags(), TAO_ORB_Core::service_profile_reselection(), TAO_ORB_Core::service_profile_selection(), TAO_ORB_Core::service_raise_comm_failure(), and TAO_ORB_Core::service_raise_transient_failure().

00018 {
00019   return this->ft_service_callback_;
00020 }


Member Data Documentation

ACE_CString TAO_Fault_Tolerance_Service::ft_object_id_ [private]
 

The object id that would be used if the ft service is loaded.

Definition at line 83 of file Fault_Tolerance_Service.h.

Referenced by client_id(), and init().

CORBA::Long TAO_Fault_Tolerance_Service::ft_object_retention_id_ [private]
 

This and the act as unique identifiers for the request sent from the source Object. Modification of this value is done by the loaded FT

Definition at line 90 of file Fault_Tolerance_Service.h.

Referenced by retention_id().

ACE_Lock* TAO_Fault_Tolerance_Service::ft_object_retention_id_lock_ [private]
 

Lock for the retention id.

Definition at line 93 of file Fault_Tolerance_Service.h.

Referenced by init(), and ~TAO_Fault_Tolerance_Service().

TAO_Service_Callbacks* TAO_Fault_Tolerance_Service::ft_service_callback_ [private]
 

hook to callback on to the service

Definition at line 80 of file Fault_Tolerance_Service.h.

Referenced by init(), service_callback(), and ~TAO_Fault_Tolerance_Service().


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 12:13:47 2006 for TAO by doxygen 1.3.6