00001 //-*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Fault_Tolerance_Service.h 00006 * 00007 * Fault_Tolerance_Service.h,v 1.13 2005/11/24 11:05:45 ossama Exp 00008 * 00009 * A collection of the ORB and ORB core related properties that are 00010 * specific to FT service. The TAO_ORB_Core holds an instance of this 00011 * class. 00012 * 00013 * 00014 * @author Bala Natarajan <bala@cs.wustl.edu> 00015 */ 00016 //============================================================================= 00017 #ifndef TAO_FAULT_TOLERANCE_SERVICE_H 00018 #define TAO_FAULT_TOLERANCE_SERVICE_H 00019 00020 #include /**/ "ace/pre.h" 00021 00022 #include "tao/TAO_Export.h" 00023 00024 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00025 # pragma once 00026 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00027 00028 #include "tao/Basic_Types.h" 00029 #include "ace/SString.h" 00030 00031 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00032 class ACE_Lock; 00033 ACE_END_VERSIONED_NAMESPACE_DECL 00034 00035 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00036 00037 class TAO_Service_Callbacks; 00038 class TAO_ORB_Core; 00039 00040 /** 00041 * @class TAO_Fault_Tolerance_Service 00042 * 00043 * @brief TAO_Fault_Tolerant_Service 00044 * 00045 * A collection of ORB & ORB_Core related stuff that is needed at 00046 * the ORB level. The ORB Core would carry an instance of this 00047 * class and invoke methods on this. 00048 * Note: This collection would be really useful when we have 00049 * logging in place. The contents of this class can be logged at 00050 * regular check point intervals. 00051 */ 00052 class TAO_Export TAO_Fault_Tolerance_Service 00053 { 00054 00055 public: 00056 /// Ctor 00057 TAO_Fault_Tolerance_Service (void); 00058 00059 /// Dtor 00060 ~TAO_Fault_Tolerance_Service (void); 00061 00062 /// Initialise the internal data structures 00063 void init (TAO_ORB_Core *orb_core); 00064 00065 /// Return the underlying callback object 00066 TAO_Service_Callbacks *service_callback (void); 00067 00068 /// Return the underlying <ft_object_id> 00069 const ACE_CString &client_id (void); 00070 00071 /// Set the client id 00072 void client_id (const char *id); 00073 00074 /// Generate and return a new retention id 00075 CORBA::Long retention_id (void); 00076 00077 private: 00078 00079 /// hook to callback on to the service 00080 TAO_Service_Callbacks *ft_service_callback_; 00081 00082 /// The object id that would be used if the ft service is loaded. 00083 ACE_CString ft_object_id_; 00084 00085 /** 00086 * This and the <ft_object_id_> act as unique identifiers for the 00087 * request sent from the source Object. Modification of this value 00088 * is done by the loaded FT 00089 */ 00090 CORBA::Long ft_object_retention_id_; 00091 00092 /// Lock for the retention id 00093 ACE_Lock *ft_object_retention_id_lock_; 00094 00095 // NOTE: At a glance this retention id can be easily mistaken for a 00096 // request id in a GIOP request. But the purpose served are a lot 00097 // more than what a RequestId does for GIOP. So, we have a unique 00098 // generator with a lock to protect from different threads accessing 00099 // this. 00100 }; 00101 00102 TAO_END_VERSIONED_NAMESPACE_DECL 00103 00104 #if defined (__ACE_INLINE__) 00105 # include "tao/Fault_Tolerance_Service.i" 00106 #endif /* __ACE_INLINE__ */ 00107 00108 #include /**/ "ace/post.h" 00109 #endif /*TAO_FAULT_TOLERANCE_SERVICE_H*/