00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Connection_Timeout_Policy_i.h 00006 * 00007 * $Id: Connection_Timeout_Policy_i.h 81429 2008-04-24 18:49:54Z johnnyw $ 00008 * 00009 * @author Balachandran Natarajan (bala@cs.wustl.edu) 00010 */ 00011 //============================================================================= 00012 00013 #ifndef TAO_CONNECTION_TIMEOUT_POLICY_I_H 00014 #define TAO_CONNECTION_TIMEOUT_POLICY_I_H 00015 00016 #include /**/ "ace/pre.h" 00017 00018 #include "tao/orbconf.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 # pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 #include "tao/Messaging/TAO_ExtC.h" 00025 #include "tao/LocalObject.h" 00026 00027 #if defined(_MSC_VER) 00028 #pragma warning(push) 00029 #pragma warning(disable:4250) 00030 #endif /* _MSC_VER */ 00031 00032 00033 #if (TAO_HAS_CONNECTION_TIMEOUT_POLICY == 1) 00034 00035 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00036 00037 /* 00038 * @class TAO_ConnectionTimeoutPolicy 00039 * 00040 * @brief TAO::ConnectionTimeoutPolicy implementation 00041 * 00042 * This policy controls the connection timeout time while 00043 * establishing connections. This policy is proprietary to TAO. 00044 */ 00045 class TAO_ConnectionTimeoutPolicy 00046 : public TAO::ConnectionTimeoutPolicy, 00047 public ::CORBA::LocalObject 00048 { 00049 00050 public: 00051 /// Constructor. 00052 TAO_ConnectionTimeoutPolicy (const TimeBase::TimeT& relative_expiry); 00053 00054 /// Copy constructor. 00055 TAO_ConnectionTimeoutPolicy (const TAO_ConnectionTimeoutPolicy &rhs); 00056 00057 /// Implement the timeout hook, this is set in the ORB_Core at 00058 /// initialization time. 00059 static void hook (TAO_ORB_Core *orb_core, 00060 TAO_Stub *stub, 00061 bool &has_timeout, 00062 ACE_Time_Value &time_value); 00063 00064 /// Helper method for the implementation of 00065 /// CORBA::ORB::create_policy. 00066 static CORBA::Policy_ptr create (const CORBA::Any& val); 00067 00068 /// Returns a copy of <this>. 00069 virtual TAO_ConnectionTimeoutPolicy *clone (void) const; 00070 00071 // = The TAO::ConnectionTinoutPolicy methods 00072 virtual TimeBase::TimeT relative_expiry (void); 00073 00074 virtual CORBA::PolicyType policy_type (void); 00075 00076 virtual CORBA::Policy_ptr copy (void); 00077 00078 virtual void destroy (void); 00079 00080 /// Change the CORBA representation to the ACE representation. 00081 void set_time_value (ACE_Time_Value &time_value); 00082 00083 /// Return the cached policy type for this policy. 00084 virtual TAO_Cached_Policy_Type _tao_cached_type (void) const; 00085 00086 private: 00087 /// The attribute 00088 TimeBase::TimeT relative_expiry_; 00089 }; 00090 00091 TAO_END_VERSIONED_NAMESPACE_DECL 00092 00093 #endif /* TAO_HAS_RELATIVE_ROUNDTRIP_TIMEOUT_POLICY == 1 */ 00094 00095 #if defined(_MSC_VER) 00096 #pragma warning(pop) 00097 #endif /* _MSC_VER */ 00098 00099 #include /**/ "ace/post.h" 00100 00101 #endif /* TAO_CONNECTION_TIMEOUT_POLICY_I_H */