00001 // -*- C++ -*- 00002 00003 // =================================================================== 00004 /** 00005 * @file Connector_Impl.h 00006 * 00007 * Connector_Impl.h,v 1.10 2006/06/02 13:05:18 jwillemsen Exp 00008 * 00009 * @author Balachandran Natarajan <bala@cs.wustl.edu> 00010 */ 00011 // =================================================================== 00012 00013 #ifndef TAO_CONNECTOR_IMPL_H 00014 #define TAO_CONNECTOR_IMPL_H 00015 00016 #include /**/ "ace/pre.h" 00017 #include "ace/Strategies_T.h" 00018 00019 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00020 # pragma once 00021 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00022 00023 #include "tao/Basic_Types.h" 00024 00025 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00026 class ACE_Thread_Manager; 00027 ACE_END_VERSIONED_NAMESPACE_DECL 00028 00029 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00030 00031 class TAO_ORB_Core; 00032 00033 /** 00034 * @class TAO_Connect_Creation_Strategy 00035 * 00036 * @brief Creation strategy helper 00037 * 00038 * Creates the TAO_*_Connection_Handler object for the TAO_*_Connector 00039 * objects. This template class can now be used by all the Connector 00040 * objects instead of having to duplicate code. This class can be used 00041 * to set any required properties on the connection handlers at 00042 * creation time. 00043 * 00044 */ 00045 00046 template <class SVC_HANDLER> 00047 class TAO_Connect_Creation_Strategy : public ACE_Creation_Strategy<SVC_HANDLER> 00048 { 00049 public: 00050 00051 /// Constructor. 00052 TAO_Connect_Creation_Strategy (ACE_Thread_Manager * = 0, 00053 TAO_ORB_Core* orb_core = 0, 00054 CORBA::Boolean flag = false); 00055 00056 /// Makes TAO_*_Client_Connection_Handlers 00057 virtual int make_svc_handler (SVC_HANDLER *&sh); 00058 00059 00060 private: 00061 00062 /// Pointer to the ORB_Core on which we are activated 00063 TAO_ORB_Core * const orb_core_; 00064 00065 /// Are we using GIOP lite? 00066 CORBA::Boolean const lite_flag_; 00067 }; 00068 00069 00070 00071 /** 00072 * @class TAO_Connect_Concurrency_Strategy 00073 * 00074 * @brief Concurrency strategy helper 00075 * 00076 * Activates the Svc_Handler, and then if the correct wait strategy is 00077 * in use registers the handler with the reactor. 00078 * 00079 */ 00080 00081 template <class SVC_HANDLER> 00082 class TAO_Connect_Concurrency_Strategy : 00083 public ACE_Concurrency_Strategy<SVC_HANDLER> 00084 { 00085 public: 00086 00087 /// Constructor. 00088 TAO_Connect_Concurrency_Strategy (TAO_ORB_Core *orb_core); 00089 00090 00091 /// Activates the Svc_Handler, and if the right wait strategy is in 00092 /// use, registers the handle with the reactor. 00093 int activate_svc_handler (SVC_HANDLER *svc_handler, 00094 void *arg); 00095 00096 private: 00097 00098 /// Pointer to the ORB Core. 00099 TAO_ORB_Core * const orb_core_; 00100 00101 }; 00102 00103 TAO_END_VERSIONED_NAMESPACE_DECL 00104 00105 00106 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) 00107 #include "tao/Connector_Impl.cpp" 00108 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ 00109 00110 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) 00111 #pragma implementation ("Connector_Impl.cpp") 00112 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ 00113 00114 #include /**/ "ace/post.h" 00115 #endif /*TAO_CONNECTOR_IMPL_H*/