00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Adapter_Registry.h 00006 * 00007 * Adapter_Registry.h,v 1.8 2006/06/19 14:51:11 parsons Exp 00008 * 00009 * @author Carlos O'Ryan (coryan@uci.edu) 00010 */ 00011 //============================================================================= 00012 00013 #ifndef TAO_ADAPTER_REGISTRY_H 00014 #define TAO_ADAPTER_REGISTRY_H 00015 00016 #include /**/ "ace/pre.h" 00017 00018 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00019 # pragma once 00020 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00021 00022 #include "tao/SystemException.h" 00023 00024 #if defined(_MSC_VER) 00025 #pragma warning(push) 00026 #pragma warning(disable:4250) 00027 #endif /* _MSC_VER */ 00028 00029 #include "tao/CORBA_methods.h" 00030 #include "tao/Pseudo_VarOut_T.h" 00031 00032 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00033 00034 namespace CORBA 00035 { 00036 typedef TAO_Pseudo_Var_T<Object> Object_var; 00037 typedef TAO_Pseudo_Out_T<Object> Object_out; 00038 } 00039 00040 namespace TAO 00041 { 00042 class ObjectKey; 00043 } 00044 00045 class TAO_ORB_Core; 00046 class TAO_Stub; 00047 class TAO_MProfile; 00048 class TAO_ServerRequest; 00049 class TAO_Adapter; 00050 00051 class TAO_Export TAO_Adapter_Registry 00052 { 00053 public: 00054 TAO_Adapter_Registry (TAO_ORB_Core *orb_core); 00055 00056 /// Close the 00057 ~TAO_Adapter_Registry (void); 00058 00059 /** 00060 * Close each of of the Adapters and then cleanup the Registry. 00061 * It is possible that an Adapter will reject a close() call if it 00062 * is invoked in an innapropriate context (think shutting down the 00063 * POA while performing an upcall). 00064 */ 00065 void close (int wait_for_completion 00066 ACE_ENV_ARG_DECL); 00067 00068 /** 00069 * Verify if the close() call can be invoked in the current 00070 * context for *all* adapters. 00071 * Raise the right exception if not. 00072 */ 00073 void check_close (int wait_for_completion 00074 ACE_ENV_ARG_DECL); 00075 00076 /// Insert a new adapter into the registry. 00077 void insert (TAO_Adapter *adapter 00078 ACE_ENV_ARG_DECL); 00079 00080 /** 00081 * Dispatch the request to all the adapters. 00082 * It tries the adapters ordered by priority, stopping when the 00083 * adapter returns a status different from DS_MISMATCHED_KEY 00084 */ 00085 void dispatch (TAO::ObjectKey &key, 00086 TAO_ServerRequest &request, 00087 CORBA::Object_out forward_to 00088 ACE_ENV_ARG_DECL); 00089 00090 /// Create a collocated object using the given profile and stub. 00091 CORBA::Object_ptr create_collocated_object (TAO_Stub *, 00092 const TAO_MProfile &); 00093 00094 /// Initialize a collocated object using the given stub and object 00095 /// pointer for lazily evaluated object references. 00096 CORBA::Long initialize_collocated_object (TAO_Stub *); 00097 00098 /// Fetch the adapter named @a name 00099 TAO_Adapter *find_adapter (const char *name) const; 00100 00101 private: 00102 /// The ORB Core 00103 TAO_ORB_Core *orb_core_; 00104 00105 /** 00106 * @name A simple array of adapters. 00107 */ 00108 //@{ 00109 size_t adapters_capacity_; 00110 size_t adapters_count_; 00111 TAO_Adapter **adapters_; 00112 //@} 00113 }; 00114 00115 TAO_END_VERSIONED_NAMESPACE_DECL 00116 00117 #if defined(_MSC_VER) 00118 #pragma warning(pop) 00119 #endif /* _MSC_VER */ 00120 00121 #include /**/ "ace/post.h" 00122 00123 #endif /* TAO_ADAPTER_REGISTRY_H */