diff options
author | bala <balanatarajan@users.noreply.github.com> | 2003-05-23 16:11:53 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2003-05-23 16:11:53 +0000 |
commit | 6979b4cf279f07ae49075e7a67893a56108902c9 (patch) | |
tree | e49c4253ca8fa2482a5f713040996e16d24c95a8 | |
parent | 9ca100169e7e1fb02b8275fef4221f74915bf246 (diff) | |
download | ATCD-6979b4cf279f07ae49075e7a67893a56108902c9.tar.gz |
ChangeLogTag:Fri May 23 10:59:50 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 22 | ||||
-rw-r--r-- | TAO/tao/ORB.cpp | 89 | ||||
-rw-r--r-- | TAO/tao/ORB.h | 32 | ||||
-rw-r--r-- | TAO/tao/Valuetype/Valuetype_Adapter_Impl.cpp | 42 | ||||
-rw-r--r-- | TAO/tao/Valuetype/Valuetype_Adapter_Impl.h | 15 | ||||
-rw-r--r-- | TAO/tao/Valuetype_Adapter.h | 14 |
6 files changed, 104 insertions, 110 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index d4100e9fea9..4273f3db4b2 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,21 @@ +Fri May 23 10:59:50 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu> + + * tao/Valuetype_Adapter.h: Cleaned the interface to the ORB to + provide a consistent way of performing operations on ValueType. + + * tao/ORB.h: Removed references to TAO_ValueFactory_Map. Cache a + pointer to the ValueFactory_Adapter instead. + + * tao/ORB.cpp: Integrated patches from Vincent Korkos + <vincent.korkos@fr.thalesgroup.com> which contained the + implentation of the ORB::unregister_value_factory (). + + Did some cosmetic fixes to the implementations of + lookup_value_factory () and register_value_factory (). + + * tao/Valuetype/Valuetype_Adapter_Impl.cpp (vf_map_find): + Implemented the new adapter interfaces. + Fri May 23 08:14:52 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu> * tao/IORInterceptor_Adapter.h: #included Exception.h. This should @@ -21,8 +39,8 @@ Fri May 23 06:03:21 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu> The focal point of the problem TAO_IORInterceptor_List class which was left in the main tao library. This class used all - sorts of mechanisms to access the IORInterceptor libray which - lead to shutdown probelms if the ORB was dynamically loaded. + sorts of mechanisms to access the IORInterceptor library which + lead to shutdown problems if the ORB was dynamically loaded. The following changes basically moved the class to its own library and resolves the problems seen. diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp index 28f896c09bc..37a128793f4 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -145,12 +145,12 @@ void CORBA::ORB::InvalidName::_tao_decode ( // **************************************************************** CORBA::ORB::ORB (TAO_ORB_Core *orb_core) - : lock_ (), - refcount_ (1), - orb_core_ (orb_core), - valuetype_factory_map_ (0), - use_omg_ior_format_ (1), - timeout_ (0) + : lock_ () + , refcount_ (1) + , orb_core_ (orb_core) + , valuetype_adapter_ (0) + , use_omg_ior_format_ (1) + , timeout_ (0) { } @@ -2045,93 +2045,66 @@ CORBA::ORB::register_value_factory (const char *repository_id, CORBA::ValueFactory factory ACE_ENV_ARG_DECL) { -// %! guard, and ACE_Null_Mutex in the map -// do _add_ref here not in map->rebind + // %! guard, and ACE_Null_Mutex in the map + // do _add_ref here not in map->rebind - TAO_Valuetype_Adapter *adapter = - ACE_Dynamic_Service<TAO_Valuetype_Adapter>::instance ( - TAO_ORB_Core::valuetype_adapter_name () - ); - - if (adapter == 0) + if (this->valuetype_adapter_ == 0) { - ACE_THROW_RETURN (CORBA::INTERNAL (), - 0); - } - if (this->valuetype_factory_map_ == 0) - { - // currently the ValueFactory_Map is a singleton and not per ORB - // as in the OMG specs - this->valuetype_factory_map_ = - adapter->valuefactory_map_instance (); + this->valuetype_adapter_ = + ACE_Dynamic_Service<TAO_Valuetype_Adapter>::instance ( + TAO_ORB_Core::valuetype_adapter_name () + ); - if (this->valuetype_factory_map_ == 0) + if (this->valuetype_adapter_ == 0) { - ACE_THROW_RETURN (CORBA::INTERNAL (), + ACE_THROW_RETURN (CORBA::INTERNAL (), 0); } } - int result = adapter->vf_map_rebind (this->valuetype_factory_map_, - repository_id, - factory); + int result = + this->valuetype_adapter_->vf_map_rebind (repository_id, + factory); if (result == -1) { // Error on bind. - ACE_THROW_RETURN (CORBA::INTERNAL (), + ACE_THROW_RETURN (CORBA::MARSHAL (), 0); } - if (result == 1) - { - return factory; // previous factory was found - } - - return 0; + return factory; // previous factory was found } void -CORBA::ORB::unregister_value_factory (const char * /* repository_id */ +CORBA::ORB::unregister_value_factory (const char *repository_id ACE_ENV_ARG_DECL) { - ACE_THROW (CORBA::NO_IMPLEMENT ()); + if (this->valuetype_adapter_) + { + // Dont care whther it was successful or not! + (void) this->valuetype_adapter_->vf_map_unbind (repository_id); + } } CORBA::ValueFactory CORBA::ORB::lookup_value_factory (const char *repository_id ACE_ENV_ARG_DECL) { -// %! guard -// do _add_ref here not in map->find - if (this->valuetype_factory_map_) + if (this->valuetype_adapter_ == 0) { - TAO_Valuetype_Adapter *adapter = + this->valuetype_adapter_ = ACE_Dynamic_Service<TAO_Valuetype_Adapter>::instance ( TAO_ORB_Core::valuetype_adapter_name () ); - if (adapter == 0) + if (this->valuetype_adapter_ == 0) { ACE_THROW_RETURN (CORBA::INTERNAL (), 0); } - - CORBA::ValueFactory factory = 0; - int result = adapter->vf_map_find (this->valuetype_factory_map_, - repository_id, - factory); - - if (result == -1) - { - factory = 0; // %! raise exception ! - } - - return factory; - } - else - { - return 0; // %! raise exception ! } + + return this->valuetype_adapter_->vf_map_find (repository_id); } diff --git a/TAO/tao/ORB.h b/TAO/tao/ORB.h index 8cd8a781d7a..6f146c262cf 100644 --- a/TAO/tao/ORB.h +++ b/TAO/tao/ORB.h @@ -52,9 +52,8 @@ class TAO_Server_Strategy_Factory; class TAO_InputCDR; class TAO_OutputCDR; class TAO_Stub; - +class TAO_Valuetype_Adapter; class TAO_Acceptor_Filter; -class TAO_ValueFactory_Map; // **************************************************************** @@ -174,27 +173,27 @@ namespace CORBA // Typedefs for CORBA::ORB::RequestSeq, which is an argument of // send_multiple_requests_*(). - typedef + typedef TAO_Unbounded_Pseudo_Sequence< - CORBA::Request, + CORBA::Request, CORBA::Request_var - > + > RequestSeq; - typedef + typedef TAO_VarSeq_Var_T< - RequestSeq, + RequestSeq, TAO_Pseudo_Object_Manager< - CORBA::Request, + CORBA::Request, CORBA::Request_var > - > + > RequestSeq_var; - typedef + typedef TAO_Seq_Out_T< - RequestSeq, - RequestSeq_var, + RequestSeq, + RequestSeq_var, TAO_Pseudo_Object_Manager< CORBA::Request, CORBA::Request_var @@ -603,8 +602,17 @@ namespace CORBA /// The ORB_Core that created us.... TAO_ORB_Core *orb_core_; + /// @@NOTE: No freaking clue why this is in the ORB?? +#if 0 /// If non-0 then this is the Factory for OBV unmarshaling TAO_ValueFactory_Map *valuetype_factory_map_; +#endif /**/ + + /// Pointer to the adapter.. + /// @@ NOTE this should have ideally been in the ORB_core like the + /// others. Continuing on the earlier mistake we are adding it to + /// the ORB. + TAO_Valuetype_Adapter *valuetype_adapter_; /// Decides whether to use the URL notation or to use IOR notation. CORBA::Boolean use_omg_ior_format_; diff --git a/TAO/tao/Valuetype/Valuetype_Adapter_Impl.cpp b/TAO/tao/Valuetype/Valuetype_Adapter_Impl.cpp index 5990001b91b..3d0e8365316 100644 --- a/TAO/tao/Valuetype/Valuetype_Adapter_Impl.cpp +++ b/TAO/tao/Valuetype/Valuetype_Adapter_Impl.cpp @@ -14,7 +14,7 @@ TAO_Valuetype_Adapter_Impl::~TAO_Valuetype_Adapter_Impl (void) { } -CORBA::Object_ptr +CORBA::Object_ptr TAO_Valuetype_Adapter_Impl::abstractbase_to_object ( CORBA::AbstractBase_ptr p ) @@ -28,30 +28,33 @@ TAO_Valuetype_Adapter_Impl::type_info_single (void) const return TAO_OBV_GIOP_Flags::Type_info_single; } -TAO_ValueFactory_Map * -TAO_Valuetype_Adapter_Impl::valuefactory_map_instance (void) +int +TAO_Valuetype_Adapter_Impl::vf_map_rebind (const char *repo_id, + CORBA::ValueFactory &factory) { - return TAO_VALUEFACTORY_MAP::instance (); + return TAO_VALUEFACTORY_MAP::instance ()->rebind (repo_id, + factory); } - -int -TAO_Valuetype_Adapter_Impl::vf_map_rebind (TAO_ValueFactory_Map *map, - const char *repo_id, - CORBA::ValueFactory &factory) + +int +TAO_Valuetype_Adapter_Impl::vf_map_unbind (const char *repo_id) + { - return map->rebind (repo_id, - factory); + CORBA::ValueFactory fac; + return TAO_VALUEFACTORY_MAP::instance ()->unbind (repo_id, + fac); } -int -TAO_Valuetype_Adapter_Impl::vf_map_find (TAO_ValueFactory_Map *map, - const char *repo_id, - CORBA::ValueFactory &factory) +CORBA::ValueFactory +TAO_Valuetype_Adapter_Impl::vf_map_find (const char *repo_id) { - return map->find (repo_id, - factory); + CORBA::ValueFactory factory = 0; + (void) TAO_VALUEFACTORY_MAP::instance ()->find (repo_id, + factory); + + return factory; } - + // ********************************************************************* // Initialization and registration of dynamic service object. @@ -63,7 +66,7 @@ TAO_Valuetype_Adapter_Impl::Initializer (void) "Concrete_Valuetype_Adapter" ); - return + return ACE_Service_Config::process_directive ( ace_svc_desc_TAO_Valuetype_Adapter_Impl ); @@ -79,4 +82,3 @@ ACE_STATIC_SVC_DEFINE ( ) ACE_FACTORY_DEFINE (TAO_Valuetype, TAO_Valuetype_Adapter_Impl) - diff --git a/TAO/tao/Valuetype/Valuetype_Adapter_Impl.h b/TAO/tao/Valuetype/Valuetype_Adapter_Impl.h index 8a7ca834c1c..784bdb99494 100644 --- a/TAO/tao/Valuetype/Valuetype_Adapter_Impl.h +++ b/TAO/tao/Valuetype/Valuetype_Adapter_Impl.h @@ -32,7 +32,7 @@ * ValueFactory and AbstractInterface classes. This is a concrete class * implementating the pure virtual methods of TAO_Valuetype_Adapter */ -class TAO_Valuetype_Export TAO_Valuetype_Adapter_Impl +class TAO_Valuetype_Export TAO_Valuetype_Adapter_Impl : public TAO_Valuetype_Adapter { public: @@ -44,16 +44,13 @@ public: virtual CORBA::ULong type_info_single (void) const; - virtual TAO_ValueFactory_Map *valuefactory_map_instance (void); - - virtual int vf_map_rebind (TAO_ValueFactory_Map *, - const char *, + virtual int vf_map_rebind (const char *, CORBA::ValueFactory &); - virtual int vf_map_find (TAO_ValueFactory_Map *, - const char *, - CORBA::ValueFactory &); - + virtual int vf_map_unbind (const char *); + + virtual CORBA::ValueFactory vf_map_find (const char *); + // Used to force the initialization of the ORB code. static int Initializer (void); }; diff --git a/TAO/tao/Valuetype_Adapter.h b/TAO/tao/Valuetype_Adapter.h index 9c9c4b8f5a6..8e28b63d09b 100644 --- a/TAO/tao/Valuetype_Adapter.h +++ b/TAO/tao/Valuetype_Adapter.h @@ -23,8 +23,6 @@ #include "tao/corbafwd.h" -class TAO_ValueFactory_Map; - /** * @class TAO_Valuetype_Adapter * @@ -45,15 +43,13 @@ public: virtual CORBA::ULong type_info_single (void) const = 0; - virtual TAO_ValueFactory_Map * valuefactory_map_instance (void) = 0; - - virtual int vf_map_rebind (TAO_ValueFactory_Map *, - const char *, + virtual int vf_map_rebind (const char *, CORBA::ValueFactory &) = 0; - virtual int vf_map_find (TAO_ValueFactory_Map *, - const char *, - CORBA::ValueFactory &) = 0; + virtual int vf_map_unbind (const char *) = 0; + + + virtual CORBA::ValueFactory vf_map_find (const char *) = 0; }; #include "ace/post.h" |