Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Fault_Tolerance_Service.cpp

Go to the documentation of this file.
00001 #include "tao_pch.h"
00002 #include "tao/Fault_Tolerance_Service.h"
00003 #include "tao/Service_Callbacks.h"
00004 #include "ace/Dynamic_Service.h"
00005 #include "tao/Services_Activate.h"
00006 #include "tao/ORB_Core.h"
00007 #include "tao/Client_Strategy_Factory.h"
00008 
00009 #if !defined (__ACE_INLINE__)
00010 # include "tao/Fault_Tolerance_Service.i"
00011 #endif /* __ACE_INLINE__ */
00012 
00013 ACE_RCSID(tao, Fault_Tolerance_Service, "$Id: Fault_Tolerance_Service.cpp,v 1.1.1.2.2.1 2003/03/14 16:05:12 chad Exp $")
00014 
00015 TAO_Fault_Tolerance_Service::~TAO_Fault_Tolerance_Service (void)
00016 {
00017   delete this->ft_service_callback_;
00018   delete this->ft_object_retention_id_lock_;
00019 }
00020 
00021 void
00022 TAO_Fault_Tolerance_Service::init (TAO_ORB_Core *orb_core)
00023 {
00024   // Look in to the svc conf stuff to get an instance of the
00025   // FT_Service.
00026   if (this->ft_service_callback_ == 0)
00027     {
00028       TAO_Services_Activate *service =
00029         ACE_Dynamic_Service <TAO_Services_Activate>::instance ("FT_Service_Activate");
00030 
00031       // Activate the callback
00032       if (service)
00033         this->ft_service_callback_ = service->activate_services (orb_core);
00034     }
00035 
00036   // If we have a valid service then we instantiate our lock and the
00037   // client id
00038   if (this->ft_service_callback_)
00039     {
00040       // Initialize the lock
00041       this->ft_object_retention_id_lock_ =
00042         orb_core->client_factory ()
00043           ->create_ft_service_retention_id_lock ();
00044 
00045       // Initialize the client id
00046       this->ft_object_id_ = "TAO_Client";
00047     }
00048 
00049   return;
00050 }
00051 
00052 CORBA::Long
00053 TAO_Fault_Tolerance_Service::retention_id (void)
00054 {
00055   ACE_MT (ACE_GUARD_RETURN (ACE_Lock,
00056                             guard,
00057                             *this->ft_object_retention_id_lock_,
00058                             0));
00059 
00060   return ++this->ft_object_retention_id_;
00061 }

Generated on Mon Jun 16 13:48:23 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002