diff options
Diffstat (limited to 'TAO/tao')
36 files changed, 1444 insertions, 502 deletions
diff --git a/TAO/tao/Any.cpp b/TAO/tao/Any.cpp index dcb23a11578..9b94071da57 100644 --- a/TAO/tao/Any.cpp +++ b/TAO/tao/Any.cpp @@ -1724,10 +1724,7 @@ CORBA_Any_var::operator= (CORBA::Any *p) { if (this->ptr_ != p) { - if (this->ptr_ != 0) - { - delete (this->ptr_); - } + delete this->ptr_; this->ptr_ = p; } @@ -1744,10 +1741,7 @@ CORBA_Any_var::operator= (const CORBA::Any_var& r) CORBA::Any (*r.ptr_), *this); - if (this->ptr_ != 0) - { - delete this->ptr_; - } + delete this->ptr_; this->ptr_ = tmp; diff --git a/TAO/tao/CORBALOC_Parser.cpp b/TAO/tao/CORBALOC_Parser.cpp index f4eb0339c84..fca2884c32c 100644 --- a/TAO/tao/CORBALOC_Parser.cpp +++ b/TAO/tao/CORBALOC_Parser.cpp @@ -230,7 +230,8 @@ TAO_CORBALOC_Parser::make_stub_from_mprofile (CORBA::Environment &ACE_TRY_ENV) // Now make the TAO_Stub. TAO_Stub *data = 0; ACE_NEW_THROW_EX (data, - TAO_Stub ((char *) 0, this->mprofile_, + TAO_Stub ((const char *) 0, + this->mprofile_, this->orb_->orb_core ()), CORBA::NO_MEMORY ( CORBA_SystemException::_tao_minor_code ( diff --git a/TAO/tao/Cleanup_Func_Registry.cpp b/TAO/tao/Cleanup_Func_Registry.cpp new file mode 100644 index 00000000000..ea14a4e9a47 --- /dev/null +++ b/TAO/tao/Cleanup_Func_Registry.cpp @@ -0,0 +1,56 @@ +// -*- C++ -*- +// +// $Id$ + +#include "Cleanup_Func_Registry.h" + +#if !defined (__ACE_INLINE__) +# include "Cleanup_Func_Registry.inl" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID (tao, Cleanup_Func_Registry, "$Id$") + +TAO_Cleanup_Func_Registry::TAO_Cleanup_Func_Registry (void) + : cleanup_funcs_ () +{ +} + +TAO_Cleanup_Func_Registry::~TAO_Cleanup_Func_Registry (void) +{ +} + +int +TAO_Cleanup_Func_Registry::register_cleanup_function ( + ACE_CLEANUP_FUNC func, + size_t &slot_id) +{ + size_t slot = this->cleanup_funcs_.size (); + + if (this->cleanup_funcs_.size (slot + 1) != 0) + return -1; + + this->cleanup_funcs_[slot] = func; + slot_id = slot; + + return 0; +} + +void +TAO_Cleanup_Func_Registry::cleanup (ACE_Array_Base<void *> &ts_objects) +{ + size_t len = ts_objects.size (); + + // The allocated slot may never been used. It is therefore possible + // that the TSS array size maybe less than the cleanup function + // size. However, there is still a one-to-one correspondence + // between cleanup_func[foo] and ts_object[foo]. + + ACE_ASSERT (len <= this->cleanup_funcs_.size ()); + + /// Cleanup each TSS object. + for (size_t i = 0; i < len; ++i) + { + ACE_CLEANUP_FUNC destructor = this->cleanup_funcs_[i]; + destructor (ts_objects[i], 0); + } +} diff --git a/TAO/tao/Cleanup_Func_Registry.h b/TAO/tao/Cleanup_Func_Registry.h new file mode 100644 index 00000000000..d5dea40248c --- /dev/null +++ b/TAO/tao/Cleanup_Func_Registry.h @@ -0,0 +1,90 @@ +// -*- C++ -*- + +// =================================================================== +/** + * @file Cleanup_Func_Registry.h + * + * $Id$ + * + * @author Ossama Othman <ossama@uci.edu> + */ +// =================================================================== + +#ifndef TAO_CLEANUP_FUNC_REGISTRY_H +#define TAO_CLEANUP_FUNC_REGISTRY_H + +#include "ace/pre.h" + +#include "corbafwd.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + + +/** + * @class TAO_Cleanup_Func_Registry + * + * @brief + * This is a helper class that is designed to perform cleanup on + * thread-specific objects registered in the ORB Core TSS resources by + * invoking the corresponding cleanup function on each object. Hence, + * there is a tight coupling between this class and the TAO ORB Core. + */ +class TAO_Export TAO_Cleanup_Func_Registry +{ + friend class TAO_ORBInitInfo; + friend class TAO_ORB_Core_TSS_Resources; + friend class TAO_ORB_Core; + +public: + + /// Constructor + TAO_Cleanup_Func_Registry (void); + + /// Destructor + ~TAO_Cleanup_Func_Registry (void); + + /// Return the number of registered cleanup functions. + size_t size (void) const; + +protected: + + /// Register a cleanup function. The number of slot the cleanup + /// function is placed is in will match the one reserved for the + /// corresponding thread specific object in the ORB Core TSS + /// resources. The slot_id is returned via the second reference + /// argument. This method returns 0 on failure, and -1 on failure. + int register_cleanup_function (ACE_CLEANUP_FUNC func, + size_t &slot_id); + + /// Invoke the corresponding cleanup function on each + /// thread-specific object. + void cleanup (ACE_Array_Base<void *> &ts_objects); + +private: + + /// Prevent copying through the copy constructor and the assignment + /// operator. + ACE_UNIMPLEMENTED_FUNC ( + TAO_Cleanup_Func_Registry (const TAO_Cleanup_Func_Registry &)) + ACE_UNIMPLEMENTED_FUNC (void operator= (const TAO_Cleanup_Func_Registry &)) + +private: + + /// Array of registered cleanup functions. The number of + /// registered cleanup functions should be the same as the number + /// of registered thread-specific objects in the ORB Core TSS + /// resources. + ACE_Array_Base<ACE_CLEANUP_FUNC> cleanup_funcs_; + +}; + +#if defined (__ACE_INLINE__) +# include "Cleanup_Func_Registry.inl" +#endif /* __ACE_INLINE__ */ + + +#include "ace/post.h" + +#endif /* TAO_CLEANUP_FUNC_REGISTRY_H */ diff --git a/TAO/tao/Cleanup_Func_Registry.inl b/TAO/tao/Cleanup_Func_Registry.inl new file mode 100644 index 00000000000..1e2a8362075 --- /dev/null +++ b/TAO/tao/Cleanup_Func_Registry.inl @@ -0,0 +1,9 @@ +// -*- C++ -*- +// +// $Id$ + +ACE_INLINE size_t +TAO_Cleanup_Func_Registry::size (void) const +{ + return this->cleanup_funcs_.size (); +} diff --git a/TAO/tao/IOP_N.pidl b/TAO/tao/IOP_N.pidl index dfa0123e1e8..e9fd1bfcc93 100644 --- a/TAO/tao/IOP_N.pidl +++ b/TAO/tao/IOP_N.pidl @@ -15,7 +15,7 @@ #define local #endif -//#include <orb.idl> - removed by Kirthika +#include <orb.idl> #include <IOP.pidl> // .idl in the spec module IOP_N { diff --git a/TAO/tao/IORInfo.cpp b/TAO/tao/IORInfo.cpp new file mode 100644 index 00000000000..a153b15c5b9 --- /dev/null +++ b/TAO/tao/IORInfo.cpp @@ -0,0 +1,96 @@ +// -*- C++ -*- +// +// $Id$ + +#include "IORInfo.h" +#include "PolicyC.h" +#include "IOPC.h" +#include "CONV_FRAMEC.h" +#include "MProfile.h" +#include "GIOP_Message_State.h" + +ACE_RCSID (tao, IORInfo, "$Id$") + + +TAO_IORInfo::TAO_IORInfo (TAO_ORB_Core *orb_core, + TAO_MProfile &mp, + CORBA::PolicyList *policy_list) + : orb_core_ (orb_core), + mp_ (mp), + policy_list_ (policy_list) +{ +} + +TAO_IORInfo::~TAO_IORInfo (void) +{ +} + +CORBA::Policy_ptr +TAO_IORInfo::get_effective_policy (CORBA::PolicyType type, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + // Check the policy list supplied by the POA. + CORBA::ULong policy_count = this->policy_list_->length (); + + for (CORBA::ULong i = 0; i < policy_count; ++i) + { + CORBA::PolicyType pt = + (*(this->policy_list_))[i]->policy_type ( + TAO_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (CORBA::Policy::_nil ()); + + if (pt == type) + return CORBA::Policy::_duplicate ((*(this->policy_list_))[i]); + } + + // TODO: Now check the global ORB policies. + // ........ + + ACE_THROW_RETURN (CORBA::INV_POLICY ( + CORBA_SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + EINVAL), + CORBA::COMPLETED_NO), + CORBA::Policy::_nil ()); +} + +void +TAO_IORInfo::add_ior_component (const IOP::TaggedComponent &component, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + // Add the given tagged component to all profiles. + + CORBA::ULong profile_count = this->mp_.profile_count (); + for (CORBA::ULong i = 0; i != profile_count; ++i) + { + TAO_Profile *profile = this->mp_.get_profile (i); + + profile->add_tagged_component (component, ACE_TRY_ENV); + ACE_CHECK; + } +} + +void +TAO_IORInfo::add_ior_component_to_profile ( + const IOP::TaggedComponent &component, + IOP::ProfileId profile_id, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + // Add the given tagged component to all profiles matching the given + // ProfileId. + + CORBA::ULong profile_count = this->mp_.profile_count (); + for (CORBA::ULong i = 0; i != profile_count; ++i) + { + TAO_Profile *profile = this->mp_.get_profile (i); + + if (profile->tag () == profile_id) + { + profile->add_tagged_component (component, ACE_TRY_ENV); + ACE_CHECK; + } + } +} diff --git a/TAO/tao/IORInfo.h b/TAO/tao/IORInfo.h new file mode 100644 index 00000000000..c56e31694b6 --- /dev/null +++ b/TAO/tao/IORInfo.h @@ -0,0 +1,119 @@ +// -*- C++ -*- + +// =================================================================== +/** + * @file IORInfo.h + * + * $Id$ + * + * @author Ossama Othman <ossama@uci.edu> + */ +// =================================================================== + +#ifndef TAO_IOR_INFO_H +#define TAO_IOR_INFO_H + +#include "ace/pre.h" + +#include "corbafwd.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "PortableInterceptorC.h" +#include "LocalObject.h" + +// This is to remove "inherits via dominance" warnings from MSVC. +// MSVC is being a little too paranoid. +#if defined(_MSC_VER) +#if (_MSC_VER >= 1200) +#pragma warning(push) +#endif /* _MSC_VER >= 1200 */ +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + + +/// Forward declarations. +class TAO_Profile; +class TAO_MProfile; + + +/** + * @class TAO_IORInfo + * + * @brief + * This class exposes an interface that allows IORInterceptors add + * tagged components to IORs. + */ +class TAO_Export TAO_IORInfo : + public virtual PortableInterceptor::IORInfo, + public virtual TAO_Local_RefCounted_Object +{ + friend class TAO_ORB_Core; + +public: + + /// Destructor + ~TAO_IORInfo (void); + + /// Return the policy matching the given policy type that is in + /// effect for the object whose IOR is being created. + virtual CORBA::Policy_ptr get_effective_policy ( + CORBA::PolicyType type, + CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Add the given tagged component to all profiles. + virtual void add_ior_component ( + const IOP::TaggedComponent & component, + CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Add the given tagged component to all profiles matching the given + /// ProfileId. + virtual void add_ior_component_to_profile ( + const IOP::TaggedComponent & component, + IOP::ProfileId profile_id, + CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()) + ACE_THROW_SPEC ((CORBA::SystemException)); + +protected: + + /// Only allow this class to be instantiated on the heap since it + /// is reference counted. + TAO_IORInfo (TAO_ORB_Core *orb_core, + TAO_MProfile &mp, + CORBA::PolicyList *policy_list); + +private: + + /// Prevent copying through the copy constructor and the assignment + /// operator. + ACE_UNIMPLEMENTED_FUNC ( + TAO_IORInfo (const TAO_IORInfo &)) + ACE_UNIMPLEMENTED_FUNC (void operator= (const TAO_IORInfo &)) + +private: + + /// Pointer to the ORB Core of the current ORB. + TAO_ORB_Core *orb_core_; + + /// Reference to the profiles corresponding to the servant being + /// created. + TAO_MProfile &mp_; + + /// Pointer to the list of policies in effect for the servant + /// being created. + CORBA::PolicyList *policy_list_; + +}; + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#include "ace/post.h" + +#endif /* TAO_IOR_INFO_H */ + diff --git a/TAO/tao/Interceptor_List.cpp b/TAO/tao/Interceptor_List.cpp index 62397be35b9..29aab0d326b 100644 --- a/TAO/tao/Interceptor_List.cpp +++ b/TAO/tao/Interceptor_List.cpp @@ -180,16 +180,65 @@ TAO_ServerRequestInterceptor_List::add_interceptor ( PortableInterceptor::ServerRequestInterceptor::_duplicate (interceptor); } +// ------------------------------------------------------------------- + +TAO_IORInterceptor_List::TAO_IORInterceptor_List (void) + : interceptors_ () +{ +} + +TAO_IORInterceptor_List::~TAO_IORInterceptor_List (void) +{ + size_t len = this->interceptors_.size (); + + for (size_t i = 0; i < len; ++i) + CORBA::release (this->interceptors_[i]); +} + +size_t +TAO_IORInterceptor_List::length (void) +{ + return this->interceptors_.size (); +} + +void +TAO_IORInterceptor_List::length (size_t len) +{ + this->interceptors_.size (len); +} + +PortableInterceptor::Interceptor_ptr +TAO_IORInterceptor_List::interceptor (size_t index) +{ + return this->interceptors_[index]; +} + +void +TAO_IORInterceptor_List::add_interceptor ( + PortableInterceptor::IORInterceptor_ptr interceptor, + CORBA::Environment &ACE_TRY_ENV) +{ + size_t index = this->add_interceptor_i (interceptor, + ACE_TRY_ENV); + ACE_CHECK; + + // @@ Should we duplicate the reference here? + this->interceptors_[index] = + PortableInterceptor::IORInterceptor::_duplicate (interceptor); +} + #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Array_Base<PortableInterceptor::ClientRequestInterceptor_ptr>; template class ACE_Array_Base<PortableInterceptor::ServerRequestInterceptor_ptr>; +template class ACE_Array_Base<PortableInterceptor::IORInterceptor_ptr>; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) #pragma instantiate ACE_Array_Base<PortableInterceptor::ClientRequestInterceptor_ptr> #pragma instantiate ACE_Array_Base<PortableInterceptor::ServerRequestInterceptor_ptr> +#pragma instantiate ACE_Array_Base<PortableInterceptor::IORInterceptor_ptr> #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/tao/Interceptor_List.h b/TAO/tao/Interceptor_List.h index 44f29e49dcc..c346c1ebc2b 100644 --- a/TAO/tao/Interceptor_List.h +++ b/TAO/tao/Interceptor_List.h @@ -1,162 +1,219 @@ // -*- C++ -*- -// -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO -// -// = FILENAME -// Interceptor_List.h -// -// = AUTHOR -// Ossama Othman <ossama@uci.edu> -// -// ============================================================================ + +// =================================================================== +/** + * @file Interceptor_List.h + * + * $Id$ + * + * @author Ossama Othman <ossama@uci.edu> + */ +// =================================================================== #ifndef TAO_INTERCEPTOR_LIST_H #define TAO_INTERCEPTOR_LIST_H #include "ace/pre.h" -#include "tao/corbafwd.h" +#include "corbafwd.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#if (TAO_HAS_INTERCEPTORS == 1) -#include "tao/PortableInterceptorC.h" +#include "PortableInterceptorC.h" #include "ace/Containers_T.h" -/// Base class for the various portable interceptor lists used -/// internally by TAO. +/** + * @class TAO_Interceptor_List + * + * @brief + * Base class for the various portable interceptor lists used + * internally by TAO. + */ class TAO_Export TAO_Interceptor_List { public: - TAO_Interceptor_List (void); - ///< Constructor + /// Constructor + TAO_Interceptor_List (void); + + /// Destructor virtual ~TAO_Interceptor_List (void); - ///< Destructor. protected: + /// Register an in interceptor with interceptor list. size_t add_interceptor_i ( PortableInterceptor::Interceptor_ptr interceptor, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException, PortableInterceptor::ORBInitInfo::DuplicateName)); - ///< Register an in interceptor with interceptor list. + /// Return the length of the underlying interceptor sequence. virtual size_t length (void) = 0; - ///< Return the length of the underlying interceptor sequence. + /// Set the length of the underlying interceptor sequence. virtual void length (size_t) = 0; - ///< Set the length of the underlying interceptor sequence. + /// Return the interceptor in sequence element <index>. virtual PortableInterceptor::Interceptor_ptr interceptor ( size_t index) = 0; - ///< Return the interceptor in sequence element <index>. }; +#if (TAO_HAS_INTERCEPTORS == 1) +/** + * @class TAO_ClientRequestInterceptor_List + * + * @brief Encapsulation for a list of client request interceptors. + */ class TAO_Export TAO_ClientRequestInterceptor_List : public TAO_Interceptor_List { public: + /// Define a trait for the underlying portable interceptor array. typedef ACE_Array_Base<PortableInterceptor::ClientRequestInterceptor_ptr> TYPE; - ///< Define a trait for the underlying portable interceptor array. public: + /// Constructor TAO_ClientRequestInterceptor_List (void); - ///< Constructor + /// Destructor ~TAO_ClientRequestInterceptor_List (void); - ///< ~Destructor + /// Register a client request interceptor. void add_interceptor (PortableInterceptor::ClientRequestInterceptor_ptr i, CORBA::Environment &ACE_TRY_ENV); - ///< Register a client request interceptor. + /// Return reference to the underlying Portable Interceptor array. TYPE &interceptors (void); - ///< Return reference to the underlying Portable Interceptor array. protected: + /// Return the length of the underlying interceptor array. virtual size_t length (void); - ///< Return the length of the underlying interceptor array. + /// Set the length of the underlying interceptor array. virtual void length (size_t); - ///< Set the length of the underlying interceptor array. + /// Return the interceptor in element <index>. virtual PortableInterceptor::Interceptor_ptr interceptor (size_t); - ///< Return the interceptor in element <index>. private: + /// Dynamic array of registered client request interceptors. TYPE interceptors_; - ///< Dynamic array of registered client request interceptors. }; -/// Override the interceptor list type so the base class -/// add_interceptor() method + +/** + * @class TAO_ServerRequestInterceptor_List + * + * @brief Encapsulation for a list of server request interceptors. + */ class TAO_Export TAO_ServerRequestInterceptor_List : public TAO_Interceptor_List { public: + /// Define a trait for the underlying portable interceptor array. typedef ACE_Array_Base<PortableInterceptor::ServerRequestInterceptor_ptr> TYPE; - ///< Define a trait for the underlying portable interceptor array. public: + /// Constructor TAO_ServerRequestInterceptor_List (void); - ///< Constructor + /// Destructor ~TAO_ServerRequestInterceptor_List (void); - ///< ~Destructor + /// Register a server request interceptor. void add_interceptor (PortableInterceptor::ServerRequestInterceptor_ptr i, CORBA::Environment &ACE_TRY_ENV); - ///< Register a server request interceptor. + /// Return reference to the underlying Portable Interceptor array. + TYPE &interceptors (void); + +protected: + + /// Return the length of the underlying interceptor array. + virtual size_t length (void); + + /// Set the length of the underlying interceptor array. + virtual void length (size_t); + + /// Return the interceptor in array element <index>. + virtual PortableInterceptor::Interceptor_ptr interceptor (size_t); + +private: + + /// Dynamic array of registered server request interceptors. + TYPE interceptors_; + +}; +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + + +/** + * @class TAO_IORInterceptor_List + * + * @brief Encapsulation for a list of IOR interceptors. + */ +class TAO_Export TAO_IORInterceptor_List + : public TAO_Interceptor_List +{ +public: + + /// Define a trait for the underlying portable interceptor array. + typedef + ACE_Array_Base<PortableInterceptor::IORInterceptor_ptr> TYPE; + +public: + + /// Constructor + TAO_IORInterceptor_List (void); + + /// Destructor + ~TAO_IORInterceptor_List (void); + + /// Register an IOR interceptor. + void add_interceptor (PortableInterceptor::IORInterceptor_ptr i, + CORBA::Environment &ACE_TRY_ENV); + + /// Return reference to the underlying Portable Interceptor array. TYPE &interceptors (void); - ///< Return reference to the underlying Portable Interceptor array. protected: + /// Return the length of the underlying interceptor array. virtual size_t length (void); - ///< Return the length of the underlying interceptor array. + /// Set the length of the underlying interceptor array. virtual void length (size_t); - ///< Set the length of the underlying interceptor array. + /// Return the interceptor in array element <index>. virtual PortableInterceptor::Interceptor_ptr interceptor (size_t); - ///< Return the interceptor in array element <index>. private: + /// Dynamic array of registered IOR interceptors. TYPE interceptors_; - ///< Dynamic array of registered server request interceptors. }; #if defined (__ACE_INLINE__) -#include "tao/Interceptor_List.inl" +#include "Interceptor_List.inl" #endif /* defined INLINE */ -#endif /* TAO_HAS_INTERCEPTORS == 1 */ - #include "ace/post.h" #endif /* TAO_INTERCEPTOR_LIST_H */ diff --git a/TAO/tao/Interceptor_List.inl b/TAO/tao/Interceptor_List.inl index e2f1d4c2700..8b49ce536d1 100644 --- a/TAO/tao/Interceptor_List.inl +++ b/TAO/tao/Interceptor_List.inl @@ -2,6 +2,7 @@ // // $Id$ +#if TAO_HAS_INTERCEPTORS == 1 ACE_INLINE TAO_ClientRequestInterceptor_List::TYPE & TAO_ClientRequestInterceptor_List::interceptors (void) { @@ -15,3 +16,12 @@ TAO_ServerRequestInterceptor_List::interceptors (void) { return this->interceptors_; } +#endif /* TAO_HAS_INTERCEPTORS == 1 */ + +// ------------------ + +ACE_INLINE TAO_IORInterceptor_List::TYPE & +TAO_IORInterceptor_List::interceptors (void) +{ + return this->interceptors_; +} diff --git a/TAO/tao/MProfile.cpp b/TAO/tao/MProfile.cpp index 8808536b66a..f83ae8f6b44 100644 --- a/TAO/tao/MProfile.cpp +++ b/TAO/tao/MProfile.cpp @@ -178,7 +178,7 @@ TAO_MProfile::remove_profile (const TAO_Profile *pfile) int TAO_MProfile::remove_profiles (const TAO_MProfile *pfiles) { - for (TAO_PHandle h = 0;h < pfiles->last_;h++) + for (TAO_PHandle h = 0; h < pfiles->last_; ++h) { if (this->remove_profile (pfiles->pfiles_[h]) < 0) return -1; @@ -190,10 +190,10 @@ CORBA::Boolean TAO_MProfile::is_equivalent (const TAO_MProfile *rhs) { // Two profile lists are equivalent iff at least one of the profiles - // form the first list is_equivalent to at least one of the profiles + // from the first list is_equivalent to at least one of the profiles // from the second list!! - for (TAO_PHandle h1 = 0; h1 < this->last_;h1++) - for (TAO_PHandle h2 = 0; h2 < rhs->last_; h2++ ) + for (TAO_PHandle h1 = 0; h1 < this->last_; ++h1) + for (TAO_PHandle h2 = 0; h2 < rhs->last_; ++h2) if (this->pfiles_[h1]->is_equivalent (rhs->pfiles_[h2])) return 1; @@ -205,10 +205,10 @@ TAO_MProfile::hash (CORBA::ULong max, CORBA::Environment &ACE_TRY_ENV) { CORBA::ULong hashval = 0; - if (last_ == 0) + if (this->last_ == 0) return 0; - for (TAO_PHandle h=0; h < last_ ; h++) + for (TAO_PHandle h = 0; h < this->last_ ; ++h) { hashval += pfiles_[h]->hash (max, ACE_TRY_ENV); ACE_CHECK_RETURN (0); @@ -216,7 +216,7 @@ TAO_MProfile::hash (CORBA::ULong max, CORBA::Environment &ACE_TRY_ENV) // The above hash function return an ULong between 0 and max here we // simply take the average value and round. - return hashval / last_; + return hashval / this->last_; } void diff --git a/TAO/tao/Makefile b/TAO/tao/Makefile index c63a5ab54d2..e89b9c7fbc3 100644 --- a/TAO/tao/Makefile +++ b/TAO/tao/Makefile @@ -219,7 +219,9 @@ ORB_CORE_FILES = \ PolicyFactory_Registry \ Cache_Entries \ Base_Connection_Property \ - Connection_Cache_Manager + Connection_Cache_Manager \ + Cleanup_Func_Registry \ + IORInfo DYNAMIC_ANY_FILES = diff --git a/TAO/tao/Makefile.bor b/TAO/tao/Makefile.bor index e3a0ab0e74a..9a73855fffc 100644 --- a/TAO/tao/Makefile.bor +++ b/TAO/tao/Makefile.bor @@ -25,6 +25,7 @@ OBJFILES = \ $(OBJDIR)\BoundsC.obj \ $(OBJDIR)\Buffering_Constraint_Policy.obj \ $(OBJDIR)\CDR.obj \ + $(OBJDIR)\Cleanup_Func_Registry.obj \ $(OBJDIR)\Client_Priority_Policy.obj \ $(OBJDIR)\Client_Strategy_Factory.obj \ $(OBJDIR)\ClientRequestInfo.obj \ @@ -76,6 +77,7 @@ OBJFILES = \ $(OBJDIR)\IOPC.obj \ $(OBJDIR)\IOPS.obj \ $(OBJDIR)\IOR_Parser.obj \ + $(OBJDIR)\IORInfo.obj \ $(OBJDIR)\Leader_Follower.obj \ $(OBJDIR)\LocalObject.obj \ $(OBJDIR)\Managed_Types.obj \ diff --git a/TAO/tao/Messaging_ORBInitializer.cpp b/TAO/tao/Messaging_ORBInitializer.cpp index 3cd86ef139e..96c27806ec8 100644 --- a/TAO/tao/Messaging_ORBInitializer.cpp +++ b/TAO/tao/Messaging_ORBInitializer.cpp @@ -167,9 +167,6 @@ TAO_Messaging_ORBInitializer::register_policy_factories ( policy_factory.in () TAO_ENV_ARG_PARAMETER); ACE_CHECK; - - /// Transfer ownership of the policy factory to the registry. - (void) policy_factory._retn (); } #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp index f304a2fa95b..b82b5339ad3 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -1233,9 +1233,7 @@ CORBA::ORB_init (int &argc, TAO_ORB_Core_Auto_Ptr safe_oc (oc); - /// #if TAO_HAS_INTERCEPTORS == 1 - - PortableInterceptor::ORBInitInfo_ptr orb_init_info_temp; + TAO_ORBInitInfo *orb_init_info_temp; ACE_NEW_THROW_EX (orb_init_info_temp, TAO_ORBInitInfo (safe_oc.get (), argc, @@ -1247,11 +1245,8 @@ CORBA::ORB_init (int &argc, CORBA::COMPLETED_NO)); ACE_CHECK_RETURN (CORBA::ORB::_nil ()); - // @@ TODO: We need to make sure this reference is no longer valid - // after the ORB is fully initialized. According to the - // portable interceptor spec, we should throw a - // CORBA::OBJECT_NOT_EXIST() exception during subsequent - // attempts to access this instance. + /// This ORBInitInfo instance is only valid for the duration of this + /// ORB's initialization. PortableInterceptor::ORBInitInfo_var orb_init_info = orb_init_info_temp; @@ -1261,7 +1256,6 @@ CORBA::ORB_init (int &argc, TAO_ORBInitializer_Registry::instance ()->pre_init (orb_init_info.in (), ACE_TRY_ENV); ACE_CHECK_RETURN (CORBA::ORB::_nil ()); - ///#endif /* TAO_HAS_INTERCEPTORS == 1 */ // Initialize the ORB Core instance. int result = safe_oc->init (argc, argv, ACE_TRY_ENV); @@ -1276,13 +1270,16 @@ CORBA::ORB_init (int &argc, CORBA::COMPLETED_NO), CORBA::ORB::_nil ()); - ///#if TAO_HAS_INTERCEPTORS == 1 - /// Call the ORBInitializer::post_init() on each registered ORB - /// initializer. + // Call the ORBInitializer::post_init() on each registered ORB + // initializer. TAO_ORBInitializer_Registry::instance ()->post_init (orb_init_info.in (), ACE_TRY_ENV); ACE_CHECK_RETURN (CORBA::ORB::_nil ()); - ///#endif /* TAO_HAS_INTERCEPTORS == 1 */ + + // Invalidate the ORBInitInfo instance to prevent future + // modifications to the ORB. This behavior complies with the + // PortableInterceptor specification. + orb_init_info_temp->orb_core_ = 0; if (TAO_debug_level >= 3) ACE_DEBUG ((LM_DEBUG, diff --git a/TAO/tao/ORBInitInfo.cpp b/TAO/tao/ORBInitInfo.cpp index 37eff5a8b5e..e84493d9737 100644 --- a/TAO/tao/ORBInitInfo.cpp +++ b/TAO/tao/ORBInitInfo.cpp @@ -2,8 +2,9 @@ // // $Id$ -#include "tao/ORBInitInfo.h" -#include "tao/ORB_Core.h" +#include "ORBInitInfo.h" +#include "ORB_Core.h" +#include "StringSeqC.h" ACE_RCSID(tao, ORBInitInfo, "$Id$") @@ -12,34 +13,47 @@ TAO_ORBInitInfo::TAO_ORBInitInfo (TAO_ORB_Core *orb_core, int argc, char *argv[]) : orb_core_ (orb_core), - arguments_ () + argc_ (0), + argv_ (0) { - if (argc > 0) - { - this->arguments_.length (argc); - for (int i = 0; i < argc; ++i) - this->arguments_[i] = CORBA::string_dup (argv[i]); - } } TAO_ORBInitInfo::~TAO_ORBInitInfo (void) { - /// The string sequence automatically calls the destructor on its - /// elements so we do not have to explicitly deallocate the - /// duplicated strings. } CORBA::StringSeq * -TAO_ORBInitInfo::arguments (CORBA::Environment &) +TAO_ORBInitInfo::arguments (CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { - return &(this->arguments_); + // In accordance with the C++ mapping for sequences, it is up to the + // caller to deallocate storage for returned sequences. + + CORBA::StringSeq *args = 0; + ACE_NEW_THROW_EX (args, + CORBA::StringSeq, + CORBA::NO_MEMORY ( + CORBA_SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + ENOMEM), + CORBA::COMPLETED_NO)); + ACE_CHECK_RETURN (0); + + // Copy the argument vector to the string sequence. + + args->length (this->argc_); // Not a problem if argc is zero. + for (int i = 0; i < this->argc_; ++i) + (*args)[i] = CORBA::string_dup (this->argv_[i]); + + return args; } char * TAO_ORBInitInfo::orb_id (CORBA::Environment &) ACE_THROW_SPEC ((CORBA::SystemException)) { + // In accordance with the C++ mapping for strings, return a copy. + return CORBA::string_dup (this->orb_core_->orbid ()); } @@ -81,9 +95,12 @@ TAO_ORBInitInfo::resolve_initial_references ( ACE_THROW_RETURN (PortableInterceptor::ORBInitInfo::InvalidName (), CORBA::Object::_nil ()); - // @@ REMOVE THIS ONCE IMPLEMENTED. - ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), - CORBA::Object::_nil ()); + // The ORB is practically fully initialized by the time this point + // is reached so just use the ORB's resolve_initial_references() + // mechanism. + return + this->orb_core_->orb ()->resolve_initial_references (id, + ACE_TRY_ENV); } void @@ -121,19 +138,24 @@ TAO_ORBInitInfo::add_server_request_interceptor ( void TAO_ORBInitInfo::add_ior_interceptor ( - PortableInterceptor::IORInterceptor_ptr /* interceptor */, + PortableInterceptor::IORInterceptor_ptr interceptor, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException, PortableInterceptor::ORBInitInfo::DuplicateName)) { - ACE_THROW (CORBA::NO_IMPLEMENT ()); + this->orb_core_->add_interceptor (interceptor, + ACE_TRY_ENV); } PortableInterceptor::SlotId TAO_ORBInitInfo::allocate_slot_id (CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { - ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), + ACE_THROW_RETURN (CORBA::NO_IMPLEMENT ( + CORBA_SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + ENOTSUP), + CORBA::COMPLETED_NO), 0); } @@ -151,3 +173,24 @@ TAO_ORBInitInfo::register_policy_factory ( policy_factory, ACE_TRY_ENV); } + +size_t +TAO_ORBInitInfo::allocate_tss_slot_id (ACE_CLEANUP_FUNC cleanup, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + size_t slot_id = 0; + + int result = this->orb_core_->add_tss_cleanup_func (cleanup, + slot_id); + + if (result != 0) + ACE_THROW_RETURN (CORBA::INTERNAL ( + CORBA_SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + errno), + CORBA::COMPLETED_NO), + 0); + + return slot_id; +} diff --git a/TAO/tao/ORBInitInfo.h b/TAO/tao/ORBInitInfo.h index c7903a44c0b..adddb9dbc3d 100644 --- a/TAO/tao/ORBInitInfo.h +++ b/TAO/tao/ORBInitInfo.h @@ -1,34 +1,29 @@ // -*- C++ -*- -// -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO -// -// = FILENAME -// ORBInitInfo.h -// -// = AUTHOR -// Ossama Othman <ossama@uci.edu> -// -// ============================================================================ + +// =================================================================== +/** + * @file ORBInitInfo.h + * + * $Id$ + * + * @author Ossama Othman <ossama@uci.edu> + */ +// =================================================================== #ifndef TAO_ORB_INIT_INFO_H #define TAO_ORB_INIT_INFO_H #include "ace/pre.h" -#include "tao/corbafwd.h" +#include "corbafwd.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/PortableInterceptorC.h" -#include "tao/LocalObject.h" -#include "tao/StringSeqC.h" +#include "PortableInterceptorC.h" +#include "LocalObject.h" +#include "StringSeqC.h" // This is to remove "inherits via dominance" warnings from MSVC. // MSVC is being a little too paranoid. @@ -41,8 +36,15 @@ class TAO_ORB_Core; -/// This class encapsulates the data passed to ORBInitializers during -/// ORB initialization. +/** + * @class TAO_ORBInitInfo + * + * @brief An implementation of the PortableInterceptor::ORBInitInfo + * interface. + * + * This class encapsulates the data passed to ORBInitializers during + * ORB initialization. + */ class TAO_Export TAO_ORBInitInfo : public virtual PortableInterceptor::ORBInitInfo, public virtual TAO_Local_RefCounted_Object @@ -54,17 +56,31 @@ class TAO_Export TAO_ORBInitInfo : public: + /// Destructor ~TAO_ORBInitInfo (void); - ///< Destructor + /** @name PortableInterceptor::ORBInitInfo Methods + * + * These methods are exported by the + * PortableInterceptor::ORBInitInfo interface. + */ + + //@{ + /// Return the argument vector for the ORB currently being + /// initialized as a string sequence. virtual CORBA::StringSeq * arguments ( CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()) ACE_THROW_SPEC ((CORBA::SystemException)); + /// Return the ORBid for the ORB currently being initialized. virtual char * orb_id ( CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()) ACE_THROW_SPEC ((CORBA::SystemException)); + /// Register a mapping between a string and a corresponding object + /// reference with the ORB being initialized. This is particularly + /// useful for registering references to local + /// (locality constrained) objects. virtual void register_initial_reference ( const char * id, CORBA::Object_ptr obj, @@ -72,47 +88,88 @@ public: ACE_THROW_SPEC ((CORBA::SystemException, PortableInterceptor::ORBInitInfo::InvalidName)); + /// Obtain a reference to an object that may not yet be available + /// via the usual CORBA::ORB::resolve_initial_references() mechanism + /// since the ORB may not be fully initialized yet. virtual CORBA::Object_ptr resolve_initial_references ( const char * id, CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()) ACE_THROW_SPEC ((CORBA::SystemException, PortableInterceptor::ORBInitInfo::InvalidName)); + /// Register a client request interceptor with the ORB currently + /// being initialized. virtual void add_client_request_interceptor ( PortableInterceptor::ClientRequestInterceptor_ptr interceptor, CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()) ACE_THROW_SPEC ((CORBA::SystemException, PortableInterceptor::ORBInitInfo::DuplicateName)); + /// Register a server request interceptor with the ORB currently + /// being initialized. virtual void add_server_request_interceptor ( PortableInterceptor::ServerRequestInterceptor_ptr interceptor, CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()) ACE_THROW_SPEC ((CORBA::SystemException, PortableInterceptor::ORBInitInfo::DuplicateName)); + /// Register an IOR interceptor with the ORB currently being + /// initialized. virtual void add_ior_interceptor ( PortableInterceptor::IORInterceptor_ptr interceptor, CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()) ACE_THROW_SPEC ((CORBA::SystemException, PortableInterceptor::ORBInitInfo::DuplicateName)); + /// Reserve a slot in table found within the + /// PortableInterceptor::Current object. virtual PortableInterceptor::SlotId allocate_slot_id ( CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()) ACE_THROW_SPEC ((CORBA::SystemException)); + /// Register a policy factory of the given policy type with the ORB + /// currently being initialized. virtual void register_policy_factory ( CORBA::PolicyType type, PortableInterceptor::PolicyFactory_ptr policy_factory, CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()) ACE_THROW_SPEC ((CORBA::SystemException)); + //@} + + /** @name TAO Extensions + * These methods are not part of the PortableInterceptor + * specification, and are TAO-specific extensions. + */ + + //@{ + /** + * Allocate a slot in the ORB's TSS resources. TAO uses a single + * TSS key for these resources, so it is useful to place TSS objects + * in TAO's TSS resources on platforms where the number of TSS keys + * is low. The returned SlotId can be used to index into the array + * stored in ORB's TSS resources structure. + * + * An accompanying cleanup function (e.g. a TSS destructor) can also + * be registered. + */ + size_t allocate_tss_slot_id ( + ACE_CLEANUP_FUNC cleanup, + CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()) + ACE_THROW_SPEC ((CORBA::SystemException)); + //@} protected: + /// Only allow this class to be instantiated on the heap since it is + /// reference counted. TAO_ORBInitInfo (TAO_ORB_Core *orb_core, int argc, char *argv[]); - ///< Only allow this class to be instantiated on the heap since it - ///< is reference counted. + + /// Check if this ORBInitInfo instance is valid. Once post_init() + /// has been called on each of the ORBInitializers, this ORBInitInfo + /// is no longer valid. Throw an exception in that case. + void check_validity (CORBA::Environment &ACE_TRY_ENV); private: @@ -124,18 +181,16 @@ private: private: + /// Reference to the ORB Core. TAO_ORB_Core *orb_core_; - ///< Reference to the ORB Core. - CORBA::StringSeq arguments_; - ///< A copy of the argument vector (argv) passed to ORB_init() call, - ///< but in the form of a string sequence. + /// The number of arguments in the argument vector passed to + /// CORBA::ORB_init(). + int argc_; + + /// The argument vector passed to CORBA::ORB_init(). + char **argv_; - // IOP_N::CodecFactory_var codec_factory_; - ///< Reference to CodecFactory in the ORB. Normally - ///< ORB::resolve_initial_references("CodecFactory") is used to get - ///< a reference to the CodecFactory, but the ORB has not been - ///< initialized by the time the ORBInitializers are called. }; #if defined(_MSC_VER) && (_MSC_VER >= 1200) diff --git a/TAO/tao/ORBInitializer_Registry.cpp b/TAO/tao/ORBInitializer_Registry.cpp index 8a675c90b5d..b9fabb10875 100644 --- a/TAO/tao/ORBInitializer_Registry.cpp +++ b/TAO/tao/ORBInitializer_Registry.cpp @@ -65,7 +65,7 @@ TAO_ORBInitializer_Registry::register_orb_initializer ( { if (!CORBA::is_nil (init)) { - /// Increase the length of the ORBInitializer array by one. + // Increase the length of the ORBInitializer array by one. size_t cur_len = this->initializers_.size (); size_t new_len = cur_len + 1; if (this->initializers_.size (new_len) != 0) @@ -74,7 +74,7 @@ TAO_ORBInitializer_Registry::register_orb_initializer ( // @@ Do we need to duplicate the reference to the // ORBInitializer? - /// Add the given ORBInitializer to the sequence. + // Add the given ORBInitializer to the sequence. this->initializers_[cur_len] = PortableInterceptor::ORBInitializer::_duplicate (init); } diff --git a/TAO/tao/ORBInitializer_Registry.h b/TAO/tao/ORBInitializer_Registry.h index c1ddbda2ff3..01adff92185 100644 --- a/TAO/tao/ORBInitializer_Registry.h +++ b/TAO/tao/ORBInitializer_Registry.h @@ -1,37 +1,36 @@ // -*- C++ -*- -// -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO -// -// = FILENAME -// ORBInitializer_Registry.h -// -// = AUTHOR -// Ossama Othman <ossama@uci.edu> -// -// ============================================================================ + +// =================================================================== +/** + * @file ORBInitializer_Registry.h + * + * $Id$ + * + * @author Ossama Othman <ossama@uci.edu> + */ +// =================================================================== #ifndef TAO_ORB_INITIALIZER_REGISTRY_H #define TAO_ORB_INITIALIZER_REGISTRY_H #include "ace/pre.h" -#include "tao/TAO_Export.h" +#include "TAO_Export.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "PortableInterceptorC.h" -#include "tao/TAO_Singleton.h" +#include "TAO_Singleton.h" #include "ace/Containers_T.h" -/// Global list that contains all portable interceptor ORB -/// initializers. +/** + * @class TAO_ORBInitializer_Registry + * + * @brief Global list that contains all portable interceptor ORB + * initializers. + */ class TAO_Export TAO_ORBInitializer_Registry { friend class TAO_Singleton<TAO_ORBInitializer_Registry, ACE_SYNCH_MUTEX>; @@ -45,31 +44,31 @@ class TAO_Export TAO_ORBInitializer_Registry protected: + /// Only allow this class to be instantiated as a singleton + /// instance, so declare the constructor as protected. TAO_ORBInitializer_Registry (void); - ///< Only allow this class to be instantiated as a singleton - ///< instance, so declare the constructor as protected. + /// Destructor. Releases duplicated ORBInitializer references. ~TAO_ORBInitializer_Registry (void); - ///< Destructor. Releases duplicated ORBInitializer references. + ///< Register an ORBInitializer with the underlying ORBInitializer + ///< array. void register_orb_initializer ( PortableInterceptor::ORBInitializer_ptr init, CORBA::Environment &ACE_TRY_ENV); - ///< Register an ORBInitializer with the underlying ORBInitializer - ///< sequence. + /// Begin initialization of all registered ORBInitializers before + /// the ORB itself is initialized. void pre_init (PortableInterceptor::ORBInitInfo_ptr info, CORBA::Environment &ACE_TRY_ENV); - ///< Begin initialization of all registered ORBInitializers before - ///< the ORB itself is initialized. + /// Complete initialization of all registered ORBInitializers after + /// the ORB has been initialized. void post_init (PortableInterceptor::ORBInitInfo_ptr info, CORBA::Environment &ACE_TRY_ENV); - ///< Complete initialization of all registered ORBInitializers after - ///< the ORB has been initialized. + /// Return a unique singleton instance. static TAO_ORBInitializer_Registry *instance (void); - // Return a unique instance private: @@ -80,8 +79,8 @@ private: private: + /// Dynamic array containing registered ORBInitializers. ACE_Array_Base<PortableInterceptor::ORBInitializer_ptr> initializers_; - ///< Dynamic array containing registered ORBInitializers. }; diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index 86b0246ce18..dbd790fbc44 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -1,60 +1,60 @@ // $Id$ -#include "tao/ORB_Core.h" -#include "tao/ORB_Table.h" +#include "ORB_Core.h" +#include "ORB_Table.h" #include "ace/Env_Value_T.h" #include "ace/Arg_Shifter.h" #include "ace/Auto_Ptr.h" -#include "tao/TAO_Internal.h" -#include "tao/default_client.h" -#include "tao/default_server.h" -#include "tao/default_resource.h" -#include "tao/debug.h" -#include "tao/MProfile.h" -#include "tao/Stub.h" -#include "tao/Reactor_Registry.h" -#include "tao/Leader_Follower.h" +#include "TAO_Internal.h" +#include "default_client.h" +#include "default_server.h" +#include "default_resource.h" +#include "debug.h" +#include "MProfile.h" +#include "Stub.h" +#include "Reactor_Registry.h" +#include "Leader_Follower.h" -#include "tao/Connector_Registry.h" -#include "tao/Acceptor_Registry.h" +#include "Connector_Registry.h" +#include "Acceptor_Registry.h" -#include "tao/RT_ORB.h" -#include "tao/Priority_Mapping_Manager.h" -#include "tao/RT_Current.h" -#include "tao/RT_Policy_i.h" +#include "RT_ORB.h" +#include "Priority_Mapping_Manager.h" +#include "RT_Current.h" +#include "RT_Policy_i.h" -#include "tao/Sync_Strategies.h" +#include "Sync_Strategies.h" -#include "tao/Object_Loader.h" +#include "Object_Loader.h" -#include "tao/ObjectIDList.h" +#include "ObjectIDList.h" #include "ace/Object_Manager.h" #include "ace/Env_Value_T.h" #include "ace/Dynamic_Service.h" #include "ace/Arg_Shifter.h" -#include "tao/Services_Activate.h" -#include "tao/Invocation.h" +#include "Services_Activate.h" +#include "Invocation.h" -#include "tao/Invocation_Endpoint_Selectors.h" +#include "Invocation_Endpoint_Selectors.h" + +#include "IORInfo.h" #if defined(ACE_MVS) #include "ace/Codeset_IBM1047.h" #endif /* ACE_MVS */ #if !defined (__ACE_INLINE__) -# include "tao/ORB_Core.i" +# include "ORB_Core.i" #endif /* ! __ACE_INLINE__ */ - ACE_RCSID(tao, ORB_Core, "$Id$") +// **************************************************************** - // **************************************************************** - - CORBA::Environment & +CORBA::Environment & TAO_default_environment () { return *TAO_TSS_RESOURCES::instance ()->default_environment_; @@ -111,6 +111,7 @@ TAO_ORB_Core::TAO_ORB_Core (const char *orbid) to_iso8859_ (0), from_unicode_ (0), to_unicode_ (0), + tss_cleanup_funcs_ (), use_tss_resources_ (0), tss_resources_ (), orb_resources_ (), @@ -150,6 +151,7 @@ TAO_ORB_Core::TAO_ORB_Core (const char *orbid) client_request_interceptors_ (), server_request_interceptors_ (), #endif /* TAO_HAS_INTERCEPTORS == 1 */ + ior_interceptors_ (), parser_registry_ (), connection_cache_ () { @@ -1479,7 +1481,7 @@ TAO_ORB_Core::server_factory (void) int TAO_ORB_Core::inherit_from_parent_thread ( - TAO_ORB_Core_TSS_Resources *tss_resources) + TAO_ORB_Core_TSS_Resources *tss_resources) { // Inherit properties/objects used in ORB_Core from the // parent thread. Stuff inherited here must already exist @@ -1600,11 +1602,6 @@ TAO_ORB_Core::create_stub_object (const TAO_ObjectKey &key, (void) this->open (ACE_TRY_ENV); ACE_CHECK_RETURN (0); - CORBA::String_var id; - - if (type_id) - id = CORBA::string_dup (type_id); - TAO_Stub *stub = 0; // Create a profile container and have Acceptor_Registry populate it @@ -1613,9 +1610,10 @@ TAO_ORB_Core::create_stub_object (const TAO_ObjectKey &key, if (this->acceptor_registry ()->make_mprofile (key, mp, filter) == -1) { ACE_THROW_RETURN (CORBA::INTERNAL ( - CORBA::SystemException::_tao_minor_code ( - TAO_MPROFILE_CREATION_ERROR, 0 ), - CORBA::COMPLETED_NO ), + CORBA::SystemException::_tao_minor_code ( + TAO_MPROFILE_CREATION_ERROR, + 0), + CORBA::COMPLETED_NO), 0); } @@ -1625,9 +1623,10 @@ TAO_ORB_Core::create_stub_object (const TAO_ObjectKey &key, if (mp.profile_count () == 0) { ACE_THROW_RETURN (CORBA::BAD_PARAM ( - CORBA::SystemException::_tao_minor_code ( - TAO_MPROFILE_CREATION_ERROR, 0 ), - CORBA::COMPLETED_NO ), + CORBA::SystemException::_tao_minor_code ( + TAO_MPROFILE_CREATION_ERROR, + 0 ), + CORBA::COMPLETED_NO), 0); } @@ -1653,8 +1652,15 @@ TAO_ORB_Core::create_stub_object (const TAO_ObjectKey &key, } } + // Iterate over the registered IOR interceptors so that they may be + // given the opportunity to add tagged components to the profiles + // for this servant. + this->establish_components (mp, policy_list, ACE_TRY_ENV); + ACE_CHECK_RETURN (0); + + // Done creating profiles. Initialize a TAO_Stub object with them. ACE_NEW_THROW_EX (stub, - TAO_Stub (id._retn (), mp, this), + TAO_Stub (type_id, mp, this), CORBA::NO_MEMORY (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_MAYBE)); ACE_CHECK_RETURN (stub); @@ -1664,6 +1670,42 @@ TAO_ORB_Core::create_stub_object (const TAO_ObjectKey &key, return stub; } +void +TAO_ORB_Core::establish_components (TAO_MProfile &mp, + CORBA::PolicyList *policy_list, + CORBA::Environment &ACE_TRY_ENV) +{ + // Iterate over the registered IOR interceptors so that they may be + // given the opportunity to add tagged components to the profiles + // for this servant. + TAO_IORInterceptor_List::TYPE &interceptors = + this->ior_interceptors (); + + size_t interceptor_count = interceptors.size (); + if (interceptor_count == 0) + return; + + PortableInterceptor::IORInfo_ptr info_temp; + ACE_NEW_THROW_EX (info_temp, + TAO_IORInfo (this, mp, policy_list), + CORBA::NO_MEMORY ( + CORBA_SystemException::_tao_minor_code ( + TAO_MPROFILE_CREATION_ERROR, + ENOMEM), + CORBA::COMPLETED_NO)); + ACE_CHECK; + + PortableInterceptor::IORInfo_var info = info_temp; + + for (size_t i = 0; i < interceptor_count; ++i) + { + interceptors[i]->establish_components ( + info.in () + TAO_ENV_ARG_PARAMETER); + ACE_CHECK; + } +} + CORBA::Object_ptr TAO_ORB_Core::create_object (TAO_Stub *stub) { @@ -2720,17 +2762,19 @@ TAO_ORB_Core::server_protocol (void) // **************************************************************** TAO_ORB_Core_TSS_Resources::TAO_ORB_Core_TSS_Resources (void) - : output_cdr_dblock_allocator_ (0), - output_cdr_buffer_allocator_ (0), - output_cdr_msgblock_allocator_ (0), - input_cdr_dblock_allocator_ (0), - input_cdr_buffer_allocator_ (0), - connection_cache_ (0), - event_loop_thread_ (0), - client_leader_thread_ (0), - leader_follower_condition_variable_ (0), - reactor_registry_ (0), - reactor_registry_cookie_ (0) + : output_cdr_dblock_allocator_ (0), + output_cdr_buffer_allocator_ (0), + output_cdr_msgblock_allocator_ (0), + input_cdr_dblock_allocator_ (0), + input_cdr_buffer_allocator_ (0), + connection_cache_ (0), + event_loop_thread_ (0), + client_leader_thread_ (0), + leader_follower_condition_variable_ (0), + reactor_registry_ (0), + reactor_registry_cookie_ (0), + ts_objects_ (), + orb_core_ (0) { } @@ -2763,7 +2807,11 @@ TAO_ORB_Core_TSS_Resources::~TAO_ORB_Core_TSS_Resources (void) this->leader_follower_condition_variable_ = 0; if (this->reactor_registry_ != 0) - this->reactor_registry_->destroy_tss_cookie (this->reactor_registry_cookie_); + this->reactor_registry_->destroy_tss_cookie ( + this->reactor_registry_cookie_); + + if (this->orb_core_ != 0) + this->orb_core_->tss_cleanup_funcs ()->cleanup (this->ts_objects_); } // **************************************************************** diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h index cd58cf25b8f..215e889112c 100644 --- a/TAO/tao/ORB_Core.h +++ b/TAO/tao/ORB_Core.h @@ -1,50 +1,46 @@ -// This may look like C, but it's really -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO -// -// = FILENAME -// ORB_Core.h -// -// = AUTHOR -// Chris Cleeland -// -// ============================================================================ +// -*- C++ -*- + +// =================================================================== +/** + * @file ORB_Core.h + * + * $Id$ + * + * @author DOC Center, Washington University, St. Louis + * @author DOC Laboratory, University of California at Irvine + */ +// =================================================================== #ifndef TAO_ORB_CORE_H #define TAO_ORB_CORE_H #include "ace/pre.h" -#include "tao/corbafwd.h" +#include "corbafwd.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/ORB.h" -#include "tao/Environment.h" -#include "tao/Policy_Manager.h" -#include "tao/Resource_Factory.h" -#include "tao/params.h" -#include "tao/TAO_Singleton_Manager.h" -#include "tao/TAO_Singleton.h" -#include "tao/Adapter.h" -#include "tao/PolicyFactory_Registry.h" -#include "tao/Parser_Registry.h" -#include "tao/Service_Callbacks.h" -#include "tao/Fault_Tolerance_Service.h" +#include "ORB.h" +#include "Environment.h" +#include "Policy_Manager.h" +#include "Resource_Factory.h" +#include "params.h" +#include "TAO_Singleton_Manager.h" +#include "TAO_Singleton.h" +#include "Adapter.h" +#include "PolicyFactory_Registry.h" +#include "Parser_Registry.h" +#include "Service_Callbacks.h" +#include "Fault_Tolerance_Service.h" +#include "Connection_Cache_Manager.h" +#include "Cleanup_Func_Registry.h" -#if (TAO_HAS_INTERCEPTORS == 1) // Interceptor definitions. -# include "tao/PortableInterceptorC.h" -# include "tao/Interceptor_List.h" -#endif /* TAO_HAS_INTERCEPTORS */ - -#include "tao/Connection_Cache_Manager.h" +#include "PortableInterceptorC.h" +#include "Interceptor_List.h" +#include "ace/Hash_Map_Manager.h" // Forward declarations class TAO_Acceptor; @@ -92,83 +88,102 @@ class TAO_Sync_Strategy; // **************************************************************** +/** + * @class TAO_ORB_Core_TSS_Resources + * + * @brief The TSS resoures of an ORB core. + * + * This class is used by the ORB_Core to store the resources + * potentially bound to a thread in TSS storage. The members are public + * because only the ORB Core is expected to access them. + */ class TAO_Export TAO_ORB_Core_TSS_Resources { - // = TITLE - // The TSS resoures of an ORB core. - // - // = DESCRIPTION - // This class is used by the ORB_Core to store the resources - // potentially bound to a thread in TSS storage. - // The members are public because only the ORB Core is expected to - // access them. - // public: + + /// onstructor TAO_ORB_Core_TSS_Resources (void); - // constructor + /// destructor ~TAO_ORB_Core_TSS_Resources (void); - // destructor private: - // The ORB Core TSS resources should not be copied + + /// The ORB Core TSS resources should not be copied ACE_UNIMPLEMENTED_FUNC (TAO_ORB_Core_TSS_Resources (const TAO_ORB_Core_TSS_Resources&)) ACE_UNIMPLEMENTED_FUNC (void operator= (const TAO_ORB_Core_TSS_Resources&)) public: - // = The rest of the resources are not currently in use, just a plan - // for the future... - + /** + * @todo + * The rest of the resources are not currently in use, just a plan + * for the future... + */ + + /// The allocators for the output CDR streams. + //@{ ACE_Allocator *output_cdr_dblock_allocator_; ACE_Allocator *output_cdr_buffer_allocator_; ACE_Allocator *output_cdr_msgblock_allocator_; - // The allocators for the output CDR streams. + //@} + /// The allocators for the input CDR streams. + //@{ ACE_Allocator *input_cdr_dblock_allocator_; ACE_Allocator *input_cdr_buffer_allocator_; - // The allocators for the input CDR streams. + //@} + /// This is is just a place holder, in the future the connection + /// cache will be separated from the connectors and it will be a + /// (potentially) TSS object. TAO_Connection_Cache *connection_cache_; - // This is is just a place holder, in the future the connection - // cache will be separated from the connectors and it will be a - // (potentially) TSS object. + /// Counter for how (nested) calls this thread has made to run the + /// event loop. int event_loop_thread_; - // Counter for how (nested) calls this thread has made to run the - // event loop. + /// Counter for how many times this thread has become a client + /// leader. int client_leader_thread_; - // Counter for how many times this thread has become a client - // leader. + /// Condition variable for the leader follower model. ACE_SYNCH_CONDITION* leader_follower_condition_variable_; - // Condition variable for the leader follower model. + /// The Reactor Holder that we should callback when destroying the + /// cookie. TAO_Reactor_Registry *reactor_registry_; - // The Reactor Holder that we should callback when destroying the - // cookie. + /// A TSS magic cookie used by the Reactor_Registry void *reactor_registry_cookie_; - // A TSS magic cookie used by the Reactor_Registry + + /// Generic container for thread-specific objects. + ACE_Array_Base<void *> ts_objects_; + + /// Pointer to the ORB core. Needed to get access to the TSS + /// cleanup functions for the TSS objects stored in the TSS object + /// array in this class. + TAO_ORB_Core *orb_core_; }; // **************************************************************** +/** + * @class TAO_ORB_Core + * + * @brief Encapsulates the state of an ORB. + * + * This is the implementation class for the CORBA::ORB interface. The + * class also encapsulates the access to the ORB resources and its + * state. + * @par + * Some resources can be TSS or global, those resources are always + * accessed through a TSS interface, but are allocated using the + * Resource_Factory. If the resource is really global the + * Resource_Factory will simply return a pointer to the global + * instance. + */ class TAO_Export TAO_ORB_Core { - // = TITLE - // Encapsulates the state of an ORB. - // - // = DESCRIPTION - // This is the implementation class for the CORBA::ORB interface. - // The class also encapsulates the access to the ORB resources and - // its state. - // Some resources can be TSS or global, those resources are always - // accessed through a TSS interface, but are allocated using the - // Resource_Factory. If the resource is really global the - // Resource_Factory will simply return a pointer to the global - // instance. - // friend class TAO_ORB_Core_Auto_Ptr; friend class TAO_ORB_Table; friend CORBA::ORB_ptr CORBA::ORB_init (int &, @@ -177,57 +192,63 @@ class TAO_Export TAO_ORB_Core CORBA_Environment &); public: - // = Initialization and termination methods. + + /// Constructor. TAO_ORB_Core (const char* id); - // Constructor. + /// Accessor for the ORB parameters. TAO_ORB_Parameters *orb_params (void); - // Accessor for the ORB parameters. - - // @@ In the future this hook should change, instead of hardcoding - // the object we should add a "Resolver" to the ORB, so the - // "POACurrent" object returns a per-ORB object. - // Similarly, each ORB should implement the TSS pattern to put - // the POA_Current_Impl in a void* slot. - // The current approach *does* decouple the POA from the ORB, but - // it cannot add new adapters or other components transparently. - CORBA::Object_ptr poa_current (void); - void poa_current (CORBA::Object_ptr poa_current); - // Accessor to the POA current. - - // = Get the connector registry + + /** + * @todo + * In the future this hook should change, instead of hardcoding the + * object we should add a "Resolver" to the ORB, so the "POACurrent" + * object returns a per-ORB object. + * @par + * Similarly, each ORB should implement the TSS pattern to put the + * POA_Current_Impl in a void* slot. The current approach *does* + * decouple the POA from the ORB, but it cannot add new adapters or + * other components transparently. + */ + /// Accessor to the POA current. + CORBA::Object_ptr poa_current(void); + void poa_current (CORBA::Object_ptr poa_current); + + ///Get the connector registry TAO_Connector_Registry *connector_registry (void); - // = Get the acceptor registry + ///Get the acceptor registry TAO_Acceptor_Registry *acceptor_registry (void); - // = Get the IOR parser registry + ///Get the IOR parser registry TAO_Parser_Registry *parser_registry (void); + /// Return pointer to the policy factory registry associated with + /// this ORB core. TAO_PolicyFactory_Registry *policy_factory_registry (void); - ///< Return pointer to the policy factory registry associated with - ///< this ORB core. - // = Get the protocol factories + /// Get the protocol factories TAO_ProtocolFactorySet *protocol_factories (void); - // = Get pointer to the ORB. + /// Get pointer to the ORB. CORBA::ORB_ptr orb (void); + /// Wrappers that forward the request to the concurrency strategy. ACE_Reactor *reactor (void); ACE_Reactor *reactor (TAO_Acceptor *acceptor); - // Wrappers that forward the request to the concurrency strategy - // = Get the ACE_Thread_Manager + /// Get the ACE_Thread_Manager ACE_Thread_Manager *thr_mgr (void); + /// Return the RootPOA, or try to load it if not initialized already. CORBA::Object_ptr root_poa (CORBA::Environment &ACE_TRY_ENV); - // Return the RootPOA, or try to load it if not initialized already. + /// Get the adapter registry TAO_Adapter_Registry *adapter_registry (void); - // Get the adapter registry - // = Collocation strategies. + + /// @name Collocation Strategies + //@{ enum { ORB_CONTROL, // Indicate object should refer to ORB for either @@ -252,49 +273,65 @@ public: // of collocation strategies. }; - static TAO_Collocation_Strategies collocation_strategy (CORBA::Object_ptr object); - // This methods give the right collocation strategy, if any, - // to be used to perform a method invokation on the given object. - // (Note that No-Collocation is a special case of collocation). - - - // = Get the default codeset translators. - // In most configurations these are just <nil> objects, but they - // can be set to something different if the native character sets - // are not ISO8869 (aka Latin/1, UTF-8) and UNICODE (aka UTF-16). - + /** + * This methods give the right collocation strategy, if any, + * to be used to perform a method invokation on the given object. + * + * @note + * No-Collocation is a special case of collocation. + */ + static TAO_Collocation_Strategies collocation_strategy ( + CORBA::Object_ptr object); + //@} + + /** + * @name Default Code Set Translators + * + * Get the default codeset translators. + * + * @par + * In most configurations these are just <nil> objects, but they can + * be set to something different if the native character sets are + * not ISO8869 (aka Latin/1, UTF-8) and UNICODE (aka UTF-16). + */ + //@{ + /// Convert from ISO8859 to the native character set ACE_Char_Codeset_Translator *from_iso8859 (void) const; - // Convert from ISO8859 to the native character set + /// Convert from the native character set to ISO8859 ACE_Char_Codeset_Translator *to_iso8859 (void) const; - // Convert from the native character set to ISO8859 + /// Convert from UNICODE to the native wide character set ACE_WChar_Codeset_Translator *from_unicode (void) const; - // Convert from UNICODE to the native wide character set + /// Convert from the native wide character set to UNICODE ACE_WChar_Codeset_Translator *to_unicode (void) const; - // Convert from the native wide character set to UNICODE - - // @@ This is just note on how could the translator database be - // implemented: use the service configurator to load the - // translator, and then use the CodesetId (an unsigned long) to - // translate the character set code into the Service Object - // name. - // The default resource factory could parse command line options - // like: - // -ORBcharcodeset 0x00010001=ISO8859 - // -ORBcharcodeset 0x10020417=IBM1047 - // -ORBwcharcodeset 0x00010106=ISOIEC10646 - // that would let the user experiment with different translators - // and plug them in on demand. - // - // We should also think about how translators will report - // conversion failures and how to simplify the implementation of - // char translators (it would seem like just a couple of arrays - // are needed, maybe the arrays should be dynamically loaded and - // the implementation would remain constant? Just a thought - // = Set/get the collocation flags + /** + * @note + * This is just note on how could the translator database be + * implemented: use the service configurator to load the translator, + * and then use the CodesetId (an unsigned long) to translate the + * character set code into the Service Object name. + * @par + * The default resource factory could parse command line options + * like: + * - -ORBcharcodeset 0x00010001=ISO8859 + * - -ORBcharcodeset 0x10020417=IBM1047 + * - -ORBwcharcodeset 0x00010106=ISOIEC10646 + * that would let the user experiment with different translators + * and plug them in on demand. + *@par + * + * We should also think about how translators will report conversion + * failures and how to simplify the implementation of char + * translators (it would seem like just a couple of arrays are + * needed, maybe the arrays should be dynamically loaded and the + * implementation would remain constant? Just a thought. + */ + //@} + + /// Set/get the collocation flags void optimize_collocation_objects (CORBA::Boolean opt); CORBA::Boolean optimize_collocation_objects (void) const; @@ -303,34 +340,37 @@ public: CORBA::ULong get_collocation_strategy (void) const; + /// Get the adapter named "RootPOA" and cache the result, this is an + /// optimization for the POA. TAO_Adapter *poa_adapter (void); - // Get the adapter named "RootPOA" and cache the result, this is an - // optimization for the POA. + /// A spawned thread needs to inherit some properties/objects from + /// the spawning thread in order to serve requests. Return 0 if + /// it successfully inherits from the parent, -1 otherwise. int inherit_from_parent_thread (TAO_ORB_Core_TSS_Resources *tss_resources); - // A spawned thread needs to inherit some properties/objects from - // the spawning thread in order to serve requests. Return 0 if - // it successfully inherits from the parent, -1 otherwise. - - // = Access to Factories. - // - // These factories are not thread-specific, and are presented here - // in order to have one place to get useful information. Often, the - // instances to which the return pointers are stored in the Service - // Repository. + /** + * @name Access to Factories + * + * These factories are not thread-specific, and are presented here + * in order to have one place to get useful information. Often, the + * instances to which the return pointers are stored in the Service + * Repository. + */ + //@{ + /// Returns pointer to the resource factory. TAO_Resource_Factory *resource_factory (void); - // Returns pointer to the resource factory. + /// Returns pointer to the client factory. TAO_Client_Strategy_Factory *client_factory (void); - // Returns pointer to the client factory. + /// Returns pointer to the server factory. TAO_Server_Strategy_Factory *server_factory (void); - // Returns pointer to the server factory. + //@} + /// See if we have a collocated address, if yes, return the POA + /// associated with the address. int is_collocated (const TAO_MProfile& mprofile); - // See if we have a collocated address, if yes, return the POA - // associated with the address. ACE_Allocator *output_cdr_dblock_allocator (void); // This allocator is always TSS and has no locks. It is intended for @@ -417,8 +457,9 @@ public: #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ - CORBA::Policy *default_relative_roundtrip_timeout (void) const; +#if (TAO_HAS_RELATIVE_ROUNDTRIP_TIMEOUT_POLICY == 1) + CORBA::Policy *default_relative_roundtrip_timeout (void) const; CORBA::Policy *stubless_relative_roundtrip_timeout (void); // Access to the RoundtripTimeoutPolicy policy set on the thread or // on the ORB. In this method, we do not consider the stub since we @@ -438,6 +479,8 @@ public: static Timeout_Hook timeout_hook_; // The hook to be set for the RelativeRoundtripTimeoutPolicy +#endif /* TAO_HAS_RELATIVE_ROUNDTRIP_TIMEOUT_POLICY == 1 */ + #if (TAO_HAS_CLIENT_PRIORITY_POLICY == 1) TAO_Client_Priority_Policy *default_client_priority (void) const; @@ -449,12 +492,9 @@ public: void call_sync_scope_hook (TAO_Stub *stub, int &has_synchronization, int &scope); - TAO_Sync_Strategy &get_sync_strategy (TAO_Stub *stub, int &scope); - typedef void (*Sync_Scope_Hook) (TAO_ORB_Core *, TAO_Stub *, int&, int&); - static void set_sync_scope_hook (Sync_Scope_Hook hook); void stubless_sync_scope (CORBA::Policy *&result); @@ -528,6 +568,22 @@ public: TAO_ORB_Core_TSS_Resources* get_tss_resources (void); // Obtain the TSS resources of this orb. + /// Obtain the TSS resource in the given slot. + void* get_tss_resource (size_t slot_id); + + /// Set the TSS resource at the given slot. + /// Returns 0 on success, and -1 on failure. + int set_tss_resource (size_t slot_id, void *); + + /// Register a TSS cleanup function. The slot ID for the + /// corresponding ORB core TSS resource is returned by the reference + /// argument. This method return 0 on success, and -1 on failure. + int add_tss_cleanup_func (ACE_CLEANUP_FUNC cleanup, + size_t &slot_id); + + /// Return the underlying TSS cleanup function registry. + TAO_Cleanup_Func_Registry *tss_cleanup_funcs (void); + TAO_Leader_Follower &leader_follower (void); // Get access to the leader_follower class. @@ -566,6 +622,12 @@ public: // Makes sure that the ORB is open and then creates a TAO_Stub // based on the endpoint. + void establish_components (TAO_MProfile &mp, + CORBA::PolicyList *policy_list, + CORBA::Environment &ACE_TRY_ENV); + ///< Give each registered IOR interceptor the opportunity to add + ///< tagged components to profiles of each created servant. + CORBA::Object_ptr create_object (TAO_Stub *the_stub); // Create a new object, use the adapter registry to create a // collocated object, if not possible then create a regular object. @@ -615,6 +677,8 @@ public: // Core. These hooks would be used to call back on the services or // other features that are dynamically loaded. + + CORBA::Boolean service_profile_selection (TAO_MProfile &mprofile, TAO_Profile *&profile); // The loaded service in the ORB_Core would determine if the profile @@ -698,6 +762,14 @@ public: #endif /* TAO_HAS_INTERCEPTORS */ + /// Register an IOR interceptor. + void add_interceptor ( + PortableInterceptor::IORInterceptor_ptr interceptor, + CORBA_Environment &ACE_TRY_ENV); + + /// Return the array of IOR interceptors specific to this ORB. + TAO_IORInterceptor_List::TYPE & ior_interceptors (void); + int open (CORBA::Environment &ACE_TRY_ENV); // Set up the ORB Core's acceptor to listen on the // previously-specified port for requests. Returns -1 on failure, @@ -896,6 +968,10 @@ protected: ACE_WChar_Codeset_Translator *to_unicode_; // Codeset translators for simple implementations. + /// TSS Object cleanup functions. These correspond to the TSS + /// objects stored in TAO's TSS resources. + TAO_Cleanup_Func_Registry tss_cleanup_funcs_; + int use_tss_resources_; // If 1 then this ORB uses thread-specific resources @@ -991,16 +1067,19 @@ protected: ///< Registry containing all registered policy factories. #if (TAO_HAS_INTERCEPTORS == 1) + /// Request interceptor registries. TAO_ClientRequestInterceptor_List client_request_interceptors_; TAO_ServerRequestInterceptor_List server_request_interceptors_; - ///< Interceptor registries. #endif /* TAO_HAS_INTERCEPTORS */ + /// IOR interceptor registry. + TAO_IORInterceptor_List ior_interceptors_; + TAO_Parser_Registry parser_registry_; - // The IOR parser registry + // The IOR parser registry. TAO_Connection_Cache_Manager connection_cache_; - // The connection cache for TAO + // TAO's connection cache. }; // **************************************************************** @@ -1094,7 +1173,7 @@ typedef TAO_TSS_Singleton<TAO_TSS_Resources, ACE_SYNCH_MUTEX> TAO_Export TAO_ORB_Core *TAO_ORB_Core_instance (void); #if defined (__ACE_INLINE__) -# include "tao/ORB_Core.i" +# include "ORB_Core.i" #endif /* __ACE_INLINE__ */ #include "ace/post.h" diff --git a/TAO/tao/ORB_Core.i b/TAO/tao/ORB_Core.i index b4583f371f8..aa11501186e 100644 --- a/TAO/tao/ORB_Core.i +++ b/TAO/tao/ORB_Core.i @@ -355,6 +355,64 @@ TAO_ORB_Core::get_tss_resources (void) return ACE_TSS_GET (&this->tss_resources_,TAO_ORB_Core_TSS_Resources); } +ACE_INLINE void * +TAO_ORB_Core::get_tss_resource (size_t slot_id) +{ + TAO_ORB_Core_TSS_Resources *tss_resources = + this->get_tss_resources (); + + if (slot_id >= tss_resources->ts_objects_.size ()) + return 0; + + return tss_resources->ts_objects_[slot_id]; +} + +ACE_INLINE int +TAO_ORB_Core::set_tss_resource (size_t slot_id, void *ts_object) +{ + TAO_ORB_Core_TSS_Resources *tss_resources = + this->get_tss_resources (); + + // The number of allocated slots is equal to the number of + // registered TSS cleanup functions, *not* the size of the array in + // the ORB core TSS resources. + if (slot_id >= this->tss_cleanup_funcs_.size ()) + { + errno = EINVAL; + return -1; + } + + // If the TSS array isn't large enough, then increase its size. + // We're guaranteed not to exceed the number of allocated slots by + // the above check. + if (slot_id >= tss_resources->ts_objects_.size () + && tss_resources->ts_objects_.size (slot_id + 1) != 0) + return -1; + + tss_resources->ts_objects_[slot_id] = ts_object; + + // Make sure the ORB core pointer is set in the ORB core's TSS + // resources so that the TSS cleanup functions stored in the ORB + // core can be invoked. + tss_resources->orb_core_ = this; + + return 0; +} + +ACE_INLINE int +TAO_ORB_Core::add_tss_cleanup_func (ACE_CLEANUP_FUNC cleanup, + size_t &slot_id) +{ + return this->tss_cleanup_funcs_.register_cleanup_function (cleanup, + slot_id); +} + +TAO_Cleanup_Func_Registry * +TAO_ORB_Core::tss_cleanup_funcs (void) +{ + return &(this->tss_cleanup_funcs_); +} + ACE_INLINE int TAO_ORB_Core::has_shutdown (void) { @@ -603,17 +661,39 @@ TAO_ORB_Core::add_interceptor ( ACE_TRY_ENV); } +ACE_INLINE void +TAO_ORB_Core::add_interceptor ( + PortableInterceptor::IORInterceptor_ptr interceptor, + CORBA_Environment &ACE_TRY_ENV) +{ + this->ior_interceptors_.add_interceptor (interceptor, + ACE_TRY_ENV); +} + +// ------ + ACE_INLINE TAO_ClientRequestInterceptor_List::TYPE & TAO_ORB_Core::client_request_interceptors (void) { return this->client_request_interceptors_.interceptors (); } +// @@ It would be nice to move these to the PortableServer library, +// perhaps to the RootPOA. However, there is no "RootPOA" class so +// there doesn't appear to be a way that only the RootPOA +// implementation has these server-side interceptor methods and +// attributes. Leave them in the ORB Core for now. ACE_INLINE TAO_ServerRequestInterceptor_List::TYPE & TAO_ORB_Core::server_request_interceptors (void) { return this->server_request_interceptors_.interceptors (); } + +ACE_INLINE TAO_IORInterceptor_List::TYPE & +TAO_ORB_Core::ior_interceptors (void) +{ + return this->ior_interceptors_.interceptors (); +} #endif /* TAO_HAS_INTERCEPTORS */ diff --git a/TAO/tao/Object.cpp b/TAO/tao/Object.cpp index 4aebad0cd03..c096cd52a49 100644 --- a/TAO/tao/Object.cpp +++ b/TAO/tao/Object.cpp @@ -634,7 +634,7 @@ operator>> (TAO_InputCDR& cdr, CORBA_Object*& x) // Ownership of type_hint is given to TAO_Stub // TAO_Stub will make a copy of mp! TAO_Stub *objdata = 0; - ACE_NEW_RETURN (objdata, TAO_Stub (type_hint._retn (), + ACE_NEW_RETURN (objdata, TAO_Stub (type_hint.in (), mp, orb_core), 0); diff --git a/TAO/tao/PolicyFactory_Registry.cpp b/TAO/tao/PolicyFactory_Registry.cpp index 9b9295ffdb3..eb9a343e891 100644 --- a/TAO/tao/PolicyFactory_Registry.cpp +++ b/TAO/tao/PolicyFactory_Registry.cpp @@ -2,8 +2,7 @@ // // $Id$ -#include "tao/PolicyFactory_Registry.h" -#include "tao/corbafwd.h" +#include "PolicyFactory_Registry.h" ACE_RCSID(tao, PolicyFactory_Registry, "$Id$") @@ -42,15 +41,18 @@ TAO_PolicyFactory_Registry::register_policy_factory ( if (result == 1) { - /// PolicyFactory of given type already exists. - ACE_THROW (CORBA::BAD_INV_ORDER ()); + // PolicyFactory of given type already exists. - // @@ We need to fill in the appropriate minor code once the OMG - // decides what it should be. + /** + * @todo + * Fill in the appropriate minor code once the OMG decides what + * it should be. + */ + ACE_THROW (CORBA::BAD_INV_ORDER ()); } else if (result == -1) { - /// Could not add PolicyFactory due to internal bind failures. + // Could not add PolicyFactory due to internal bind failures. ACE_THROW (CORBA::INTERNAL ()); } } @@ -68,10 +70,10 @@ TAO_PolicyFactory_Registry::create_policy (CORBA::PolicyType type, if (this->factories_.find (type, policy_factory) == -1) { - /// Policy factory corresponding to given policy type does not - /// exist in policy factory map. + // Policy factory corresponding to given policy type does not + // exist in policy factory map. ACE_THROW_RETURN ( - CORBA::PolicyError (CORBA::BAD_POLICY_TYPE), // @@ Right exception? + CORBA::PolicyError (CORBA::BAD_POLICY_TYPE), // @@ Right exception? CORBA::Policy::_nil ()); } diff --git a/TAO/tao/PolicyFactory_Registry.h b/TAO/tao/PolicyFactory_Registry.h index 4a09690b7c1..6e8078c85b2 100644 --- a/TAO/tao/PolicyFactory_Registry.h +++ b/TAO/tao/PolicyFactory_Registry.h @@ -1,26 +1,21 @@ // -*- C++ -*- -// -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO -// -// = FILENAME -// PolicyFactory_Registry.h -// -// = AUTHOR -// Ossama Othman <ossama@uci.edu> -// -// ============================================================================ + +// =================================================================== +/** + * @file PolicyFactory_Registry.h + * + * $Id$ + * + * @author Ossama Othman <ossama@uci.edu> + */ +// =================================================================== #ifndef TAO_POLICY_FACTORY_REGISTRY_H #define TAO_POLICY_FACTORY_REGISTRY_H #include "ace/pre.h" -#include "tao/corbafwd.h" +#include "corbafwd.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -31,55 +26,62 @@ class TAO_ORB_Core; -/// ORB-specific registry that contains all portable interceptor -/// policy factories. +/** + * @class TAO_PolicyFactory_Registry + * + * @brief + * ORB-specific registry that contains all portable interceptor + * policy factories. + */ class TAO_Export TAO_PolicyFactory_Registry { public: + /** + * The type of table that maps policy type to policy factory. + * + * @note + * An ACE_Null_Mutex is used for this type since policy factories + * are only registered when CORBA::ORB_init() is called, at which a + * point a lock has already been acquired. In short, the table is + * only modified during ORB bootstrap-time. + */ typedef ACE_Map_Manager< CORBA::PolicyType, PortableInterceptor::PolicyFactory_ptr, ACE_Null_Mutex> TABLE; - ///< The type of table that maps policy type to policy factory. - - ///< NOTE: An ACE_Null_Mutex not used for any of these types since - ///< policy factories are only registered when - ///< CORBA::ORB_init() is called, at which a point a lock has - ///< already been acquired. In short, the table is only - ///< modified during ORB bootstrap-time. public: + /// Constructor TAO_PolicyFactory_Registry (void); - ///< Constructor + /// Destructor. Releases duplicated PolicyFactory references. ~TAO_PolicyFactory_Registry (void); - ///< Destructor. Releases duplicated PolicyFactory references. + /// Register a PolicyFactory with the underlying PolicyFactory + /// sequence. This method should only be called during ORB + /// initialization. void register_policy_factory ( CORBA::PolicyType type, PortableInterceptor::PolicyFactory_ptr policy_factory, CORBA::Environment &ACE_TRY_ENV); - ///< Register a PolicyFactory with the underlying PolicyFactory - ///< sequence. - ///< This method should only be called during ORB initialization. + /// Construct a policy of the given type with the information + /// contained in the CORBA::Any <value>. CORBA::Policy_ptr create_policy (CORBA::PolicyType type, const CORBA::Any &value, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException, CORBA::PolicyError)); - ///< Construct a policy of the given type with the information - ///< contained in the CORBA::Any <value>. private: + /// The table that maps policy type to policy factory. TABLE factories_; - ///< The table that maps policy type to policy factory. }; #include "ace/post.h" -#endif /* TAO_POLICY_FACTORY_REGISTRY_H */ +#endif /* TAO_POLICY_FACTORY_REGISTRY_H */ diff --git a/TAO/tao/PortableInterceptor.h b/TAO/tao/PortableInterceptor.h index 1b08bfb1248..f2de9aeeb40 100644 --- a/TAO/tao/PortableInterceptor.h +++ b/TAO/tao/PortableInterceptor.h @@ -21,7 +21,7 @@ // // = AUTHOR // Nanbor Wang <nanbor@cs.wustl.edu> -// Kirthika PArameswaran <kirthika@cs.wustl.edu> +// Kirthika Parameswaran <kirthika@cs.wustl.edu> // Ossama Othman <ossama@uci.edu> // // ======================================================================== @@ -127,12 +127,12 @@ private: }; -#endif /* TAO_HAS_INTERCEPTORS */ - #if defined (__ACE_INLINE__) #include "tao/PortableInterceptor.i" #endif /* defined INLINE */ +#endif /* TAO_HAS_INTERCEPTORS */ + #include "ace/post.h" #endif /* TAO_PORTABLE_INTERCEPTOR_H */ diff --git a/TAO/tao/Principal.h b/TAO/tao/Principal.h index 217549bdadd..955bd743f4c 100644 --- a/TAO/tao/Principal.h +++ b/TAO/tao/Principal.h @@ -21,13 +21,13 @@ #define TAO_PRINCIPAL_H #include "ace/pre.h" -#include "tao/corbafwd.h" +#include "corbafwd.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/Sequence.h" +#include "OctetSeqC.h" class TAO_Export CORBA_Principal { diff --git a/TAO/tao/Profile.cpp b/TAO/tao/Profile.cpp index 8c33b284846..9c37e004d7d 100644 --- a/TAO/tao/Profile.cpp +++ b/TAO/tao/Profile.cpp @@ -1,25 +1,43 @@ // $Id$ -#include "tao/Profile.h" -#include "tao/Object_KeyC.h" +#include "Profile.h" +#include "Object_KeyC.h" -#include "tao/MessagingC.h" -#include "tao/Stub.h" -#include "tao/debug.h" +#include "MessagingC.h" +#include "Stub.h" +#include "debug.h" #if !defined (__ACE_INLINE__) -#include "tao/Profile.i" +#include "Profile.i" #endif /* __ACE_INLINE__ */ ACE_RCSID(tao, Profile, "$Id$") - // **************************************************************** +// **************************************************************** - TAO_Profile::~TAO_Profile (void) +TAO_Profile::~TAO_Profile (void) { } void +TAO_Profile::add_tagged_component (const IOP::TaggedComponent &component, + CORBA::Environment &ACE_TRY_ENV) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + // Sanity checks. + this->verify_orb_configuration (ACE_TRY_ENV); + ACE_CHECK; + + this->verify_profile_version (ACE_TRY_ENV); + ACE_CHECK; + + // ---------------------------------------------------------------- + + // Add the given tagged component to this profile. + this->tagged_components ().set_component (component); +} + +void TAO_Profile::policies (CORBA::PolicyList *policy_list) { #if (TAO_HAS_CORBA_MESSAGING == 1) @@ -237,6 +255,63 @@ TAO_Profile::the_stub (void) return stub_; } +void +TAO_Profile::verify_orb_configuration (CORBA::Environment &ACE_TRY_ENV) +{ + // If the ORB isn't configured to support tagged components, then + // throw an exception. + if (this->orb_core_->orb_params ()->std_profile_components () == 0) + { + if (TAO_debug_level > 0) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) Cannot add ") + ACE_TEXT ("IOP::TaggedComponent to profile.\n") + ACE_TEXT ("(%P|%t) Standard profile components") + ACE_TEXT ("have been disabled.\n") + ACE_TEXT ("(%P|%t) Try") + ACE_TEXT ("\"-ORBStdProfileComponents 1\"\n"))); + + // Throw an exception since some services may depend on standard + // profile components. Ignoring the problem would undermine + // services that depend on standard profile components, so + // let the IORInterceptor that no further progress will be + // made. + ACE_THROW (CORBA::BAD_PARAM ( + CORBA_SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + EINVAL), + CORBA::COMPLETED_NO)); + } +} + +void +TAO_Profile::verify_profile_version (CORBA::Environment &ACE_TRY_ENV) +{ + // GIOP 1.0 does not support tagged components. Throw an exception + // if the profile is a GIOP 1.0 profile. + + if (this->version_.major == 1 && this->version_.minor == 0) + { + if (TAO_debug_level > 0) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) Cannot add ") + ACE_TEXT ("IOP::TaggedComponent to GIOP 1.0") + ACE_TEXT ("IOR profile.\n") + ACE_TEXT ("(%P|%t) Try using a GIOP 1.1 or ") + ACE_TEXT ("greater endpoint.\n"))); + + // Throw an exception since some services may depend on tagged + // components. Ignoring the problem would undermine services + // that depend on standard profile components, so let the + // IORInterceptor know that no further progress will be made. + ACE_THROW (CORBA::BAD_PARAM ( + CORBA_SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + EINVAL), + CORBA::COMPLETED_NO)); + } +} + // **************************************************************** TAO_Unknown_Profile::TAO_Unknown_Profile (CORBA::ULong tag, diff --git a/TAO/tao/Profile.h b/TAO/tao/Profile.h index 2e10a076b39..963b835aba4 100644 --- a/TAO/tao/Profile.h +++ b/TAO/tao/Profile.h @@ -18,15 +18,15 @@ #define TAO_PROFILE_H #include "ace/pre.h" -#include "tao/corbafwd.h" +#include "corbafwd.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/Tagged_Components.h" -#include "tao/PolicyC.h" -#include "tao/GIOP_Message_State.h" +#include "Tagged_Components.h" +#include "PolicyC.h" +#include "GIOP_Message_State.h" class TAO_MProfile; class TAO_Stub; @@ -55,7 +55,7 @@ public: CORBA::ULong tag (void) const; // The tag, each concrete class will have a specific tag value. - const TAO_GIOP_Version& version (void) const; + const TAO_GIOP_Version &version (void) const; // Return a pointer to this profile's version. This object // maintains ownership. @@ -80,6 +80,10 @@ public: // Access the tagged components, notice that they they could be // empty (or ignored) for non-GIOP protocols (and even for GIOP-1.0) + /// Add the given tagged component to the profile. + void add_tagged_component (const IOP::TaggedComponent &component, + CORBA::Environment &ACE_TRY_ENV); + virtual char object_key_delimiter (void) const = 0; // The object key delimiter. @@ -149,14 +153,24 @@ public: // Gets the TAO_MProfile that holds the TAO_Profile instance. private: + TAO_MProfile *forward_to_i (void); // this object keeps ownership of this object + /// Verify that the current ORB's configuration supports tagged + /// components in IORs. + void verify_orb_configuration (CORBA::Environment &ACE_TRY_ENV); + + /// Verify that the given profile supports tagged components, + /// i.e. is not a GIOP 1.0 profile. + void verify_profile_version (CORBA::Environment &ACE_TRY_ENV); + // Profiles should not be copied! ACE_UNIMPLEMENTED_FUNC (TAO_Profile (const TAO_Profile&)) ACE_UNIMPLEMENTED_FUNC (void operator= (const TAO_Profile&)) protected: + TAO_GIOP_Version version_; // IIOP version number. @@ -181,6 +195,7 @@ protected: private: + CORBA::ULong tag_; // IOP protocol tag. @@ -241,7 +256,7 @@ private: }; #if defined (__ACE_INLINE__) -# include "tao/Profile.i" +# include "Profile.i" #endif /* __ACE_INLINE__ */ #include "ace/post.h" diff --git a/TAO/tao/RT_ORBInitializer.cpp b/TAO/tao/RT_ORBInitializer.cpp index 25928b9e5bb..bde192280f7 100644 --- a/TAO/tao/RT_ORBInitializer.cpp +++ b/TAO/tao/RT_ORBInitializer.cpp @@ -77,10 +77,6 @@ TAO_RT_ORBInitializer::register_policy_factories ( policy_factory.in () TAO_ENV_ARG_PARAMETER); ACE_CHECK; - - /// Transfer ownership of the policy factory to the registry. - (void) policy_factory._retn (); - } #endif /* TAO_HAS_RT_CORBA == 1 */ diff --git a/TAO/tao/Stub.cpp b/TAO/tao/Stub.cpp index b493ddfba53..7e598f222b9 100644 --- a/TAO/tao/Stub.cpp +++ b/TAO/tao/Stub.cpp @@ -10,60 +10,56 @@ // based implementation, and can neither be used by other kinds of // objref nor have a default implementation. -#include "tao/Endpoint.h" -#include "tao/Stub.h" -#include "tao/Sequence.h" -#include "tao/Object.h" -#include "tao/Invocation.h" -#include "tao/Asynch_Invocation.h" -#include "tao/ORB_Core.h" -#include "tao/Client_Strategy_Factory.h" -#include "tao/Sync_Strategies.h" -#include "tao/Buffering_Constraint_Policy.h" -#include "tao/Messaging_Policy_i.h" -#include "tao/Client_Priority_Policy.h" -#include "tao/debug.h" +#include "Endpoint.h" +#include "Stub.h" +#include "Sequence.h" +#include "Object.h" +#include "Invocation.h" +#include "Asynch_Invocation.h" +#include "ORB_Core.h" +#include "Client_Strategy_Factory.h" +#include "Sync_Strategies.h" +#include "Buffering_Constraint_Policy.h" +#include "Messaging_Policy_i.h" +#include "Client_Priority_Policy.h" +#include "debug.h" #if (TAO_HAS_RT_CORBA == 1) -# include "tao/RT_Policy_i.h" +# include "RT_Policy_i.h" #endif /* TAO_HAS_RT_CORBA == 1 */ #include "ace/Auto_Ptr.h" #if !defined (__ACE_INLINE__) -# include "tao/Stub.i" +# include "Stub.i" #endif /* ! __ACE_INLINE__ */ ACE_RCSID(tao, TAO_Stub, "$Id$") - TAO_Stub::TAO_Stub (char *repository_id, - const TAO_MProfile &profiles, - TAO_ORB_Core *orb_core) - : type_id (repository_id), - +TAO_Stub::TAO_Stub (const char *repository_id, + const TAO_MProfile &profiles, + TAO_ORB_Core *orb_core) + : type_id (repository_id), #if (TAO_HAS_RT_CORBA == 1) - - priority_model_policy_ (0), - priority_banded_connection_policy_ (0), - client_protocol_policy_ (0), - are_policies_parsed_ (0), - + priority_model_policy_ (0), + priority_banded_connection_policy_ (0), + client_protocol_policy_ (0), + are_policies_parsed_ (0), #endif /* TAO_HAS_RT_CORBA == 1 */ - base_profiles_ ((CORBA::ULong) 0), - forward_profiles_ (0), - profile_in_use_ (0), - profile_lock_ptr_ (0), - profile_success_ (0), - refcount_lock_ (), - refcount_ (1), - orb_core_ (orb_core), - orb_ (), - servant_orb_ (), - #if (TAO_HAS_CORBA_MESSAGING == 1) - policies_ (0), - #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ - addressing_mode_ (0) - + base_profiles_ ((CORBA::ULong) 0), + forward_profiles_ (0), + profile_in_use_ (0), + profile_lock_ptr_ (0), + profile_success_ (0), + refcount_lock_ (), + refcount_ (1), + orb_core_ (orb_core), + orb_ (), + servant_orb_ (), +#if (TAO_HAS_CORBA_MESSAGING == 1) + policies_ (0), +#endif /* TAO_HAS_CORBA_MESSAGING == 1 */ + addressing_mode_ (0) { if (this->orb_core_ == 0) { @@ -611,7 +607,7 @@ TAO_Stub::set_policy_overrides (const CORBA::PolicyList & policies, } TAO_Stub* stub; - ACE_NEW_RETURN (stub, TAO_Stub (CORBA::string_dup (this->type_id.in ()), + ACE_NEW_RETURN (stub, TAO_Stub (this->type_id.in (), this->base_profiles_, this->orb_core_), 0); diff --git a/TAO/tao/Stub.h b/TAO/tao/Stub.h index e4a6854d3f3..cab6aaa1c79 100644 --- a/TAO/tao/Stub.h +++ b/TAO/tao/Stub.h @@ -241,7 +241,7 @@ public: // Our Constructors ... - TAO_Stub (char *repository_id, + TAO_Stub (const char *repository_id, const TAO_MProfile &profiles, TAO_ORB_Core *orb_core); // Construct from a repository ID and a list of profiles. diff --git a/TAO/tao/TAO.dsp b/TAO/tao/TAO.dsp index 00a41f64f6f..6dca123a230 100644 --- a/TAO/tao/TAO.dsp +++ b/TAO/tao/TAO.dsp @@ -499,6 +499,25 @@ SOURCE=.\CDR.cpp # End Source File
# Begin Source File
+SOURCE=.\Cleanup_Func_Registry.cpp
+
+!IF "$(CFG)" == "TAO DLL - Win32 Alpha Release"
+
+!ELSEIF "$(CFG)" == "TAO DLL - Win32 Alpha Debug"
+
+!ELSEIF "$(CFG)" == "TAO DLL - Win32 MFC Release"
+
+!ELSEIF "$(CFG)" == "TAO DLL - Win32 MFC Debug"
+
+!ELSEIF "$(CFG)" == "TAO DLL - Win32 Release"
+
+!ELSEIF "$(CFG)" == "TAO DLL - Win32 Debug"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
SOURCE=.\Client_Priority_Policy.cpp
!IF "$(CFG)" == "TAO DLL - Win32 Alpha Release"
@@ -1525,6 +1544,25 @@ SOURCE=.\IOR_Parser.cpp # End Source File
# Begin Source File
+SOURCE=.\IORInfo.cpp
+
+!IF "$(CFG)" == "TAO DLL - Win32 Alpha Release"
+
+!ELSEIF "$(CFG)" == "TAO DLL - Win32 Alpha Debug"
+
+!ELSEIF "$(CFG)" == "TAO DLL - Win32 MFC Release"
+
+!ELSEIF "$(CFG)" == "TAO DLL - Win32 MFC Debug"
+
+!ELSEIF "$(CFG)" == "TAO DLL - Win32 Release"
+
+!ELSEIF "$(CFG)" == "TAO DLL - Win32 Debug"
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
SOURCE=.\Leader_Follower.cpp
!IF "$(CFG)" == "TAO DLL - Win32 Alpha Release"
@@ -3276,6 +3314,14 @@ SOURCE=.\cdr.h # End Source File
# Begin Source File
+SOURCE=.\Cleanup_Func_Registry.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Cleanup_Func_Registry.inl
+# End Source File
+# Begin Source File
+
SOURCE=.\Client_Priority_Policy.h
# End Source File
# Begin Source File
@@ -3524,6 +3570,10 @@ SOURCE=.\IOR_Parser.h # End Source File
# Begin Source File
+SOURCE=.\IORInfo.h
+# End Source File
+# Begin Source File
+
SOURCE=.\Leader_Follower.h
# End Source File
# Begin Source File
diff --git a/TAO/tao/TAO_Static.dsp b/TAO/tao/TAO_Static.dsp index 69211eb55ef..b01f71e1341 100644 --- a/TAO/tao/TAO_Static.dsp +++ b/TAO/tao/TAO_Static.dsp @@ -143,6 +143,10 @@ SOURCE=.\cdr.h # End Source File
# Begin Source File
+SOURCE=.\Cleanup_Func_Registry.h
+# End Source File
+# Begin Source File
+
SOURCE=.\Client_Priority_Policy.h
# End Source File
# Begin Source File
@@ -383,6 +387,10 @@ SOURCE=.\IOR_Parser.h # End Source File
# Begin Source File
+SOURCE=.\IORInfo.h
+# End Source File
+# Begin Source File
+
SOURCE=.\Leader_Follower.h
# End Source File
# Begin Source File
@@ -780,7 +788,7 @@ SOURCE=.\WrongTransactionC.h # End Group
# Begin Group "Inline Files"
-# PROP Default_Filter "i"
+# PROP Default_Filter "i,inl"
# Begin Source File
SOURCE=.\Acceptor_Filter.i
@@ -831,6 +839,10 @@ SOURCE=.\cdr.i # End Source File
# Begin Source File
+SOURCE=.\Cleanup_Func_Registry.inl
+# End Source File
+# Begin Source File
+
SOURCE=.\Client_Priority_Policy.i
# End Source File
# Begin Source File
@@ -1391,6 +1403,10 @@ SOURCE=.\CDR.cpp # End Source File
# Begin Source File
+SOURCE=.\Cleanup_Func_Registry.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\Client_Priority_Policy.cpp
# End Source File
# Begin Source File
@@ -1607,6 +1623,10 @@ SOURCE=.\IOR_Parser.cpp # End Source File
# Begin Source File
+SOURCE=.\IORInfo.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\Leader_Follower.cpp
# End Source File
# Begin Source File
diff --git a/TAO/tao/corbafwd.h b/TAO/tao/corbafwd.h index 011e3696214..918bd06551a 100644 --- a/TAO/tao/corbafwd.h +++ b/TAO/tao/corbafwd.h @@ -321,9 +321,9 @@ class CORBA_WStringSeq; class CORBA_WStringSeq_var; class CORBA_WStringSeq_out; -class OctetSeq; -class OctetSeq_var; -class OctetSeq_out; +class CORBA_OctetSeq; +class CORBA_OctetSeq_var; +class CORBA_OctetSeq_out; class CORBA_Bounds; typedef CORBA_Bounds *CORBA_Bounds_ptr; @@ -436,10 +436,13 @@ TAO_NAMESPACE CORBA typedef CORBA_WStringSeq_out WStringSeq_out; /// Octet sequence typedef + typedef CORBA_OctetSeq OctetSeq; + typedef CORBA_OctetSeq_var OctetSeq_var; + typedef CORBA_OctetSeq_out OctetSeq_out; - typedef TAO_Unbounded_Sequence<Octet> OctetSeq; - typedef TAO_Unbounded_Sequence<Octet> OctetSeq_var; - typedef TAO_Unbounded_Sequence<Octet> OctetSeq_out; +// typedef TAO_Unbounded_Sequence<Octet> OctetSeq; +// typedef TAO_Unbounded_Sequence<Octet> OctetSeq_var; +// typedef TAO_Unbounded_Sequence<Octet> OctetSeq_out; // = various CORBA defined classes. typedef CORBA_Any Any; |