00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Table_Adapter.h 00006 * 00007 * Table_Adapter.h,v 1.14 2006/04/19 09:38:06 jwillemsen Exp 00008 * 00009 * @author Carlos O'Ryan (coryan@uci.edu) 00010 */ 00011 //============================================================================= 00012 00013 00014 #ifndef TAO_TABLE_ADAPTER_H 00015 #define TAO_TABLE_ADAPTER_H 00016 #include /**/ "ace/pre.h" 00017 00018 #include "tao/IORTable/iortable_export.h" 00019 00020 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00021 # pragma once 00022 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00023 00024 #include "tao/Adapter.h" 00025 #include "tao/Adapter_Factory.h" 00026 #include "ace/Service_Config.h" 00027 00028 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00029 00030 class TAO_IOR_Table_Impl; 00031 00032 class TAO_IORTable_Export TAO_Table_Adapter : public TAO_Adapter 00033 { 00034 public: 00035 /// Constructor 00036 TAO_Table_Adapter (TAO_ORB_Core *orb_core); 00037 00038 /// Destructor 00039 virtual ~TAO_Table_Adapter (void); 00040 00041 // = The TAO_Adapter methods, please check tao/Adapter.h for the 00042 // documentation 00043 virtual void open (ACE_ENV_SINGLE_ARG_DECL); 00044 virtual void close (int wait_for_completion 00045 ACE_ENV_ARG_DECL); 00046 virtual void check_close (int wait_for_completion 00047 ACE_ENV_ARG_DECL); 00048 virtual int priority (void) const; 00049 virtual int dispatch (TAO::ObjectKey &key, 00050 TAO_ServerRequest &request, 00051 CORBA::Object_out foward_to 00052 ACE_ENV_ARG_DECL) 00053 ACE_THROW_SPEC ((CORBA::SystemException)); 00054 virtual const char *name (void) const; 00055 virtual CORBA::Object_ptr root (void); 00056 virtual CORBA::Object_ptr create_collocated_object (TAO_Stub *, 00057 const TAO_MProfile &); 00058 00059 virtual CORBA::Long initialize_collocated_object (TAO_Stub *); 00060 private: 00061 /// Helper method to find an object bound in the table. 00062 /// @return 1 if found, 0 otherwise. 00063 CORBA::Long find_object (TAO::ObjectKey &key, 00064 CORBA::Object_out forward_to 00065 ACE_ENV_ARG_DECL) 00066 ACE_THROW_SPEC ((CORBA::SystemException)); 00067 00068 /// The ORB Core we belong to 00069 TAO_ORB_Core * const orb_core_; 00070 00071 /// The table implementation 00072 TAO_IOR_Table_Impl *root_; 00073 }; 00074 00075 // **************************************************************** 00076 00077 class TAO_IORTable_Export TAO_Table_Adapter_Factory : public TAO_Adapter_Factory 00078 { 00079 public: 00080 /// Constructor 00081 TAO_Table_Adapter_Factory (void); 00082 00083 // = The TAO_Adapter_Factory methods, please read tao/Adapter.h for 00084 // details. 00085 virtual TAO_Adapter *create (TAO_ORB_Core *orb_core); 00086 }; 00087 00088 TAO_END_VERSIONED_NAMESPACE_DECL 00089 00090 ACE_STATIC_SVC_DECLARE (TAO_Table_Adapter_Factory) 00091 ACE_FACTORY_DECLARE (TAO_IORTable, TAO_Table_Adapter_Factory) 00092 00093 #include /**/ "ace/post.h" 00094 #endif /* TAO_TABLE_ADAPTER_H */