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

Fault_Tolerance_Service.h

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

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