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