diff options
Diffstat (limited to 'TAO/tao')
50 files changed, 2333 insertions, 1373 deletions
diff --git a/TAO/tao/PortableServer/IORInfo.cpp b/TAO/tao/IORInterceptor/IORInfo.cpp index df689cc906b..bb5377f0c9a 100644 --- a/TAO/tao/PortableServer/IORInfo.cpp +++ b/TAO/tao/IORInterceptor/IORInfo.cpp @@ -1,4 +1,4 @@ -#include "tao/PortableServer/IORInfo.h" +#include "IORInfo.h" #include "tao/PortableServer/POA.h" #include "tao/PolicyC.h" @@ -6,11 +6,10 @@ #include "tao/ORB_Constants.h" -ACE_RCSID (PortableServer, +ACE_RCSID (IORInterceptor, IORInfo, "$Id$") - #if !defined (__ACE_INLINE__) # include "IORInfo.inl" #endif /* __ACE_INLINE__ */ @@ -138,7 +137,8 @@ TAO_IORInfo::adapter_template (ACE_ENV_SINGLE_ARG_DECL) // add_ior_component_to_profile. It's a const value and its value // never changes. PortableInterceptor::ObjectReferenceTemplate *adapter_template = - this->poa_->get_adapter_template (); + this->poa_->get_adapter_template (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); if (adapter_template == 0) { @@ -147,8 +147,6 @@ TAO_IORInfo::adapter_template (ACE_ENV_SINGLE_ARG_DECL) 0); } - CORBA::add_ref (adapter_template); - return adapter_template; } @@ -165,7 +163,8 @@ TAO_IORInfo::current_factory (ACE_ENV_SINGLE_ARG_DECL) // can be changed. The value of the current_factory can be changed // only during the call to components_established method. PortableInterceptor::ObjectReferenceFactory *adapter_factory = - this->poa_->get_obj_ref_factory (); + this->poa_->get_obj_ref_factory (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK_RETURN (0); if (adapter_factory == 0) { @@ -174,8 +173,6 @@ TAO_IORInfo::current_factory (ACE_ENV_SINGLE_ARG_DECL) 0); } - CORBA::add_ref (adapter_factory); - return adapter_factory; } diff --git a/TAO/tao/PortableServer/IORInfo.h b/TAO/tao/IORInterceptor/IORInfo.h index 5b168a59fe4..faf9f44cd67 100644 --- a/TAO/tao/PortableServer/IORInfo.h +++ b/TAO/tao/IORInterceptor/IORInfo.h @@ -15,7 +15,7 @@ #include /**/ "ace/pre.h" -#include "tao/IORInterceptor/IORInterceptorC.h" +#include "IORInfoC.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/TAO/tao/PortableServer/IORInfo.inl b/TAO/tao/IORInterceptor/IORInfo.inl index 3a94b482656..3a94b482656 100644 --- a/TAO/tao/PortableServer/IORInfo.inl +++ b/TAO/tao/IORInterceptor/IORInfo.inl diff --git a/TAO/tao/IORInterceptor/IORInfo.pidl b/TAO/tao/IORInterceptor/IORInfo.pidl new file mode 100644 index 00000000000..c20532343dd --- /dev/null +++ b/TAO/tao/IORInterceptor/IORInfo.pidl @@ -0,0 +1,64 @@ +// -*- IDL -*- + +/** + * @file IORInfo.pidl + * + * $Id$ + * + * @brief Pre-compiled IDL source for the IORInfo + * components in the ORB. + * + * The following is from orbos/99-12-02 Portable Interceptors spec, + * the full IDL is downloadable from orbos/99-12-02. This file contains + * interfaces from PortableInterceptor.idl that depend on + * ObjectReferenceFactory and ObjectReferenceTemplate, which inherit + * directly or indirectly from CORBA::ValueBase. This separate file + * has been created to remove the dependency from the rest of module + * PortableInterceptor. + * + * This file was used to generate the code in IORInfoC.* + * The command used to generate code is: + * + * tao_idl + * -o orig -Gp -Gd -Ge 1 -Sa -St -GT + * -I$(TAO_ROOT) + * -Wb,export_macro=TAO_IORInterceptor_Export + * -Wb,export_include="iorinterceptor_export.h" + * -Wb,pre_include="ace/pre.h" + * -Wb,post_include="ace/post.h" + * IORInfo.pidl + */ + +// File: IORInfo.idl +#ifndef _IORINFO_IDL_ +#define _IORINFO_IDL_ + +#include "tao/PortableInterceptor.pidl" +#include "tao/ObjRefTemplate/ObjectReferenceTemplate.pidl" + +module PortableInterceptor +{ + typeprefix PortableInterceptor "omg.org"; + + local interface IORInfo + { + CORBA::Policy get_effective_policy (in CORBA::PolicyType type); + + void add_ior_component (in IOP::TaggedComponent a_component); + + void add_ior_component_to_profile ( + in IOP::TaggedComponent a_component, + in IOP::ProfileId profile_id + ); + + readonly attribute AdapterManagerId manager_id; + + readonly attribute AdapterState state; + + readonly attribute ObjectReferenceTemplate adapter_template; + + attribute ObjectReferenceFactory current_factory; + }; +}; + +#endif /* _IORINFO_IDL_ */ diff --git a/TAO/tao/IORInterceptor/IORInfoC.cpp b/TAO/tao/IORInterceptor/IORInfoC.cpp new file mode 100644 index 00000000000..07779a7625f --- /dev/null +++ b/TAO/tao/IORInterceptor/IORInfoC.cpp @@ -0,0 +1,282 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_codegen.cpp:303 + + +#include "IORInfoC.h" +#include "tao/CDR.h" +#include "tao/Object_Argument_T.h" +#include "ace/OS_NS_string.h" + +#if defined (__BORLANDC__) +#pragma option -w-rvl -w-rch -w-ccc -w-aus -w-sig +#endif /* __BORLANDC__ */ + +#if !defined (__ACE_INLINE__) +#include "IORInfoC.inl" +#endif /* !defined INLINE */ + +// TAO_IDL - Generated from +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_arg_traits.cpp:64 + +// Arg traits specializations. +namespace TAO +{ + +#if !defined (_PORTABLEINTERCEPTOR_OBJECTREFERENCEFACTORY__ARG_TRAITS_CS_) +#define _PORTABLEINTERCEPTOR_OBJECTREFERENCEFACTORY__ARG_TRAITS_CS_ + + ACE_TEMPLATE_SPECIALIZATION + class TAO_IORInterceptor_Export Arg_Traits<PortableInterceptor::ObjectReferenceFactory> + : public + Object_Arg_Traits_T< + PortableInterceptor::ObjectReferenceFactory *, + PortableInterceptor::ObjectReferenceFactory_var, + PortableInterceptor::ObjectReferenceFactory_out, + TAO::Value_Traits<PortableInterceptor::ObjectReferenceFactory> + > + { + }; + +#endif /* end #if !defined */ +} + + +// TAO_IDL - Generated from +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_interface/interface_cs.cpp:60 + +// Traits specializations for PortableInterceptor::IORInfo. + +ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION +PortableInterceptor::IORInfo_ptr +TAO::Objref_Traits<PortableInterceptor::IORInfo>::tao_duplicate ( + PortableInterceptor::IORInfo_ptr p + ) +{ + return PortableInterceptor::IORInfo::_duplicate (p); +} + +ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION +void +TAO::Objref_Traits<PortableInterceptor::IORInfo>::tao_release ( + PortableInterceptor::IORInfo_ptr p + ) +{ + CORBA::release (p); +} + +ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION +PortableInterceptor::IORInfo_ptr +TAO::Objref_Traits<PortableInterceptor::IORInfo>::tao_nil (void) +{ + return PortableInterceptor::IORInfo::_nil (); +} + +ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION +CORBA::Boolean +TAO::Objref_Traits<PortableInterceptor::IORInfo>::tao_marshal ( + PortableInterceptor::IORInfo_ptr p, + TAO_OutputCDR & cdr + ) +{ + return CORBA::Object::marshal (p, cdr); +} + +// Function pointer for collocation factory initialization. +TAO::Collocation_Proxy_Broker * +(*PortableInterceptor__TAO_IORInfo_Proxy_Broker_Factory_function_pointer) ( + CORBA::Object_ptr obj + ) = 0; + +PortableInterceptor::IORInfo::IORInfo (void) +{} + +PortableInterceptor::IORInfo::~IORInfo (void) +{} + +PortableInterceptor::IORInfo_ptr +PortableInterceptor::IORInfo::_narrow ( + CORBA::Object_ptr _tao_objref + ACE_ENV_ARG_DECL_NOT_USED + ) +{ + if (CORBA::is_nil (_tao_objref)) + { + return IORInfo::_nil (); + } + + IORInfo_ptr proxy = + dynamic_cast<IORInfo_ptr> (_tao_objref); + + return IORInfo::_duplicate (proxy); +} + +PortableInterceptor::IORInfo_ptr +PortableInterceptor::IORInfo::_unchecked_narrow ( + CORBA::Object_ptr _tao_objref + ACE_ENV_ARG_DECL_NOT_USED + ) +{ + if (CORBA::is_nil (_tao_objref)) + { + return IORInfo::_nil (); + } + + IORInfo_ptr proxy = + dynamic_cast<IORInfo_ptr> (_tao_objref); + + return IORInfo::_duplicate (proxy); +} + +PortableInterceptor::IORInfo_ptr +PortableInterceptor::IORInfo::_duplicate (IORInfo_ptr obj) +{ + if (! CORBA::is_nil (obj)) + { + obj->_add_ref (); + } + + return obj; +} + +CORBA::Boolean +PortableInterceptor::IORInfo::_is_a ( + const char *value + ACE_ENV_ARG_DECL_NOT_USED + ) +{ + if ( + !ACE_OS::strcmp ( + (char *)value, + "IDL:omg.org/PortableInterceptor/IORInfo:1.0" + ) || + !ACE_OS::strcmp ( + (char *)value, + "IDL:omg.org/CORBA/LocalObject:1.0" + ) || + !ACE_OS::strcmp ( + (char *)value, + "IDL:omg.org/CORBA/Object:1.0" + ) + ) + { + return 1; // success using local knowledge + } + else + { + return 0; + } +} + +const char* PortableInterceptor::IORInfo::_interface_repository_id (void) const +{ + return "IDL:omg.org/PortableInterceptor/IORInfo:1.0"; +} + +CORBA::Boolean +PortableInterceptor::IORInfo::marshal (TAO_OutputCDR &) +{ + return 0; +} + +// TAO_IDL - Generated from +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_root/root.cpp:1628 + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) + +#if !defined (_PORTABLEINTERCEPTOR_OBJECTREFERENCEFACTORY__ARG_TRAITS_TMPLINST_CS_) +#define _PORTABLEINTERCEPTOR_OBJECTREFERENCEFACTORY__ARG_TRAITS_TMPLINST_CS_ + + template class + TAO::Arg_Traits< + PortableInterceptor::ObjectReferenceFactory + >; + + template class + TAO::Object_Arg_Traits_T< + PortableInterceptor::ObjectReferenceFactory *, + PortableInterceptor::ObjectReferenceFactory_var, + PortableInterceptor::ObjectReferenceFactory_out, + TAO::Objref_Traits<PortableInterceptor::ObjectReferenceFactory> + >; + +#endif /* end #if !defined */ + + template class + TAO::Objref_Traits< + PortableInterceptor::IORInfo + >; + + template class + TAO_Objref_Var_T< + PortableInterceptor::IORInfo + >; + + template class + TAO_Objref_Out_T< + PortableInterceptor::IORInfo + >; + +#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) + +#if !defined (_PORTABLEINTERCEPTOR_OBJECTREFERENCEFACTORY__ARG_TRAITS_TMPLINST_CS_) +#define _PORTABLEINTERCEPTOR_OBJECTREFERENCEFACTORY__ARG_TRAITS_TMPLINST_CS_ + +# pragma instantiate \ + TAO::Arg_Traits< \ + PortableInterceptor::ObjectReferenceFactory \ + > + +# pragma instantiate \ + TAO::Object_Arg_Traits_T< \ + PortableInterceptor::ObjectReferenceFactory *, \ + PortableInterceptor::ObjectReferenceFactory_var, \ + PortableInterceptor::ObjectReferenceFactory_out, \ + TAO::Objref_Traits<PortableInterceptor::ObjectReferenceFactory> \ + > + +#endif /* end #if !defined */ + +# pragma instantiate \ + TAO::Objref_Traits< \ + PortableInterceptor::IORInfo \ + > + +# pragma instantiate \ + TAO_Objref_Var_T< \ + PortableInterceptor::IORInfo + > + +# pragma instantiate \ + TAO_Objref_Out_T< \ + PortableInterceptor::IORInfo + > + +#endif /* !ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + diff --git a/TAO/tao/IORInterceptor/IORInfoC.h b/TAO/tao/IORInterceptor/IORInfoC.h new file mode 100644 index 00000000000..f749cd107d8 --- /dev/null +++ b/TAO/tao/IORInterceptor/IORInfoC.h @@ -0,0 +1,311 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + +// TAO_IDL - Generated from +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_codegen.cpp:153 + +#ifndef _TAO_IDL_ORIG_IORINFOC_H_ +#define _TAO_IDL_ORIG_IORINFOC_H_ + +#include /**/ "ace/pre.h" + + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "iorinterceptor_export.h" +#include "tao/ORB.h" +#include "tao/Environment.h" +#include "tao/Object.h" +#include "tao/Objref_VarOut_T.h" + +#include "tao/PortableInterceptorC.h" +#include "tao/ObjRefTemplate/ObjectReferenceTemplateC.h" + +#if defined (TAO_EXPORT_MACRO) +#undef TAO_EXPORT_MACRO +#endif +#define TAO_EXPORT_MACRO TAO_IORInterceptor_Export + +#if defined (TAO_EXPORT_NESTED_CLASSES) +# if defined (TAO_EXPORT_NESTED_MACRO) +# undef TAO_EXPORT_NESTED_MACRO +# endif /* defined (TAO_EXPORT_NESTED_MACRO) */ +# define TAO_EXPORT_NESTED_MACRO TAO_IORInterceptor_Export +#endif /* TAO_EXPORT_NESTED_CLASSES */ + +#if defined(_MSC_VER) +#if (_MSC_VER >= 1200) +#pragma warning(push) +#endif /* _MSC_VER >= 1200 */ +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option push -w-rvl -w-rch -w-ccc -w-inl +#endif /* __BORLANDC__ */ + +// TAO_IDL - Generated from +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_root/root_ch.cpp:63 + +namespace TAO +{ + class Collocation_Proxy_Broker; + + template<typename T> class Narrow_Utils; + template<typename T> class AbstractBase_Narrow_Utils; +} + +// TAO_IDL - Generated from +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_module/module_ch.cpp:48 + +namespace PortableInterceptor +{ + + // TAO_IDL - Generated from + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_interface.cpp:613 + +#if !defined (_PORTABLEINTERCEPTOR_IORINFO__VAR_OUT_CH_) +#define _PORTABLEINTERCEPTOR_IORINFO__VAR_OUT_CH_ + + class IORInfo; + typedef IORInfo *IORInfo_ptr; + + typedef + TAO_Objref_Var_T< + IORInfo + > + IORInfo_var; + + typedef + TAO_Objref_Out_T< + IORInfo + > + IORInfo_out; + +#endif /* end #if !defined */ + + // TAO_IDL - Generated from + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_interface/interface_ch.cpp:54 + +#if !defined (_PORTABLEINTERCEPTOR_IORINFO_CH_) +#define _PORTABLEINTERCEPTOR_IORINFO_CH_ + + class TAO_IORInterceptor_Export IORInfo + : public virtual CORBA::Object + { + public: + typedef IORInfo_ptr _ptr_type; + typedef IORInfo_var _var_type; + + // The static operations. + static IORInfo_ptr _duplicate (IORInfo_ptr obj); + + static IORInfo_ptr _narrow ( + CORBA::Object_ptr obj + ACE_ENV_ARG_DECL_WITH_DEFAULTS + ); + + static IORInfo_ptr _unchecked_narrow ( + CORBA::Object_ptr obj + ACE_ENV_ARG_DECL_WITH_DEFAULTS + ); + + static IORInfo_ptr _nil (void) + { + return (IORInfo_ptr)0; + } + + + + // TAO_IDL - Generated from + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_operation/operation_ch.cpp:46 + + virtual ::CORBA::Policy_ptr get_effective_policy ( + ::CORBA::PolicyType type + ACE_ENV_ARG_DECL_WITH_DEFAULTS + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )) = 0; + + // TAO_IDL - Generated from + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_operation/operation_ch.cpp:46 + + virtual void add_ior_component ( + const ::IOP::TaggedComponent & a_component + ACE_ENV_ARG_DECL_WITH_DEFAULTS + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )) = 0; + + // TAO_IDL - Generated from + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_operation/operation_ch.cpp:46 + + virtual void add_ior_component_to_profile ( + const ::IOP::TaggedComponent & a_component, + ::IOP::ProfileId profile_id + ACE_ENV_ARG_DECL_WITH_DEFAULTS + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )) = 0; + + // TAO_IDL - Generated from + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_operation/operation_ch.cpp:46 + + virtual PortableInterceptor::AdapterManagerId manager_id ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )) = 0; + + // TAO_IDL - Generated from + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_operation/operation_ch.cpp:46 + + virtual PortableInterceptor::AdapterState state ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )) = 0; + + // TAO_IDL - Generated from + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_operation/operation_ch.cpp:46 + + virtual ::PortableInterceptor::ObjectReferenceTemplate * adapter_template ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )) = 0; + + // TAO_IDL - Generated from + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_operation/operation_ch.cpp:46 + + virtual ::PortableInterceptor::ObjectReferenceFactory * current_factory ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )) = 0; + + // TAO_IDL - Generated from + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_operation/operation_ch.cpp:46 + + virtual void current_factory ( + ::PortableInterceptor::ObjectReferenceFactory * current_factory + ACE_ENV_ARG_DECL_WITH_DEFAULTS + ) + ACE_THROW_SPEC (( + CORBA::SystemException + )) = 0; + + // TAO_IDL - Generated from + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_interface/interface_ch.cpp:208 + + virtual CORBA::Boolean _is_a ( + const char *type_id + ACE_ENV_ARG_DECL_WITH_DEFAULTS + ); + + virtual const char* _interface_repository_id (void) const; + virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); + + protected: + // Abstract or local interface only. + IORInfo (void); + + virtual ~IORInfo (void); + + private: + // Private and unimplemented for concrete interfaces. + IORInfo (const IORInfo &); + + void operator= (const IORInfo &); + }; + +#endif /* end #if !defined */ + +// TAO_IDL - Generated from +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_module/module_ch.cpp:66 + +} // module PortableInterceptor + +// TAO_IDL - Generated from +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_traits.cpp:59 + +// Traits specializations. +namespace TAO +{ + +#if !defined (_PORTABLEINTERCEPTOR_IORINFO__TRAITS_CH_) +#define _PORTABLEINTERCEPTOR_IORINFO__TRAITS_CH_ + + ACE_TEMPLATE_SPECIALIZATION + struct TAO_IORInterceptor_Export Objref_Traits< ::PortableInterceptor::IORInfo> + { + static ::PortableInterceptor::IORInfo_ptr tao_duplicate ( + ::PortableInterceptor::IORInfo_ptr + ); + static void tao_release ( + ::PortableInterceptor::IORInfo_ptr + ); + static ::PortableInterceptor::IORInfo_ptr tao_nil (void); + static CORBA::Boolean tao_marshal ( + ::PortableInterceptor::IORInfo_ptr p, + TAO_OutputCDR & cdr + ); + }; + +#endif /* end #if !defined */ +} + +// TAO_IDL - Generated from +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_codegen.cpp:958 + +#if defined (__ACE_INLINE__) +#include "IORInfoC.inl" +#endif /* defined INLINE */ + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__BORLANDC__) +#pragma option pop +#endif /* __BORLANDC__ */ + +#include /**/ "ace/post.h" + +#endif /* ifndef */ + diff --git a/TAO/tao/IORInterceptor/IORInterceptorC.i b/TAO/tao/IORInterceptor/IORInfoC.inl index 38aa32569ba..38aa32569ba 100644 --- a/TAO/tao/IORInterceptor/IORInterceptorC.i +++ b/TAO/tao/IORInterceptor/IORInfoC.inl diff --git a/TAO/tao/IORInterceptor/IORInterceptor.pidl b/TAO/tao/IORInterceptor/IORInterceptor.pidl index 2c466dd0e49..1013e104599 100644 --- a/TAO/tao/IORInterceptor/IORInterceptor.pidl +++ b/TAO/tao/IORInterceptor/IORInterceptor.pidl @@ -10,7 +10,7 @@ * * The following is from orbos/99-12-02 Portable Interceptors spec, * the full IDL is downloadable from orbos/99-12-02. This file contains - * interfaces from PortableInterceptor.idl that depend on + * interfaces from PortableInterceptor.idl that depend on * ObjectReferenceFactory and ObjectReferenceTemplate, which inherit * directly or indirectly from CORBA::ValueBase. This separate file * has been created to remove the dependency from the rest of module @@ -27,9 +27,6 @@ * -Wb,pre_include="ace/pre.h" * -Wb,post_include="ace/post.h" * IORInterceptor.pidl - * - * Patches for changes to the generated code are available in the - * `diffs' directory. */ // File: IORInterceptor.idl @@ -37,40 +34,21 @@ #define _IOR_INTERCEPTOR_IDL_ #include "tao/PortableInterceptor.pidl" +#include "tao/IORInterceptor/IORInfo.pidl" #include "tao/ObjRefTemplate/ObjectReferenceTemplate.pidl" -module PortableInterceptor +module PortableInterceptor { typeprefix PortableInterceptor "omg.org"; - local interface IORInfo - { - CORBA::Policy get_effective_policy (in CORBA::PolicyType type); - - void add_ior_component (in IOP::TaggedComponent a_component); - - void add_ior_component_to_profile ( - in IOP::TaggedComponent a_component, - in IOP::ProfileId profile_id - ); - - readonly attribute AdapterManagerId manager_id; - - readonly attribute AdapterState state; - - readonly attribute ObjectReferenceTemplate adapter_template; - - attribute ObjectReferenceFactory current_factory; - }; - - local interface IORInterceptor : Interceptor + local interface IORInterceptor : Interceptor { void establish_components (in IORInfo info); void components_established (in IORInfo info); void adapter_manager_state_changed ( - in AdapterManagerId id, + in AdapterManagerId id, in AdapterState state ); void adapter_state_changed ( diff --git a/TAO/tao/IORInterceptor/IORInterceptorC.cpp b/TAO/tao/IORInterceptor/IORInterceptorC.cpp index c839e820eac..6e0d078e22a 100644 --- a/TAO/tao/IORInterceptor/IORInterceptorC.cpp +++ b/TAO/tao/IORInterceptor/IORInterceptorC.cpp @@ -26,12 +26,11 @@ // http://www.cs.wustl.edu/~schmidt/TAO.html // TAO_IDL - Generated from -// be\be_codegen.cpp:323 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_codegen.cpp:303 #include "IORInterceptorC.h" #include "tao/CDR.h" -#include "tao/Object_Argument_T.h" #include "ace/OS_NS_string.h" #if defined (__BORLANDC__) @@ -39,174 +38,20 @@ #endif /* __BORLANDC__ */ #if !defined (__ACE_INLINE__) -#include "IORInterceptorC.i" +#include "IORInterceptorC.inl" #endif /* !defined INLINE */ // TAO_IDL - Generated from -// be\be_visitor_arg_traits.cpp:64 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_arg_traits.cpp:64 // Arg traits specializations. namespace TAO { - -#if !defined (_PORTABLEINTERCEPTOR_OBJECTREFERENCEFACTORY__ARG_TRAITS_CS_) -#define _PORTABLEINTERCEPTOR_OBJECTREFERENCEFACTORY__ARG_TRAITS_CS_ - - ACE_TEMPLATE_SPECIALIZATION - class TAO_IORInterceptor_Export Arg_Traits<PortableInterceptor::ObjectReferenceFactory> - : public - Object_Arg_Traits_T< - PortableInterceptor::ObjectReferenceFactory *, - PortableInterceptor::ObjectReferenceFactory_var, - PortableInterceptor::ObjectReferenceFactory_out, - TAO::Value_Traits<PortableInterceptor::ObjectReferenceFactory> - > - { - }; - -#endif /* end #if !defined */ -} - - -// TAO_IDL - Generated from -// be\be_visitor_interface/interface_cs.cpp:60 - -// Traits specializations for PortableInterceptor::IORInfo. - -ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION -PortableInterceptor::IORInfo_ptr -TAO::Objref_Traits<PortableInterceptor::IORInfo>::tao_duplicate ( - PortableInterceptor::IORInfo_ptr p - ) -{ - return PortableInterceptor::IORInfo::_duplicate (p); -} - -ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION -void -TAO::Objref_Traits<PortableInterceptor::IORInfo>::tao_release ( - PortableInterceptor::IORInfo_ptr p - ) -{ - CORBA::release (p); -} - -ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION -PortableInterceptor::IORInfo_ptr -TAO::Objref_Traits<PortableInterceptor::IORInfo>::tao_nil (void) -{ - return PortableInterceptor::IORInfo::_nil (); -} - -ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION -CORBA::Boolean -TAO::Objref_Traits<PortableInterceptor::IORInfo>::tao_marshal ( - PortableInterceptor::IORInfo_ptr p, - TAO_OutputCDR & cdr - ) -{ - return CORBA::Object::marshal (p, cdr); -} - -// Function pointer for collocation factory initialization. -TAO::Collocation_Proxy_Broker * -(*PortableInterceptor__TAO_IORInfo_Proxy_Broker_Factory_function_pointer) ( - CORBA::Object_ptr obj - ) = 0; - -PortableInterceptor::IORInfo::IORInfo (void) -{} - -PortableInterceptor::IORInfo::~IORInfo (void) -{} - -PortableInterceptor::IORInfo_ptr -PortableInterceptor::IORInfo::_narrow ( - CORBA::Object_ptr _tao_objref - ACE_ENV_ARG_DECL_NOT_USED - ) -{ - if (CORBA::is_nil (_tao_objref)) - { - return IORInfo::_nil (); - } - - IORInfo_ptr proxy = - dynamic_cast<IORInfo_ptr> (_tao_objref); - - return IORInfo::_duplicate (proxy); -} - -PortableInterceptor::IORInfo_ptr -PortableInterceptor::IORInfo::_unchecked_narrow ( - CORBA::Object_ptr _tao_objref - ACE_ENV_ARG_DECL_NOT_USED - ) -{ - if (CORBA::is_nil (_tao_objref)) - { - return IORInfo::_nil (); - } - - IORInfo_ptr proxy = - dynamic_cast<IORInfo_ptr> (_tao_objref); - - return IORInfo::_duplicate (proxy); -} - -PortableInterceptor::IORInfo_ptr -PortableInterceptor::IORInfo::_duplicate (IORInfo_ptr obj) -{ - if (! CORBA::is_nil (obj)) - { - obj->_add_ref (); - } - - return obj; -} - -CORBA::Boolean -PortableInterceptor::IORInfo::_is_a ( - const char *value - ACE_ENV_ARG_DECL_NOT_USED - ) -{ - if ( - !ACE_OS::strcmp ( - (char *)value, - "IDL:omg.org/PortableInterceptor/IORInfo:1.0" - ) || - !ACE_OS::strcmp ( - (char *)value, - "IDL:omg.org/CORBA/LocalObject:1.0" - ) || - !ACE_OS::strcmp ( - (char *)value, - "IDL:omg.org/CORBA/Object:1.0" - ) - ) - { - return 1; // success using local knowledge - } - else - { - return 0; - } -} - -const char* PortableInterceptor::IORInfo::_interface_repository_id (void) const -{ - return "IDL:omg.org/PortableInterceptor/IORInfo:1.0"; } -CORBA::Boolean -PortableInterceptor::IORInfo::marshal (TAO_OutputCDR &) -{ - return 0; -} // TAO_IDL - Generated from -// be\be_visitor_interface/interface_cs.cpp:60 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_interface/interface_cs.cpp:60 // Traits specializations for PortableInterceptor::IORInterceptor. @@ -347,7 +192,7 @@ PortableInterceptor::IORInterceptor::marshal (TAO_OutputCDR &) } // TAO_IDL - Generated from -// be\be_visitor_root/root.cpp:1628 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_root/root.cpp:1628 #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) @@ -366,39 +211,6 @@ PortableInterceptor::IORInterceptor::marshal (TAO_OutputCDR &) PortableInterceptor::IORInterceptor >; -#if !defined (_PORTABLEINTERCEPTOR_OBJECTREFERENCEFACTORY__ARG_TRAITS_TMPLINST_CS_) -#define _PORTABLEINTERCEPTOR_OBJECTREFERENCEFACTORY__ARG_TRAITS_TMPLINST_CS_ - - template class - TAO::Arg_Traits< - PortableInterceptor::ObjectReferenceFactory - >; - - template class - TAO::Object_Arg_Traits_T< - PortableInterceptor::ObjectReferenceFactory *, - PortableInterceptor::ObjectReferenceFactory_var, - PortableInterceptor::ObjectReferenceFactory_out, - TAO::Objref_Traits<PortableInterceptor::ObjectReferenceFactory> - >; - -#endif /* end #if !defined */ - - template class - TAO::Objref_Traits< - PortableInterceptor::IORInfo - >; - - template class - TAO_Objref_Var_T< - PortableInterceptor::IORInfo - >; - - template class - TAO_Objref_Out_T< - PortableInterceptor::IORInfo - >; - #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) # pragma instantiate \ @@ -416,38 +228,5 @@ PortableInterceptor::IORInterceptor::marshal (TAO_OutputCDR &) PortableInterceptor::IORInterceptor > -#if !defined (_PORTABLEINTERCEPTOR_OBJECTREFERENCEFACTORY__ARG_TRAITS_TMPLINST_CS_) -#define _PORTABLEINTERCEPTOR_OBJECTREFERENCEFACTORY__ARG_TRAITS_TMPLINST_CS_ - -# pragma instantiate \ - TAO::Arg_Traits< \ - PortableInterceptor::ObjectReferenceFactory \ - > - -# pragma instantiate \ - TAO::Object_Arg_Traits_T< \ - PortableInterceptor::ObjectReferenceFactory *, \ - PortableInterceptor::ObjectReferenceFactory_var, \ - PortableInterceptor::ObjectReferenceFactory_out, \ - TAO::Objref_Traits<PortableInterceptor::ObjectReferenceFactory> \ - > - -#endif /* end #if !defined */ - -# pragma instantiate \ - TAO::Objref_Traits< \ - PortableInterceptor::IORInfo \ - > - -# pragma instantiate \ - TAO_Objref_Var_T< \ - PortableInterceptor::IORInfo - > - -# pragma instantiate \ - TAO_Objref_Out_T< \ - PortableInterceptor::IORInfo - > - #endif /* !ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/tao/IORInterceptor/IORInterceptorC.h b/TAO/tao/IORInterceptor/IORInterceptorC.h index 8dce343deac..1f2dd3fb3ba 100644 --- a/TAO/tao/IORInterceptor/IORInterceptorC.h +++ b/TAO/tao/IORInterceptor/IORInterceptorC.h @@ -26,25 +26,28 @@ // http://www.cs.wustl.edu/~schmidt/TAO.html // TAO_IDL - Generated from -// be\be_codegen.cpp:171 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_codegen.cpp:153 #ifndef _TAO_IDL_ORIG_IORINTERCEPTORC_H_ #define _TAO_IDL_ORIG_IORINTERCEPTORC_H_ #include /**/ "ace/pre.h" -#include "tao/ORB.h" + +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "iorinterceptor_export.h" +#include "tao/ORB.h" #include "tao/Environment.h" #include "tao/Object.h" #include "tao/Objref_VarOut_T.h" #include "tao/PortableInterceptorC.h" +#include "tao/IORInterceptor/IORInfoC.h" #include "tao/ObjRefTemplate/ObjectReferenceTemplateC.h" #if defined (TAO_EXPORT_MACRO) @@ -71,7 +74,7 @@ #endif /* __BORLANDC__ */ // TAO_IDL - Generated from -// be\be_visitor_root/root_ch.cpp:63 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_root/root_ch.cpp:63 namespace TAO { @@ -82,180 +85,13 @@ namespace TAO } // TAO_IDL - Generated from -// be\be_visitor_module/module_ch.cpp:48 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_module/module_ch.cpp:48 namespace PortableInterceptor { // TAO_IDL - Generated from - // be\be_interface.cpp:611 - -#if !defined (_PORTABLEINTERCEPTOR_IORINFO__VAR_OUT_CH_) -#define _PORTABLEINTERCEPTOR_IORINFO__VAR_OUT_CH_ - - class IORInfo; - typedef IORInfo *IORInfo_ptr; - - typedef - TAO_Objref_Var_T< - IORInfo - > - IORInfo_var; - - typedef - TAO_Objref_Out_T< - IORInfo - > - IORInfo_out; - -#endif /* end #if !defined */ - - // TAO_IDL - Generated from - // be\be_visitor_interface/interface_ch.cpp:54 - -#if !defined (_PORTABLEINTERCEPTOR_IORINFO_CH_) -#define _PORTABLEINTERCEPTOR_IORINFO_CH_ - - class TAO_IORInterceptor_Export IORInfo - : public virtual CORBA::Object - { - public: - typedef IORInfo_ptr _ptr_type; - typedef IORInfo_var _var_type; - - // The static operations. - static IORInfo_ptr _duplicate (IORInfo_ptr obj); - - static IORInfo_ptr _narrow ( - CORBA::Object_ptr obj - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ); - - static IORInfo_ptr _unchecked_narrow ( - CORBA::Object_ptr obj - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ); - - static IORInfo_ptr _nil (void) - { - return (IORInfo_ptr)0; - } - - - - // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 - - virtual ::CORBA::Policy_ptr get_effective_policy ( - CORBA::PolicyType type - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )) = 0; - - // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 - - virtual void add_ior_component ( - const IOP::TaggedComponent & a_component - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )) = 0; - - // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 - - virtual void add_ior_component_to_profile ( - const IOP::TaggedComponent & a_component, - IOP::ProfileId profile_id - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )) = 0; - - // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 - - virtual PortableInterceptor::AdapterManagerId manager_id ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )) = 0; - - // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 - - virtual PortableInterceptor::AdapterState state ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )) = 0; - - // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 - - virtual ::PortableInterceptor::ObjectReferenceTemplate * adapter_template ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )) = 0; - - // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 - - virtual ::PortableInterceptor::ObjectReferenceFactory * current_factory ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )) = 0; - - // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 - - virtual void current_factory ( - PortableInterceptor::ObjectReferenceFactory * current_factory - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ) - ACE_THROW_SPEC (( - CORBA::SystemException - )) = 0; - - // TAO_IDL - Generated from - // be\be_visitor_interface/interface_ch.cpp:208 - - virtual CORBA::Boolean _is_a ( - const char *type_id - ACE_ENV_ARG_DECL_WITH_DEFAULTS - ); - - virtual const char* _interface_repository_id (void) const; - virtual CORBA::Boolean marshal (TAO_OutputCDR &cdr); - - protected: - // Abstract or local interface only. - IORInfo (void); - - virtual ~IORInfo (void); - - private: - // Private and unimplemented for concrete interfaces. - IORInfo (const IORInfo &); - - void operator= (const IORInfo &); - }; - -#endif /* end #if !defined */ - - // TAO_IDL - Generated from - // be\be_interface.cpp:611 + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_interface.cpp:613 #if !defined (_PORTABLEINTERCEPTOR_IORINTERCEPTOR__VAR_OUT_CH_) #define _PORTABLEINTERCEPTOR_IORINTERCEPTOR__VAR_OUT_CH_ @@ -278,13 +114,13 @@ namespace PortableInterceptor #endif /* end #if !defined */ // TAO_IDL - Generated from - // be\be_visitor_interface/interface_ch.cpp:54 + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_interface/interface_ch.cpp:54 #if !defined (_PORTABLEINTERCEPTOR_IORINTERCEPTOR_CH_) #define _PORTABLEINTERCEPTOR_IORINTERCEPTOR_CH_ class TAO_IORInterceptor_Export IORInterceptor - : public virtual PortableInterceptor::Interceptor + : public virtual ::PortableInterceptor::Interceptor { public: typedef IORInterceptor_ptr _ptr_type; @@ -311,10 +147,10 @@ namespace PortableInterceptor // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_operation/operation_ch.cpp:46 virtual void establish_components ( - PortableInterceptor::IORInfo_ptr info + ::PortableInterceptor::IORInfo_ptr info ACE_ENV_ARG_DECL_WITH_DEFAULTS ) ACE_THROW_SPEC (( @@ -322,10 +158,10 @@ namespace PortableInterceptor )) = 0; // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_operation/operation_ch.cpp:46 virtual void components_established ( - PortableInterceptor::IORInfo_ptr info + ::PortableInterceptor::IORInfo_ptr info ACE_ENV_ARG_DECL_WITH_DEFAULTS ) ACE_THROW_SPEC (( @@ -333,11 +169,11 @@ namespace PortableInterceptor )) = 0; // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_operation/operation_ch.cpp:46 virtual void adapter_manager_state_changed ( - PortableInterceptor::AdapterManagerId id, - PortableInterceptor::AdapterState state + ::PortableInterceptor::AdapterManagerId id, + ::PortableInterceptor::AdapterState state ACE_ENV_ARG_DECL_WITH_DEFAULTS ) ACE_THROW_SPEC (( @@ -345,11 +181,11 @@ namespace PortableInterceptor )) = 0; // TAO_IDL - Generated from - // be\be_visitor_operation/operation_ch.cpp:46 + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_operation/operation_ch.cpp:46 virtual void adapter_state_changed ( - const PortableInterceptor::ObjectReferenceTemplateSeq & templates, - PortableInterceptor::AdapterState state + const ::PortableInterceptor::ObjectReferenceTemplateSeq & templates, + ::PortableInterceptor::AdapterState state ACE_ENV_ARG_DECL_WITH_DEFAULTS ) ACE_THROW_SPEC (( @@ -357,7 +193,7 @@ namespace PortableInterceptor )) = 0; // TAO_IDL - Generated from - // be\be_visitor_interface/interface_ch.cpp:208 + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_interface/interface_ch.cpp:208 virtual CORBA::Boolean _is_a ( const char *type_id @@ -383,12 +219,12 @@ namespace PortableInterceptor #endif /* end #if !defined */ // TAO_IDL - Generated from -// be\be_visitor_module/module_ch.cpp:66 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_module/module_ch.cpp:66 } // module PortableInterceptor // TAO_IDL - Generated from -// be\be_visitor_traits.cpp:59 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_traits.cpp:59 // Traits specializations. namespace TAO @@ -398,38 +234,17 @@ namespace TAO #define _PORTABLEINTERCEPTOR_IORINTERCEPTOR__TRAITS_CH_ ACE_TEMPLATE_SPECIALIZATION - struct TAO_IORInterceptor_Export Objref_Traits<PortableInterceptor::IORInterceptor> - { - static PortableInterceptor::IORInterceptor_ptr tao_duplicate ( - PortableInterceptor::IORInterceptor_ptr - ); - static void tao_release ( - PortableInterceptor::IORInterceptor_ptr - ); - static PortableInterceptor::IORInterceptor_ptr tao_nil (void); - static CORBA::Boolean tao_marshal ( - PortableInterceptor::IORInterceptor_ptr p, - TAO_OutputCDR & cdr - ); - }; - -#endif /* end #if !defined */ - -#if !defined (_PORTABLEINTERCEPTOR_IORINFO__TRAITS_CH_) -#define _PORTABLEINTERCEPTOR_IORINFO__TRAITS_CH_ - - ACE_TEMPLATE_SPECIALIZATION - struct TAO_IORInterceptor_Export Objref_Traits<PortableInterceptor::IORInfo> + struct TAO_IORInterceptor_Export Objref_Traits< ::PortableInterceptor::IORInterceptor> { - static PortableInterceptor::IORInfo_ptr tao_duplicate ( - PortableInterceptor::IORInfo_ptr + static ::PortableInterceptor::IORInterceptor_ptr tao_duplicate ( + ::PortableInterceptor::IORInterceptor_ptr ); static void tao_release ( - PortableInterceptor::IORInfo_ptr + ::PortableInterceptor::IORInterceptor_ptr ); - static PortableInterceptor::IORInfo_ptr tao_nil (void); + static ::PortableInterceptor::IORInterceptor_ptr tao_nil (void); static CORBA::Boolean tao_marshal ( - PortableInterceptor::IORInfo_ptr p, + ::PortableInterceptor::IORInterceptor_ptr p, TAO_OutputCDR & cdr ); }; @@ -438,10 +253,10 @@ namespace TAO } // TAO_IDL - Generated from -// be\be_codegen.cpp:978 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_codegen.cpp:958 #if defined (__ACE_INLINE__) -#include "IORInterceptorC.i" +#include "IORInterceptorC.inl" #endif /* defined INLINE */ #if defined(_MSC_VER) && (_MSC_VER >= 1200) diff --git a/TAO/tao/PI_ForwardC.i b/TAO/tao/IORInterceptor/IORInterceptorC.inl index 38aa32569ba..38aa32569ba 100644 --- a/TAO/tao/PI_ForwardC.i +++ b/TAO/tao/IORInterceptor/IORInterceptorC.inl diff --git a/TAO/tao/IORInterceptor/IORInterceptor_Adapter_Factory_Impl.cpp b/TAO/tao/IORInterceptor/IORInterceptor_Adapter_Factory_Impl.cpp index 2fa56bf2766..39bf2af372e 100644 --- a/TAO/tao/IORInterceptor/IORInterceptor_Adapter_Factory_Impl.cpp +++ b/TAO/tao/IORInterceptor/IORInterceptor_Adapter_Factory_Impl.cpp @@ -16,7 +16,7 @@ TAO_IORInterceptor_Adapter * TAO_IORInterceptor_Adapter_Factory_Impl::create ( ) ACE_THROW_SPEC ((CORBA::SystemException)) { - TAO_IORInterceptor_Adapter_Impl * new_iorinterceptor_adapter; + TAO_IORInterceptor_Adapter_Impl * new_iorinterceptor_adapter = 0; ACE_NEW_RETURN (new_iorinterceptor_adapter, TAO_IORInterceptor_Adapter_Impl, 0); diff --git a/TAO/tao/IORInterceptor/IORInterceptor_Adapter_Impl.cpp b/TAO/tao/IORInterceptor/IORInterceptor_Adapter_Impl.cpp index 727319bb0e7..ecd898772e8 100644 --- a/TAO/tao/IORInterceptor/IORInterceptor_Adapter_Impl.cpp +++ b/TAO/tao/IORInterceptor/IORInterceptor_Adapter_Impl.cpp @@ -1,7 +1,10 @@ // $Id$ #include "IORInterceptor_Adapter_Impl.h" +#include "IORInfo.h" #include "tao/debug.h" +#include "tao/ORB_Constants.h" +#include "tao/PortableServer/POA.h" ACE_RCSID (IORInterceptor, IORInterceptor_Adapter_Impl, @@ -77,3 +80,162 @@ TAO_IORInterceptor_Adapter_Impl::interceptor_list (void) { return &this->ior_interceptor_list_; } + +void +TAO_IORInterceptor_Adapter_Impl::establish_components ( + TAO_POA* poa + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + TAO_IORInterceptor_List::TYPE & interceptors = + this->ior_interceptor_list_.interceptors (); + + const size_t interceptor_count = interceptors.size (); + + if (interceptor_count == 0) + return; + + TAO_IORInfo *tao_info = 0; + ACE_NEW_THROW_EX (tao_info, + TAO_IORInfo (poa), + CORBA::NO_MEMORY ( + CORBA::SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + ENOMEM), + CORBA::COMPLETED_NO)); + ACE_CHECK; + + PortableInterceptor::IORInfo_var info = tao_info; + + // Release the POA during IORInterceptor calls to avoid potential + // deadlocks. + TAO_Object_Adapter::Non_Servant_Upcall non_servant_upcall (*poa); + ACE_UNUSED_ARG (non_servant_upcall); + + for (size_t i = 0; i < interceptor_count; ++i) + { + ACE_TRY + { + interceptors[i]->establish_components (info.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + // According to the Portable Interceptors specification, + // IORInterceptor::establish_components() must not throw an + // exception. If it does, then the ORB is supposed to + // ignore it and continue processing the remaining + // IORInterceptors. + if (TAO_debug_level > 1) + { + CORBA::String_var name = interceptors[i]->name ( + ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + // @@ What do we do if we get an exception here? + + if (name.in () != 0) + { + ACE_DEBUG ((LM_WARNING, + "(%P|%t) Exception thrown while processing " + "IORInterceptor \"%s\">\n", + ACE_TEXT_CHAR_TO_TCHAR (name.in ()))); + } + + ACE_PRINT_TAO_EXCEPTION (ACE_ANY_EXCEPTION, + "Ignoring exception in " + "IORInterceptor::establish_components"); + } + } + ACE_ENDTRY; + ACE_CHECK; + } + + tao_info->components_established (); + + this->components_established (info.in () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + // The IORInfo instance is no longer valid. Invalidate it to + // prevent the user from peforming "illegal" operations. + tao_info->invalidate (); +} + +void +TAO_IORInterceptor_Adapter_Impl::components_established ( + PortableInterceptor::IORInfo_ptr info + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + // 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_interceptor_list_.interceptors (); + + const size_t interceptor_count = interceptors.size (); + + // All the establish_components() interception points have been + // invoked. Now call the components_established() interception point + // on all the IORInterceptors. + for (size_t j = 0; j < interceptor_count; ++j) + { + ACE_TRY + { + interceptors[j]->components_established ( + info + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_THROW (CORBA::OBJ_ADAPTER (CORBA::OMGVMCID | 6, + CORBA::COMPLETED_NO)); + } + ACE_ENDTRY; + ACE_CHECK; + } +} + +void +TAO_IORInterceptor_Adapter_Impl::adapter_state_changed ( + const TAO_ObjectReferenceTemplate_Array &array_obj_ref_template, + PortableInterceptor::AdapterState state + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + this->ior_interceptor_list_.adapter_state_changed ( + array_obj_ref_template, + state + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; +} + +void +TAO_IORInterceptor_Adapter_Impl::adapter_manager_state_changed ( + PortableInterceptor::AdapterManagerId id, + PortableInterceptor::AdapterState state + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + /// Whenever the POAManager state is changed, the + /// adapter_manager_state_changed method is to be invoked on all the IOR + /// Interceptors. + TAO_IORInterceptor_List::TYPE & interceptors = + this->ior_interceptor_list_.interceptors (); + + const size_t interceptor_count = interceptors.size (); + + if (interceptor_count == 0) + return; + + for (size_t i = 0; i < interceptor_count; ++i) + { + interceptors[i]->adapter_manager_state_changed ( + id, + state + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } +} diff --git a/TAO/tao/IORInterceptor/IORInterceptor_Adapter_Impl.h b/TAO/tao/IORInterceptor/IORInterceptor_Adapter_Impl.h index 160476a9949..8a4a7f82b6f 100644 --- a/TAO/tao/IORInterceptor/IORInterceptor_Adapter_Impl.h +++ b/TAO/tao/IORInterceptor/IORInterceptor_Adapter_Impl.h @@ -27,6 +27,8 @@ #include "ace/Service_Config.h" #include "IORInterceptor_List.h" +class TAO_POA; + /** * @class TAO_IORInterceptor_Adapter_Impl * @@ -42,7 +44,6 @@ class TAO_IORInterceptor_Export TAO_IORInterceptor_Adapter_Impl public: virtual ~TAO_IORInterceptor_Adapter_Impl (void); - virtual void add_interceptor (PortableInterceptor::IORInterceptor_ptr interceptor ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -53,8 +54,28 @@ public: virtual TAO_IORInterceptor_List *interceptor_list (void) ACE_THROW_SPEC ((CORBA::SystemException)); -private: + virtual void establish_components (TAO_POA *poa ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Call the IORInterceptor::components_established() method on all + /// registered IORInterceptors. + virtual void components_established (PortableInterceptor::IORInfo_ptr info + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + virtual void adapter_state_changed ( + const TAO_ObjectReferenceTemplate_Array &array_obj_ref_template, + PortableInterceptor::AdapterState state + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void adapter_manager_state_changed ( + PortableInterceptor::AdapterManagerId id, + PortableInterceptor::AdapterState state + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + +private: /// List of IOR interceptors maintained TAO_IORInterceptor_List ior_interceptor_list_; }; diff --git a/TAO/tao/IORInterceptor/IORInterceptor_List.cpp b/TAO/tao/IORInterceptor/IORInterceptor_List.cpp index d31f6348adc..debefc5ac8b 100644 --- a/TAO/tao/IORInterceptor/IORInterceptor_List.cpp +++ b/TAO/tao/IORInterceptor/IORInterceptor_List.cpp @@ -52,6 +52,41 @@ TAO_IORInterceptor_List::add_interceptor ( PortableInterceptor::IORInterceptor::_duplicate (interceptor); } +void +TAO_IORInterceptor_List::adapter_state_changed ( + const TAO::ORT_Array &array_obj_ref_template, + PortableInterceptor::AdapterState state + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + const size_t interceptor_count = this->interceptors_.size (); + + if (interceptor_count == 0) + return; + + PortableInterceptor::ObjectReferenceTemplateSeq seq_obj_ref_template; + + seq_obj_ref_template.length (array_obj_ref_template.size()); + + for (size_t counter = 0; counter < array_obj_ref_template.size(); ++counter) + { + PortableInterceptor::ObjectReferenceTemplate *member = + array_obj_ref_template[counter]; + + CORBA::add_ref (member); + + seq_obj_ref_template[counter] = member; + } + + for (size_t i = 0; i < interceptor_count; ++i) + { + this->interceptors_[i]->adapter_state_changed (seq_obj_ref_template, + state + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + +} #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) diff --git a/TAO/tao/IORInterceptor/IORInterceptor_List.h b/TAO/tao/IORInterceptor/IORInterceptor_List.h index 3d77e7aec7a..05bd4f9d3c5 100644 --- a/TAO/tao/IORInterceptor/IORInterceptor_List.h +++ b/TAO/tao/IORInterceptor/IORInterceptor_List.h @@ -24,6 +24,7 @@ #include "IORInterceptorC.h" #include "tao/Interceptor_List.h" +#include "tao/PortableServer/ORT_Adapter.h" /** * @class TAO_IORInterceptor_List @@ -53,6 +54,12 @@ public: /// Return reference to the underlying Portable Interceptor array. TYPE & interceptors (void); + void adapter_state_changed ( + const TAO::ORT_Array &array_obj_ref_template, + PortableInterceptor::AdapterState state + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + protected: /// Return the length of the underlying interceptor array. @@ -61,14 +68,13 @@ protected: /// 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); + /// Return the interceptor in array element @a index. + virtual PortableInterceptor::Interceptor_ptr interceptor (size_t index); private: /// Dynamic array of registered IOR interceptors. TYPE interceptors_; - }; diff --git a/TAO/tao/IORInterceptor_Adapter.h b/TAO/tao/IORInterceptor_Adapter.h index 786e0e14141..74988dbb0c6 100644 --- a/TAO/tao/IORInterceptor_Adapter.h +++ b/TAO/tao/IORInterceptor_Adapter.h @@ -16,12 +16,14 @@ #include /**/ "ace/pre.h" #include "ace/Service_Object.h" +#include "ace/Array_Base.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/Exception.h" +#include "tao/PI_ForwardC.h" namespace PortableInterceptor { @@ -29,9 +31,17 @@ namespace PortableInterceptor typedef Interceptor *Interceptor_ptr; class IORInterceptor; typedef IORInterceptor *IORInterceptor_ptr; + class IORInfo; + typedef IORInfo *IORInfo_ptr; + class ObjectReferenceTemplate; } +typedef +ACE_Array_Base<PortableInterceptor::ObjectReferenceTemplate*> + TAO_ObjectReferenceTemplate_Array; + class TAO_IORInterceptor_List; +class TAO_POA; /** * @class TAO_IORInterceptor_Adapter @@ -61,6 +71,34 @@ public: virtual TAO_IORInterceptor_List *interceptor_list (void) ACE_THROW_SPEC ((CORBA::SystemException)) = 0; + /// Call the IORInterceptor::establish_components() method on all + /// registered IORInterceptors. + /** + * This method calls IORInterceptor::establish_components() method + * on all registered IORInterceptors, and + * IORInterceptor::components_established() once the former is + * completed. + */ + virtual void establish_components (TAO_POA *poa ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) = 0; + + /// Call the IORInterceptor::components_established() method on all + /// registered IORInterceptors. + virtual void components_established (PortableInterceptor::IORInfo_ptr info + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) = 0; + + virtual void adapter_state_changed ( + const TAO_ObjectReferenceTemplate_Array &array_obj_ref_template, + PortableInterceptor::AdapterState state + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) = 0; + + virtual void adapter_manager_state_changed ( + PortableInterceptor::AdapterManagerId id, + PortableInterceptor::AdapterState state + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) = 0; }; #include /**/ "ace/post.h" diff --git a/TAO/tao/Makefile.am b/TAO/tao/Makefile.am index 19f6d6f4573..52767bb63cf 100644 --- a/TAO/tao/Makefile.am +++ b/TAO/tao/Makefile.am @@ -7,7 +7,7 @@ ACE_BUILDDIR = $(top_builddir)/.. TAO_ROOT = $(top_srcdir) TAO_BUILDDIR = $(top_builddir) -## Makefile.TAO.am +## Makefile.TAO.am ORB_Core = \ Abstract_Servant_Base.cpp \ @@ -780,7 +780,7 @@ nobase_include_HEADERS = \ Objref_VarOut_T.inl \ OctetSeqC.inl \ PICurrent.inl \ - PI_ForwardC.i \ + PI_ForwardC.inl \ Parser_Registry.i \ Pluggable_Messaging.i \ Pluggable_Messaging_Utils.i \ @@ -951,7 +951,7 @@ nobase_include_HEADERS = \ EXTRA_DIST = \ tao.rc -## Makefile.BiDir_GIOP.am +## Makefile.BiDir_GIOP.am lib_LTLIBRARIES += libTAO_BiDirGIOP.la @@ -992,7 +992,7 @@ nobase_include_HEADERS += \ EXTRA_DIST += \ BiDir_GIOP/TAO_BiDir_GIOP.rc -## Makefile.Valuetype.am +## Makefile.Valuetype.am lib_LTLIBRARIES += libTAO_Valuetype.la @@ -1044,7 +1044,7 @@ nobase_include_HEADERS += \ EXTRA_DIST += \ Valuetype/TAO_Valuetype.rc -## Makefile.ObjRefTemplate.am +## Makefile.ObjRefTemplate.am lib_LTLIBRARIES += libTAO_ObjRefTemplate.la @@ -1056,26 +1056,36 @@ libTAO_ObjRefTemplate_la_CPPFLAGS = \ -DTAO_ORT_BUILD_DLL libTAO_ObjRefTemplate_la_SOURCES = \ - ObjRefTemplate/ObjectReferenceTemplateC.cpp + ObjRefTemplate/ORT_Adapter_Factory_Impl.cpp \ + ObjRefTemplate/ORT_Adapter_Impl.cpp \ + ObjRefTemplate/ObjectReferenceTemplate_i.cpp \ + ObjRefTemplate/ObjectReferenceTemplateC.cpp \ + ObjRefTemplate/Default_ORTC.cpp libTAO_ObjRefTemplate_la_LDFLAGS = \ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@ libTAO_ObjRefTemplate_la_LIBADD = \ + libTAO_PortableServer.la \ libTAO_Valuetype.la \ libTAO.la \ $(ACE_BUILDDIR)/ace/libACE.la nobase_include_HEADERS += \ + ObjRefTemplate/ORT_Adapter_Factory_Impl.h \ + ObjRefTemplate/ORT_Adapter_Impl.h \ + ObjRefTemplate/ObjectReferenceTemplate_i.h \ ObjRefTemplate/ObjectReferenceTemplateC.h \ ObjRefTemplate/ort_export.h \ - ObjRefTemplate/ObjectReferenceTemplateC.i \ - ObjRefTemplate/ObjectReferenceTemplate.pidl + ObjRefTemplate/ObjectReferenceTemplateC.inl \ + ObjRefTemplate/ObjectReferenceTemplate.pidl \ + ObjRefTemplate/Default_ORTC.inl \ + ObjRefTemplate/Default_ORT.pidl EXTRA_DIST += \ ObjRefTemplate/TAO_ObjRefTemplate.rc -## Makefile.IORInterceptor.am +## Makefile.IORInterceptor.am lib_LTLIBRARIES += libTAO_IORInterceptor.la @@ -1087,6 +1097,7 @@ libTAO_IORInterceptor_la_CPPFLAGS = \ -DTAO_IORINTERCEPTOR_BUILD_DLL libTAO_IORInterceptor_la_SOURCES = \ + IORInterceptor/IORInfo.cpp \ IORInterceptor/IORInterceptorC.cpp \ IORInterceptor/IORInterceptor_Adapter_Factory_Impl.cpp \ IORInterceptor/IORInterceptor_Adapter_Impl.cpp \ @@ -1098,23 +1109,25 @@ libTAO_IORInterceptor_la_LDFLAGS = \ libTAO_IORInterceptor_la_LIBADD = \ libTAO_ObjRefTemplate.la \ libTAO_Valuetype.la \ + libTAO_PortableServer.la \ libTAO.la \ $(ACE_BUILDDIR)/ace/libACE.la nobase_include_HEADERS += \ IORInterceptor/IORInterceptorC.h \ + IORInterceptor/IORInfo.h \ IORInterceptor/IORInterceptor_Adapter_Factory_Impl.h \ IORInterceptor/IORInterceptor_Adapter_Impl.h \ IORInterceptor/IORInterceptor_List.h \ IORInterceptor/iorinterceptor_export.h \ - IORInterceptor/IORInterceptorC.i \ + IORInterceptor/IORInterceptorC.inl \ IORInterceptor/IORInterceptor_List.inl \ IORInterceptor/IORInterceptor.pidl EXTRA_DIST += \ IORInterceptor/TAO_IORInterceptor.rc -## Makefile.PortableServer.am +## Makefile.PortableServer.am lib_LTLIBRARIES += libTAO_PortableServer.la @@ -1130,10 +1143,8 @@ libTAO_PortableServer_la_SOURCES = \ PortableServer/Active_Object_Map.cpp \ PortableServer/Collocated_Object_Proxy_Broker.cpp \ PortableServer/Default_Acceptor_Filter.cpp \ - PortableServer/Default_ORTC.cpp \ PortableServer/Default_Policy_Validator.cpp \ PortableServer/Default_Servant_Dispatcher.cpp \ - PortableServer/IORInfo.cpp \ PortableServer/ImR_LocatorC.cpp \ PortableServer/ImR_LocatorS.cpp \ PortableServer/ImplRepoC.cpp \ @@ -1141,8 +1152,9 @@ libTAO_PortableServer_la_SOURCES = \ PortableServer/ImplRepo_i.cpp \ PortableServer/Key_Adapters.cpp \ PortableServer/ORB_Manager.cpp \ - PortableServer/ObjectReferenceTemplate.cpp \ PortableServer/Object_Adapter.cpp \ + PortableServer/ORT_Adapter.cpp \ + PortableServer/ORT_Adapter_Factory.cpp \ PortableServer/Operation_Table.cpp \ PortableServer/PICurrent_Guard.cpp \ PortableServer/POA.cpp \ @@ -1166,9 +1178,6 @@ libTAO_PortableServer_la_LDFLAGS = \ -version-number @TAO_MAJOR@:@TAO_MINOR@:@TAO_BETA@ libTAO_PortableServer_la_LIBADD = \ - libTAO_IORInterceptor.la \ - libTAO_ObjRefTemplate.la \ - libTAO_Valuetype.la \ libTAO.la \ $(ACE_BUILDDIR)/ace/libACE.la @@ -1177,10 +1186,8 @@ nobase_include_HEADERS += \ PortableServer/Active_Object_Map.h \ PortableServer/Collocated_Object_Proxy_Broker.h \ PortableServer/Default_Acceptor_Filter.h \ - PortableServer/Default_ORTC.h \ PortableServer/Default_Policy_Validator.h \ PortableServer/Default_Servant_Dispatcher.h \ - PortableServer/IORInfo.h \ PortableServer/ImR_LocatorC.h \ PortableServer/ImR_LocatorS.h \ PortableServer/ImplRepoC.h \ @@ -1188,9 +1195,10 @@ nobase_include_HEADERS += \ PortableServer/ImplRepo_i.h \ PortableServer/Key_Adapters.h \ PortableServer/ORB_Manager.h \ - PortableServer/ObjectReferenceTemplate.h \ PortableServer/Object_Adapter.h \ PortableServer/Operation_Table.h \ + PortableServer/ORT_Adapter.h \ + PortableServer/ORT_Adapter_Factory.h \ PortableServer/PICurrent_Guard.h \ PortableServer/POA.h \ PortableServer/POAManager.h \ @@ -1213,23 +1221,20 @@ nobase_include_HEADERS += \ PortableServer/poa_macros.h \ PortableServer/portableserver_export.h \ PortableServer/Active_Object_Map.i \ - PortableServer/Default_ORTC.i \ - PortableServer/IORInfo.inl \ - PortableServer/ImR_LocatorC.i \ - PortableServer/ImR_LocatorS.i \ - PortableServer/ImplRepoC.i \ - PortableServer/ImplRepoS.i \ + PortableServer/ImR_LocatorC.inl \ + PortableServer/ImR_LocatorS.inl \ + PortableServer/ImplRepoC.inl \ + PortableServer/ImplRepoS.inl \ PortableServer/Key_Adapters.i \ - PortableServer/ObjectReferenceTemplate.inl \ PortableServer/Object_Adapter.i \ PortableServer/POA.i \ PortableServer/POAManager.i \ PortableServer/POA_Cached_Policies.i \ PortableServer/POA_Policies.i \ PortableServer/POA_Policy_Set.i \ - PortableServer/PolicyS.i \ - PortableServer/PolicyS_T.i \ - PortableServer/PortableServerC.i \ + PortableServer/PolicyS.inl \ + PortableServer/PolicyS_T.inl \ + PortableServer/PortableServerC.inl \ PortableServer/Servant_Base.i \ PortableServer/ServerInterceptorAdapter.inl \ PortableServer/ServerRequestInfo.inl \ @@ -1242,7 +1247,7 @@ nobase_include_HEADERS += \ EXTRA_DIST += \ PortableServer/TAO_PortableServer.rc -## Makefile.IFR_Client.am +## Makefile.IFR_Client.am lib_LTLIBRARIES += libTAO_IFR_Client.la @@ -1291,7 +1296,7 @@ nobase_include_HEADERS += \ EXTRA_DIST += \ IFR_Client/TAO_IFR_Client.rc -## Makefile.Domain.am +## Makefile.Domain.am lib_LTLIBRARIES += libTAO_Domain.la @@ -1328,7 +1333,7 @@ nobase_include_HEADERS += \ EXTRA_DIST += \ Domain/TAO_Domain.rc -## Makefile.DynamicAny.am +## Makefile.DynamicAny.am lib_LTLIBRARIES += libTAO_DynamicAny.la @@ -1377,7 +1382,7 @@ nobase_include_HEADERS += \ EXTRA_DIST += \ DynamicAny/TAO_DynamicAny.rc -## Makefile.Messaging.am +## Makefile.Messaging.am lib_LTLIBRARIES += libTAO_Messaging.la @@ -1454,7 +1459,7 @@ nobase_include_HEADERS += \ EXTRA_DIST += \ Messaging/TAO_Messaging.rc -## Makefile.DynamicInterface.am +## Makefile.DynamicInterface.am if !BUILD_MINIMUM_CORBA @@ -1518,7 +1523,7 @@ endif !BUILD_MINIMUM_CORBA EXTRA_DIST += \ DynamicInterface/TAO_DynamicInterface.rc -## Makefile.IORManipulation.am +## Makefile.IORManipulation.am lib_LTLIBRARIES += libTAO_IORManip.la @@ -1553,7 +1558,7 @@ nobase_include_HEADERS += \ EXTRA_DIST += \ IORManipulation/TAO_IORManip.rc -## Makefile.IORTable.am +## Makefile.IORTable.am lib_LTLIBRARIES += libTAO_IORTable.la @@ -1589,7 +1594,7 @@ nobase_include_HEADERS += \ EXTRA_DIST += \ IORTable/TAO_IORTable.rc -## Makefile.RTCORBA.am +## Makefile.RTCORBA.am if BUILD_RT_CORBA @@ -1700,7 +1705,7 @@ endif BUILD_RT_CORBA EXTRA_DIST += \ RTCORBA/TAO_RTCORBA.rc -## Makefile.RTPortableServer.am +## Makefile.RTPortableServer.am if BUILD_RT_CORBA @@ -1757,7 +1762,7 @@ endif BUILD_RT_CORBA EXTRA_DIST += \ RTPortableServer/TAO_RTPortableServer.rc -## Makefile.RTScheduler.am +## Makefile.RTScheduler.am if BUILD_RT_CORBA if BUILD_CORBA_MESSAGING @@ -1816,7 +1821,7 @@ endif BUILD_RT_CORBA EXTRA_DIST += \ RTScheduling/TAO_RTScheduler.rc -## Makefile.SmartProxies.am +## Makefile.SmartProxies.am lib_LTLIBRARIES += libTAO_SmartProxies.la @@ -1845,7 +1850,7 @@ nobase_include_HEADERS += \ EXTRA_DIST += \ SmartProxies/SmartProxies.rc -## Makefile.Strategies.am +## Makefile.Strategies.am lib_LTLIBRARIES += libTAO_Strategies.la @@ -1970,7 +1975,7 @@ nobase_include_HEADERS += \ EXTRA_DIST += \ Strategies/TAO_Strategies.rc -## Makefile.TypeCodeFactory.am +## Makefile.TypeCodeFactory.am lib_LTLIBRARIES += libTAO_TypeCodeFactory.la @@ -2007,7 +2012,7 @@ nobase_include_HEADERS += \ EXTRA_DIST += \ TypeCodeFactory/TypeCodeFactory.rc -## Makefile.Utils.am +## Makefile.Utils.am lib_LTLIBRARIES += libTAO_Utils.la diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index 263868b0201..bfc77ab79ae 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -2770,17 +2770,6 @@ TAO_ORB_Core::add_interceptor ( } } -TAO_IORInterceptor_List * -TAO_ORB_Core::ior_interceptor_list (void) -{ - if (this->ior_interceptor_adapter ()) - { - return this->ior_interceptor_adapter_->interceptor_list (); - } - - return 0; -} - TAO_IORInterceptor_Adapter * TAO_ORB_Core::ior_interceptor_adapter (void) { @@ -2815,6 +2804,7 @@ TAO_ORB_Core::ior_interceptor_adapter (void) "ior_interceptor_adapter \n"); } ACE_ENDTRY; + ACE_CHECK_RETURN(0); } } diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h index e6cdddce1d2..2a879aa4216 100644 --- a/TAO/tao/ORB_Core.h +++ b/TAO/tao/ORB_Core.h @@ -85,7 +85,6 @@ class TAO_Policy_Manager; class TAO_Policy_Current; class TAO_Codeset_Manager; -class TAO_IORInterceptor_List; class TAO_IORInterceptor_Adapter; class TAO_Valuetype_Adapter; @@ -935,13 +934,15 @@ public: void add_interceptor ( PortableInterceptor::IORInterceptor_ptr interceptor ACE_ENV_ARG_DECL); - - TAO_IORInterceptor_List *ior_interceptor_list (void); //@} /// Return the valuetype adapter TAO_Valuetype_Adapter *& valuetype_adapter (void); + /// Get the IOR Interceptor adapter. If not created, this method will try + /// to create one. + TAO_IORInterceptor_Adapter *ior_interceptor_adapter (void); + /// Set and Get methods to indicate whether a BiDir IIOP policy has /// been set in the POA. /// @note At present, the value will be true even if one of the POA's @@ -1077,8 +1078,6 @@ private: CORBA::Boolean is_collocation_enabled (TAO_ORB_Core *other_orb, const TAO_MProfile &mp); - TAO_IORInterceptor_Adapter *ior_interceptor_adapter (void); - protected: /// Synchronize internal state... diff --git a/TAO/tao/PortableServer/Default_ORT.pidl b/TAO/tao/ObjRefTemplate/Default_ORT.pidl index 0817f88a146..fa23ac6cb41 100644 --- a/TAO/tao/PortableServer/Default_ORT.pidl +++ b/TAO/tao/ObjRefTemplate/Default_ORT.pidl @@ -12,27 +12,12 @@ * tao_idl.exe * -o orig -Ge 1 -GT -Sc * -I../.. - * -Wb,export_macro=TAO_PortableServer_Export \ - * -Wb,export_include="portableserver_export.h" \ + * -Wb,export_macro=TAO_ORT_Export \ + * -Wb,export_include="ort_export.h" \ * -Wb,pre_include="ace/pre.h" * -Wb,post_include="ace/post.h" * Default_ORT.pidl * - * and then: - * - * cp orig/Default_ORTC.{h,i,cpp} . - * patch < diffs/Default_ORT.diff - * - * The code left in Default_ORTC.{h,i,cpp} is - * ready for use. - * - * - * @note The diffs were generated using: - * - * rm diffs/Default_ORT.diff - * for i in Default_ORTC.{h,i,cpp}; do - * diff -wub orig/$i $i >> diffs/Default_ORT.diff - * done */ #ifndef TAO_DEFAULT_ORT_PIDL diff --git a/TAO/tao/PortableServer/Default_ORTC.cpp b/TAO/tao/ObjRefTemplate/Default_ORTC.cpp index 030e2282cb1..030e2282cb1 100644 --- a/TAO/tao/PortableServer/Default_ORTC.cpp +++ b/TAO/tao/ObjRefTemplate/Default_ORTC.cpp diff --git a/TAO/tao/PortableServer/Default_ORTC.h b/TAO/tao/ObjRefTemplate/Default_ORTC.h index 5ec169a3ec4..9a3d1b72180 100644 --- a/TAO/tao/PortableServer/Default_ORTC.h +++ b/TAO/tao/ObjRefTemplate/Default_ORTC.h @@ -39,19 +39,19 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "portableserver_export.h" +#include "ort_export.h" #if defined (TAO_EXPORT_MACRO) #undef TAO_EXPORT_MACRO #endif -#define TAO_EXPORT_MACRO TAO_PortableServer_Export +#define TAO_EXPORT_MACRO TAO_ORT_Export #if defined (TAO_EXPORT_NESTED_CLASSES) # if defined (TAO_EXPORT_NESTED_MACRO) # undef TAO_EXPORT_NESTED_MACRO # endif /* defined (TAO_EXPORT_NESTED_MACRO) */ -# define TAO_EXPORT_NESTED_MACRO TAO_PortableServer_Export +# define TAO_EXPORT_NESTED_MACRO TAO_ORT_Export #endif /* TAO_EXPORT_NESTED_CLASSES */ #if defined(_MSC_VER) @@ -70,22 +70,22 @@ namespace TAO_Default_ORT { - + // TAO_IDL - Generated from // be\be_valuetype.cpp:527 - - + + #if !defined (_TAO_DEFAULT_ORT_OBJECTREFERENCETEMPLATE__VAR_OUT_CH_) #define _TAO_DEFAULT_ORT_OBJECTREFERENCETEMPLATE__VAR_OUT_CH_ - + class ObjectReferenceTemplate; typedef TAO_Value_Var_T< ObjectReferenceTemplate > ObjectReferenceTemplate_var; - + typedef TAO_Value_Out_T< ObjectReferenceTemplate @@ -93,61 +93,61 @@ namespace TAO_Default_ORT ObjectReferenceTemplate_out; #endif /* end #if !defined */ - + // TAO_IDL - Generated from // be\be_visitor_valuetype/valuetype_ch.cpp:56 #if !defined (_TAO_DEFAULT_ORT_OBJECTREFERENCETEMPLATE_CH_) #define _TAO_DEFAULT_ORT_OBJECTREFERENCETEMPLATE_CH_ - - class TAO_PortableServer_Export ObjectReferenceTemplate + + class TAO_ORT_Export ObjectReferenceTemplate : public virtual PortableInterceptor::ObjectReferenceTemplate { public: typedef ObjectReferenceTemplate_var _var_type; - + static ObjectReferenceTemplate* _downcast (CORBA::ValueBase *); - + // (TAO extensions or internals) static CORBA::Boolean _tao_unmarshal ( TAO_InputCDR &, ObjectReferenceTemplate *& ); - + virtual const char* _tao_obv_repository_id (void) const; - + static const char* _tao_obv_static_repository_id (void); - + static void _tao_any_destructor (void *); - + // TAO_IDL - Generated from // be\be_visitor_valuetype/valuetype_ch.cpp:250 - + protected: ObjectReferenceTemplate (void); - + virtual ~ObjectReferenceTemplate (void); - + virtual CORBA::Boolean _tao_marshal_v (TAO_OutputCDR &); virtual CORBA::Boolean _tao_unmarshal_v (TAO_InputCDR &); - + private: ObjectReferenceTemplate (const ObjectReferenceTemplate &); void operator= (const ObjectReferenceTemplate &); - + protected: virtual CORBA::Boolean _tao_marshal__TAO_Default_ORT_ObjectReferenceTemplate (TAO_OutputCDR &) = 0; - + virtual CORBA::Boolean _tao_unmarshal__TAO_Default_ORT_ObjectReferenceTemplate (TAO_InputCDR &) = 0; }; #endif /* end #if !defined */ - + // TAO_IDL - Generated from // be\be_visitor_typecode/typecode_decl.cpp:44 - + TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr _tc_ObjectReferenceTemplate; // TAO_IDL - Generated from @@ -160,33 +160,33 @@ namespace TAO_Default_ORT namespace OBV_TAO_Default_ORT { - + // TAO_IDL - Generated from // be\be_visitor_valuetype/valuetype_obv_ch.cpp:58 #if !defined (_TAO_DEFAULT_ORT_OBJECTREFERENCETEMPLATE___OBV_CH_) #define _TAO_DEFAULT_ORT_OBJECTREFERENCETEMPLATE___OBV_CH_ - + // OBV_ class - class TAO_PortableServer_Export ObjectReferenceTemplate + class TAO_ORT_Export ObjectReferenceTemplate : public virtual TAO_Default_ORT::ObjectReferenceTemplate { public: - + protected: ObjectReferenceTemplate (void); virtual ~ObjectReferenceTemplate (void); - + protected: virtual CORBA::Boolean _tao_marshal__TAO_Default_ORT_ObjectReferenceTemplate (TAO_OutputCDR &); - + virtual CORBA::Boolean _tao_unmarshal__TAO_Default_ORT_ObjectReferenceTemplate (TAO_InputCDR &); - + CORBA::Boolean _tao_marshal_state (TAO_OutputCDR &); CORBA::Boolean _tao_unmarshal_state (TAO_InputCDR &); - + private: }; @@ -202,9 +202,9 @@ namespace TAO #if !defined (_TAO_DEFAULT_ORT_OBJECTREFERENCETEMPLATE__TRAITS_CH_) #define _TAO_DEFAULT_ORT_OBJECTREFERENCETEMPLATE__TRAITS_CH_ - + ACE_TEMPLATE_SPECIALIZATION - struct TAO_PortableServer_Export Value_Traits<TAO_Default_ORT::ObjectReferenceTemplate> + struct TAO_ORT_Export Value_Traits<TAO_Default_ORT::ObjectReferenceTemplate> { static void tao_add_ref (TAO_Default_ORT::ObjectReferenceTemplate *); static void tao_remove_ref (TAO_Default_ORT::ObjectReferenceTemplate *); @@ -217,9 +217,9 @@ namespace TAO // TAO_IDL - Generated from // be\be_visitor_valuetype/any_op_ch.cpp:54 -TAO_PortableServer_Export void operator<<= (CORBA::Any &, TAO_Default_ORT::ObjectReferenceTemplate *); // copying -TAO_PortableServer_Export void operator<<= (CORBA::Any &, TAO_Default_ORT::ObjectReferenceTemplate **); // non-copying -TAO_PortableServer_Export CORBA::Boolean operator>>= (const CORBA::Any &, TAO_Default_ORT::ObjectReferenceTemplate *&); +TAO_ORT_Export void operator<<= (CORBA::Any &, TAO_Default_ORT::ObjectReferenceTemplate *); // copying +TAO_ORT_Export void operator<<= (CORBA::Any &, TAO_Default_ORT::ObjectReferenceTemplate **); // non-copying +TAO_ORT_Export CORBA::Boolean operator>>= (const CORBA::Any &, TAO_Default_ORT::ObjectReferenceTemplate *&); // TAO_IDL - Generated from // be\be_valuetype.cpp:434 @@ -233,8 +233,8 @@ namespace CORBA // TAO_IDL - Generated from // be\be_visitor_valuetype/cdr_op_ch.cpp:61 -TAO_PortableServer_Export CORBA::Boolean operator<< (TAO_OutputCDR &, const TAO_Default_ORT::ObjectReferenceTemplate *); -TAO_PortableServer_Export CORBA::Boolean operator>> (TAO_InputCDR &, TAO_Default_ORT::ObjectReferenceTemplate *&); +TAO_ORT_Export CORBA::Boolean operator<< (TAO_OutputCDR &, const TAO_Default_ORT::ObjectReferenceTemplate *); +TAO_ORT_Export CORBA::Boolean operator>> (TAO_InputCDR &, TAO_Default_ORT::ObjectReferenceTemplate *&); // TAO_IDL - Generated from // be\be_codegen.cpp:978 diff --git a/TAO/tao/PortableServer/Default_ORTC.i b/TAO/tao/ObjRefTemplate/Default_ORTC.i index dcda17bcba3..dcda17bcba3 100644 --- a/TAO/tao/PortableServer/Default_ORTC.i +++ b/TAO/tao/ObjRefTemplate/Default_ORTC.i diff --git a/TAO/tao/ObjRefTemplate/ORT_Adapter_Factory_Impl.cpp b/TAO/tao/ObjRefTemplate/ORT_Adapter_Factory_Impl.cpp new file mode 100644 index 00000000000..76cd19704ce --- /dev/null +++ b/TAO/tao/ObjRefTemplate/ORT_Adapter_Factory_Impl.cpp @@ -0,0 +1,60 @@ +// $Id$ + +#include "ORT_Adapter_Factory_Impl.h" +#include "ORT_Adapter_Impl.h" +#include "tao/PortableServer/POA.h" + +ACE_RCSID (ORT, + ORT_Adapter_Factory_Impl, + "$Id$") + +namespace TAO +{ + ORT_Adapter_Factory_Impl::~ORT_Adapter_Factory_Impl (void) + { + } + + ORT_Adapter * + ORT_Adapter_Factory_Impl::create (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + ORT_Adapter_Impl * new_ort_adapter = 0; + + ACE_NEW_THROW_EX (new_ort_adapter, + TAO::ORT_Adapter_Impl, + CORBA::NO_MEMORY ()); + ACE_CHECK_RETURN (0); + + return new_ort_adapter; + } + + void + ORT_Adapter_Factory_Impl::destroy (ORT_Adapter * adapter + ACE_ENV_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + delete adapter; + } + + int + ORT_Adapter_Factory_Impl::Initializer (void) + { + TAO_POA::ort_adapter_factory_name ("Concrete_ORT_Adapter_Factory" + ); + + return + ACE_Service_Config::process_directive ( + ace_svc_desc_ORT_Adapter_Factory_Impl + ); + } + + ACE_STATIC_SVC_DEFINE ( + ORT_Adapter_Factory_Impl, + ACE_TEXT ("Concrete_ORT_Adapter_Factory"), + ACE_SVC_OBJ_T, + &ACE_SVC_NAME (ORT_Adapter_Factory_Impl), + ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, + 0) + + ACE_FACTORY_DEFINE (TAO_ORT, ORT_Adapter_Factory_Impl) +} diff --git a/TAO/tao/ObjRefTemplate/ORT_Adapter_Factory_Impl.h b/TAO/tao/ObjRefTemplate/ORT_Adapter_Factory_Impl.h new file mode 100644 index 00000000000..57f66060391 --- /dev/null +++ b/TAO/tao/ObjRefTemplate/ORT_Adapter_Factory_Impl.h @@ -0,0 +1,82 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file ORT_Adapter_Factory_Impl.h + * + * $Id$ + * + * @author Johnny Willemsen <jwillemsen@remedy.nl> + */ +//============================================================================= + +#ifndef TAO_ORT_ADAPTER_FACTORY_IMPL_H +#define TAO_ORT_ADAPTER_FACTORY_IMPL_H + +#include /**/ "ace/pre.h" + +#include "ace/Service_Config.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ort_export.h" +#include "tao/PortableServer/ORT_Adapter_Factory.h" + +namespace TAO +{ + /** + * @class ORT_Adapter_Factory_Impl + * + * @brief ORT_Adapter_Factory_Impl + * + * Class that creates instances of TAO::ORT_Adapter + * (one per POA). This is the derived class that contains the actual + * implementation. + */ + class TAO_ORT_Export ORT_Adapter_Factory_Impl + : public ORT_Adapter_Factory + { + public: + virtual ~ORT_Adapter_Factory_Impl (void); + + /// Create an adapter + virtual TAO::ORT_Adapter * create ( + ACE_ENV_SINGLE_ARG_DECL + ) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Destroy an adapter that is created by this factory + virtual void destroy ( + TAO::ORT_Adapter * adapter + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + // Used to force the initialization of the code. + static int Initializer (void); + }; + + ACE_STATIC_SVC_DECLARE (ORT_Adapter_Factory_Impl) + ACE_FACTORY_DECLARE (TAO_ORT, ORT_Adapter_Factory_Impl) +} + +#if defined (ACE_HAS_BROKEN_STATIC_CONSTRUCTORS) + +typedef int (*TAO_Module_Initializer) (void); + +static TAO_Module_Initializer + TAO_Requires_ORTFactory_Initializer = + &TAO::ORT_Adapter_Factory_Impl::Initializer; + + #else + + static int + TAO_Requires_ORTFactory_Initializer = + TAO::ORT_Adapter_Factory_Impl::Initializer (); + + #endif /* ACE_HAS_BROKEN_STATIC_CONSTRUCTORS */ + +#include /**/ "ace/post.h" + +#endif /* TAO_ORT_ADAPTER_FACTORY_IMPL_H */ diff --git a/TAO/tao/ObjRefTemplate/ORT_Adapter_Impl.cpp b/TAO/tao/ObjRefTemplate/ORT_Adapter_Impl.cpp new file mode 100644 index 00000000000..c89354ab9ab --- /dev/null +++ b/TAO/tao/ObjRefTemplate/ORT_Adapter_Impl.cpp @@ -0,0 +1,115 @@ +// $Id$ + +#include "ORT_Adapter_Impl.h" +#include "tao/PortableServer/POA.h" +#include "tao/CORBA_String.h" +#include "tao/ORB_Constants.h" +#include "tao/CORBA_methods.h" + +ACE_RCSID (ORT, + ORT_Adapter_Impl, + "$Id$") + +namespace TAO +{ + ORT_Adapter_Impl::ORT_Adapter_Impl (void) + : tao_ort_template_ (0) + { + } + + ORT_Adapter_Impl::~ORT_Adapter_Impl (void) + { + } + + char * + ORT_Adapter_Impl::tao_server_id (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + // No need to duplicate, the ort_template_ method has to do the duplicate + return this->ort_template_->server_id (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + char * + ORT_Adapter_Impl::tao_orb_id (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + // No need to duplicate, the ort_template_ method has to do the duplicate + return this->ort_template_->orb_id (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + PortableInterceptor::AdapterName * + ORT_Adapter_Impl::tao_adapter_name (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + // No need to duplicate, the ort_template_ method has to do the duplicate + return this->ort_template_->adapter_name (ACE_ENV_SINGLE_ARG_PARAMETER); + } + + CORBA::Object_ptr + ORT_Adapter_Impl::make_object (const char *repo_id, + const PortableInterceptor::ObjectId &id + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return this->ort_factory_->make_object (repo_id, + id + ACE_ENV_ARG_PARAMETER); + } + + PortableInterceptor::ObjectReferenceTemplate * + ORT_Adapter_Impl::get_adapter_template (void) + { + CORBA::add_ref (ort_template_.in ()); + + return ort_template_; + } + + PortableInterceptor::ObjectReferenceFactory * + ORT_Adapter_Impl::get_obj_ref_factory (void) + { + CORBA::add_ref (ort_factory_.in ()); + + return ort_factory_; + } + + int + ORT_Adapter_Impl::set_obj_ref_factory ( + PortableInterceptor::ObjectReferenceFactory *cf + ACE_ENV_ARG_DECL_NOT_USED) + { + ort_factory_ = cf; + + CORBA::add_ref (ort_factory_.in ()); + + return 0; + } + + int + ORT_Adapter_Impl::activate (const char *server_id, + const char *orb_id, + PortableInterceptor::AdapterName *adapter_name, + PortableServer::POA_ptr poa + ACE_ENV_ARG_DECL) + { + // No need to lock here, there is one instance for each POA and + // when the POA creates and actives an ORT_Adapter it will lock + // itself. Create an ObjectReferenceTemplate for this POA. + + ACE_NEW_THROW_EX (this->tao_ort_template_, + ObjectReferenceTemplate (server_id, + orb_id, + adapter_name, + poa), + CORBA::NO_MEMORY ()); + ACE_CHECK_RETURN (-1); + + this->ort_template_ = this->tao_ort_template_; + + // Must increase ref count since this->obj_ref_factory_ will + // decrease it upon destruction. + CORBA::add_ref (this->ort_template_.in ()); + this->ort_factory_ = this->ort_template_; + + return 0; + } +} diff --git a/TAO/tao/ObjRefTemplate/ORT_Adapter_Impl.h b/TAO/tao/ObjRefTemplate/ORT_Adapter_Impl.h new file mode 100644 index 00000000000..9fc3181c25b --- /dev/null +++ b/TAO/tao/ObjRefTemplate/ORT_Adapter_Impl.h @@ -0,0 +1,124 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file ORT_Adapter_Impl.h + * + * $Id$ + * + * This is the implementation of the TAO::ORT_Adapter + * + * @author Johnny Willemsen <jwillemsen@remedy.nl> + */ +//============================================================================= + +#ifndef TAO_ORT_ADAPTER_IMPL_H +#define TAO_ORT_ADAPTER_IMPL_H + +#include /**/ "ace/pre.h" + +#include "ort_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/PortableServer/ORT_Adapter.h" +#include "tao/ObjRefTemplate/ObjectReferenceTemplate_i.h" + +#if defined(_MSC_VER) +#if (_MSC_VER >= 1200) +#pragma warning(push) +#endif /* _MSC_VER >= 1200 */ +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +namespace TAO +{ + /** + * @class ObjectReferenceTemplate_Adapter_Impl + * + * @brief Implementation of the TAO::ORT_Adapter + */ + class TAO_ORT_Export ORT_Adapter_Impl + : public ORT_Adapter + { + public: + ORT_Adapter_Impl (void); + + /// Activate this adapter + virtual int activate (const char *server_id, + const char *orb_id, + PortableInterceptor::AdapterName *adapter_name, + PortableServer::POA_ptr poa + ACE_ENV_ARG_DECL); + + /// Set a different ort_factory to be used. + virtual int set_obj_ref_factory ( + PortableInterceptor::ObjectReferenceFactory *current_factory + ACE_ENV_ARG_DECL); + + /// Accessor methods to ObjectReferenceTemplate template + virtual PortableInterceptor::ObjectReferenceTemplate *get_adapter_template (void); + + /// Accessor methods to PortableInterceptor::ObjectReferenceFactory + virtual PortableInterceptor::ObjectReferenceFactory * get_obj_ref_factory (void); + + /** + * @name Adapter methods for PortableInterceptor::ObjectReferenceTemplate + * Methods + */ + //@{ + virtual char * tao_server_id (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual char * tao_orb_id (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual PortableInterceptor::AdapterName * tao_adapter_name ( + ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + //@} + + /** + * @name PortableInterceptor::ObjectReferenceFactory Methods + * + * Methods required by the + * PortableInterceptor::ObjectReferenceFactory ValueType. + */ + //@{ + virtual CORBA::Object_ptr make_object ( + const char * repository_id, + const PortableInterceptor::ObjectId & id + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + //@} + + protected: + + /// Destructor + /** + * Protected destructor to enforce proper memory management via + * reference counting. + */ + virtual ~ORT_Adapter_Impl (void); + + private: + /// The ORT Template, this is the factory and its identify + PortableInterceptor::ObjectReferenceTemplate_var ort_template_; + + /// The ORT Factory + PortableInterceptor::ObjectReferenceFactory_var ort_factory_; + + /// TAO specific ORT Template + ObjectReferenceTemplate* tao_ort_template_; + }; + +} +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#include /**/ "ace/post.h" + +#endif /* TAO_ORT_ADAPTER_IMPL_H */ diff --git a/TAO/tao/ObjRefTemplate/ObjectReferenceTemplate.pidl b/TAO/tao/ObjRefTemplate/ObjectReferenceTemplate.pidl index cae4150604a..34e55bb51a4 100644 --- a/TAO/tao/ObjRefTemplate/ObjectReferenceTemplate.pidl +++ b/TAO/tao/ObjRefTemplate/ObjectReferenceTemplate.pidl @@ -33,7 +33,6 @@ #ifndef _OBJECT_REFERENCE_TEMPLATE_IDL_ #define _OBJECT_REFERENCE_TEMPLATE_IDL_ -#include <orb.idl> #include "tao/PI_Forward.pidl" module PortableInterceptor @@ -55,15 +54,6 @@ module PortableInterceptor }; typedef sequence<ObjectReferenceTemplate> ObjectReferenceTemplateSeq; - - typedef long AdapterManagerId; - - typedef short AdapterState; - const AdapterState HOLDING = 0; - const AdapterState ACTIVE = 1; - const AdapterState DISCARDING = 2; - const AdapterState INACTIVE = 3; - const AdapterState NON_EXISTENT = 4; }; #endif /* _OBJECT_REFERENCE_TEMPLATE_IDL_ */ diff --git a/TAO/tao/ObjRefTemplate/ObjectReferenceTemplateC.cpp b/TAO/tao/ObjRefTemplate/ObjectReferenceTemplateC.cpp index 6dbae78e6e8..5c011c5ecc2 100644 --- a/TAO/tao/ObjRefTemplate/ObjectReferenceTemplateC.cpp +++ b/TAO/tao/ObjRefTemplate/ObjectReferenceTemplateC.cpp @@ -26,7 +26,7 @@ // http://www.cs.wustl.edu/~schmidt/TAO.html // TAO_IDL - Generated from -// be\be_codegen.cpp:323 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_codegen.cpp:303 #include "ObjectReferenceTemplateC.h" @@ -34,6 +34,7 @@ #include "tao/Exception_Data.h" #include "tao/Invocation_Adapter.h" #include "tao/Valuetype/ValueFactory.h" +#include "tao/ORB_Core.h" #include "tao/Typecode.h" #include "tao/Any_Impl_T.h" #include "tao/Any_Dual_Impl_T.h" @@ -46,18 +47,18 @@ #endif /* __BORLANDC__ */ #if !defined (__ACE_INLINE__) -#include "ObjectReferenceTemplateC.i" +#include "ObjectReferenceTemplateC.inl" #endif /* !defined INLINE */ // TAO_IDL - Generated from -// be\be_visitor_arg_traits.cpp:64 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_arg_traits.cpp:64 // Arg traits specializations. namespace TAO { // TAO_IDL - Generated from - // be\be_visitor_arg_traits.cpp:379 + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_arg_traits.cpp:379 #if !defined (_CORBA_STRINGSEQ__ARG_TRAITS_CS_) #define _CORBA_STRINGSEQ__ARG_TRAITS_CS_ @@ -78,7 +79,7 @@ namespace TAO // TAO_IDL - Generated from -// be\be_visitor_typecode/typecode_defn.cpp:290 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typecode/typecode_defn.cpp:290 static const CORBA::Long _oc_PortableInterceptor_ObjectReferenceFactory[] = { @@ -127,7 +128,7 @@ namespace PortableInterceptor } // TAO_IDL - Generated from -// be\be_visitor_valuetype/valuetype_cs.cpp:66 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_valuetype/valuetype_cs.cpp:66 ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION void @@ -177,8 +178,8 @@ void PortableInterceptor::ObjectReferenceFactory::_tao_any_destructor (void *_tao_void_pointer) { ObjectReferenceFactory *_tao_tmp_pointer = - ACE_static_cast ( - ObjectReferenceFactory *, + static_cast< + ObjectReferenceFactory *> ( _tao_void_pointer ); CORBA::remove_ref (_tao_tmp_pointer); @@ -228,7 +229,7 @@ CORBA::Boolean PortableInterceptor::ObjectReferenceFactory::_tao_unmarshal ( } // TAO_IDL - Generated from -// be\be_visitor_typecode/typecode_defn.cpp:290 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typecode/typecode_defn.cpp:290 static const CORBA::Long _oc_PortableInterceptor_ObjectReferenceTemplate[] = { @@ -277,7 +278,7 @@ namespace PortableInterceptor } // TAO_IDL - Generated from -// be\be_visitor_valuetype/valuetype_cs.cpp:66 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_valuetype/valuetype_cs.cpp:66 ACE_TEMPLATE_CLASS_MEMBER_SPECIALIZATION void @@ -327,8 +328,8 @@ void PortableInterceptor::ObjectReferenceTemplate::_tao_any_destructor (void *_tao_void_pointer) { ObjectReferenceTemplate *_tao_tmp_pointer = - ACE_static_cast ( - ObjectReferenceTemplate *, + static_cast< + ObjectReferenceTemplate *> ( _tao_void_pointer ); CORBA::remove_ref (_tao_tmp_pointer); @@ -378,7 +379,7 @@ CORBA::Boolean PortableInterceptor::ObjectReferenceTemplate::_tao_unmarshal ( } // TAO_IDL - Generated from -// be\be_visitor_sequence/sequence_cs.cpp:65 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_sequence/sequence_cs.cpp:65 #if !defined (_PORTABLEINTERCEPTOR_OBJECTREFERENCETEMPLATESEQ_CS_) #define _PORTABLEINTERCEPTOR_OBJECTREFERENCETEMPLATESEQ_CS_ @@ -427,14 +428,14 @@ void PortableInterceptor::ObjectReferenceTemplateSeq::_tao_any_destructor ( ) { ObjectReferenceTemplateSeq * _tao_tmp_pointer = - ACE_static_cast (ObjectReferenceTemplateSeq *, _tao_void_pointer); + static_cast<ObjectReferenceTemplateSeq *> (_tao_void_pointer); delete _tao_tmp_pointer; } #endif /* end #if !defined */ // TAO_IDL - Generated from -// be\be_visitor_typecode/typecode_defn.cpp:290 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typecode/typecode_defn.cpp:290 static const CORBA::Long _oc_PortableInterceptor_ObjectReferenceTemplateSeq[] = { @@ -517,97 +518,7 @@ namespace PortableInterceptor } // TAO_IDL - Generated from -// be\be_visitor_typecode/typecode_defn.cpp:290 - -static const CORBA::Long _oc_PortableInterceptor_AdapterManagerId[] = -{ - TAO_ENCAP_BYTE_ORDER, // byte order - 53, - ACE_NTOHL (0x49444c3a), - ACE_NTOHL (0x6f6d672e), - ACE_NTOHL (0x6f72672f), - ACE_NTOHL (0x506f7274), - ACE_NTOHL (0x61626c65), - ACE_NTOHL (0x496e7465), - ACE_NTOHL (0x72636570), - ACE_NTOHL (0x746f722f), - ACE_NTOHL (0x41646170), - ACE_NTOHL (0x7465724d), - ACE_NTOHL (0x616e6167), - ACE_NTOHL (0x65724964), - ACE_NTOHL (0x3a312e30), - ACE_NTOHL (0x0), // repository ID = IDL:omg.org/PortableInterceptor/AdapterManagerId:1.0 - 17, - ACE_NTOHL (0x41646170), - ACE_NTOHL (0x7465724d), - ACE_NTOHL (0x616e6167), - ACE_NTOHL (0x65724964), - ACE_NTOHL (0x0), // name = AdapterManagerId - CORBA::tk_long, - -}; - -static CORBA::TypeCode _tc_TAO_tc_PortableInterceptor_AdapterManagerId ( - CORBA::tk_alias, - sizeof (_oc_PortableInterceptor_AdapterManagerId), - (char *) &_oc_PortableInterceptor_AdapterManagerId, - 0, - sizeof (PortableInterceptor::AdapterManagerId) - ); - -namespace PortableInterceptor -{ - ::CORBA::TypeCode_ptr _tc_AdapterManagerId = - &_tc_TAO_tc_PortableInterceptor_AdapterManagerId; -} - -// TAO_IDL - Generated from -// be\be_visitor_typecode/typecode_defn.cpp:290 - -static const CORBA::Long _oc_PortableInterceptor_AdapterState[] = -{ - TAO_ENCAP_BYTE_ORDER, // byte order - 49, - ACE_NTOHL (0x49444c3a), - ACE_NTOHL (0x6f6d672e), - ACE_NTOHL (0x6f72672f), - ACE_NTOHL (0x506f7274), - ACE_NTOHL (0x61626c65), - ACE_NTOHL (0x496e7465), - ACE_NTOHL (0x72636570), - ACE_NTOHL (0x746f722f), - ACE_NTOHL (0x41646170), - ACE_NTOHL (0x74657253), - ACE_NTOHL (0x74617465), - ACE_NTOHL (0x3a312e30), - ACE_NTOHL (0x0), // repository ID = IDL:omg.org/PortableInterceptor/AdapterState:1.0 - 13, - ACE_NTOHL (0x41646170), - ACE_NTOHL (0x74657253), - ACE_NTOHL (0x74617465), - ACE_NTOHL (0x0), // name = AdapterState - CORBA::tk_short, - -}; - -static CORBA::TypeCode _tc_TAO_tc_PortableInterceptor_AdapterState ( - CORBA::tk_alias, - sizeof (_oc_PortableInterceptor_AdapterState), - (char *) &_oc_PortableInterceptor_AdapterState, - 0, - sizeof (PortableInterceptor::AdapterState) - ); - -namespace PortableInterceptor -{ - ::CORBA::TypeCode_ptr _tc_AdapterState = - &_tc_TAO_tc_PortableInterceptor_AdapterState; -} - -// TAO_IDL - Generated from -// be\be_visitor_valuetype/any_op_cs.cpp:57 - - +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_valuetype/any_op_cs.cpp:57 template<> CORBA::Boolean @@ -663,9 +574,7 @@ operator>>= ( // TAO_IDL - Generated from -// be\be_visitor_valuetype/any_op_cs.cpp:57 - - +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_valuetype/any_op_cs.cpp:57 template<> CORBA::Boolean @@ -721,7 +630,7 @@ operator>>= ( // TAO_IDL - Generated from -// be\be_visitor_sequence/any_op_cs.cpp:54 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_sequence/any_op_cs.cpp:54 // Copying insertion. void operator<<= ( @@ -757,8 +666,8 @@ CORBA::Boolean operator>>= ( PortableInterceptor::ObjectReferenceTemplateSeq *&_tao_elem ) { - return _tao_any >>= ACE_const_cast ( - const PortableInterceptor::ObjectReferenceTemplateSeq *&, + return _tao_any >>= const_cast< + const PortableInterceptor::ObjectReferenceTemplateSeq *&> ( _tao_elem ); } @@ -779,7 +688,7 @@ CORBA::Boolean operator>>= ( } // TAO_IDL - Generated from -// be\be_valuetype.cpp:490 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_valuetype.cpp:490 void CORBA::add_ref (PortableInterceptor::ObjectReferenceFactory * vt) @@ -800,7 +709,7 @@ CORBA::remove_ref (PortableInterceptor::ObjectReferenceFactory * vt) } // TAO_IDL - Generated from -// be\be_visitor_valuetype/cdr_op_cs.cpp:73 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_valuetype/cdr_op_cs.cpp:73 CORBA::Boolean operator<< ( @@ -811,8 +720,8 @@ operator<< ( return CORBA::ValueBase::_tao_marshal ( strm, - ACE_const_cast ( - PortableInterceptor::ObjectReferenceFactory *, + const_cast< + PortableInterceptor::ObjectReferenceFactory *> ( _tao_valuetype ), (ptrdiff_t) &PortableInterceptor::ObjectReferenceFactory::_downcast @@ -831,7 +740,7 @@ operator>> ( // TAO_IDL - Generated from -// be\be_valuetype.cpp:490 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_valuetype.cpp:490 void CORBA::add_ref (PortableInterceptor::ObjectReferenceTemplate * vt) @@ -852,7 +761,7 @@ CORBA::remove_ref (PortableInterceptor::ObjectReferenceTemplate * vt) } // TAO_IDL - Generated from -// be\be_visitor_valuetype/cdr_op_cs.cpp:73 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_valuetype/cdr_op_cs.cpp:73 CORBA::Boolean operator<< ( @@ -863,8 +772,8 @@ operator<< ( return CORBA::ValueBase::_tao_marshal ( strm, - ACE_const_cast ( - PortableInterceptor::ObjectReferenceTemplate *, + const_cast< + PortableInterceptor::ObjectReferenceTemplate *> ( _tao_valuetype ), (ptrdiff_t) &PortableInterceptor::ObjectReferenceTemplate::_downcast @@ -883,7 +792,7 @@ operator>> ( // TAO_IDL - Generated from -// be\be_visitor_sequence/cdr_op_cs.cpp:96 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_sequence/cdr_op_cs.cpp:96 #if !defined _TAO_CDR_OP_PortableInterceptor_ObjectReferenceTemplateSeq_CPP_ #define _TAO_CDR_OP_PortableInterceptor_ObjectReferenceTemplateSeq_CPP_ @@ -893,7 +802,7 @@ CORBA::Boolean operator<< ( const PortableInterceptor::ObjectReferenceTemplateSeq &_tao_sequence ) { - CORBA::ULong _tao_seq_len = _tao_sequence.length (); + const CORBA::ULong _tao_seq_len = _tao_sequence.length (); if (strm << _tao_seq_len) { @@ -955,7 +864,7 @@ CORBA::Boolean operator>> ( #endif /* _TAO_CDR_OP_PortableInterceptor_ObjectReferenceTemplateSeq_CPP_ */ // TAO_IDL - Generated from -// be\be_visitor_root/root.cpp:1628 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_root/root.cpp:1628 #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) @@ -1112,6 +1021,12 @@ CORBA::Boolean operator>> ( > # pragma instantiate \ + TAO::Ret_Var_Size_Argument_T< \ + PortableInterceptor::AdapterName, \ + PortableInterceptor::AdapterName_var \ + > + +# pragma instantiate \ TAO::Value_Traits< \ PortableInterceptor::ObjectReferenceTemplate \ > diff --git a/TAO/tao/ObjRefTemplate/ObjectReferenceTemplateC.h b/TAO/tao/ObjRefTemplate/ObjectReferenceTemplateC.h index 3e4798bd919..b012e1941d6 100644 --- a/TAO/tao/ObjRefTemplate/ObjectReferenceTemplateC.h +++ b/TAO/tao/ObjRefTemplate/ObjectReferenceTemplateC.h @@ -26,24 +26,26 @@ // http://www.cs.wustl.edu/~schmidt/TAO.html // TAO_IDL - Generated from -// be\be_codegen.cpp:171 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_codegen.cpp:153 #ifndef _TAO_IDL_ORIG_OBJECTREFERENCETEMPLATEC_H_ #define _TAO_IDL_ORIG_OBJECTREFERENCETEMPLATEC_H_ #include /**/ "ace/pre.h" -#include "tao/ORB.h" + +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ort_export.h" -#include "tao/Environment.h" -#include "tao/Object.h" #include "tao/Valuetype/ValueBase.h" #include "tao/Valuetype/Valuetype_Adapter_Impl.h" +#include "tao/ORB.h" +#include "tao/Environment.h" +#include "tao/Object.h" #include "tao/Valuetype/Sequence_T.h" #include "tao/Sequence_T.h" #include "tao/Valuetype/Value_VarOut_T.h" @@ -76,13 +78,13 @@ #endif /* __BORLANDC__ */ // TAO_IDL - Generated from -// be\be_visitor_module/module_ch.cpp:48 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_module/module_ch.cpp:48 namespace PortableInterceptor { // TAO_IDL - Generated from - // be\be_valuetype.cpp:527 + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_valuetype.cpp:527 @@ -105,7 +107,7 @@ namespace PortableInterceptor #endif /* end #if !defined */ // TAO_IDL - Generated from - // be\be_visitor_valuetype/valuetype_ch.cpp:56 + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_valuetype/valuetype_ch.cpp:56 #if !defined (_PORTABLEINTERCEPTOR_OBJECTREFERENCEFACTORY_CH_) #define _PORTABLEINTERCEPTOR_OBJECTREFERENCEFACTORY_CH_ @@ -131,15 +133,15 @@ namespace PortableInterceptor static void _tao_any_destructor (void *); // TAO_IDL - Generated from - // be\be_visitor_valuetype/valuetype_ch.cpp:401 + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_valuetype/valuetype_ch.cpp:402 public: virtual CORBA::Object_ptr make_object ( - const char *, const PortableInterceptor::ObjectId & ACE_ENV_ARG_DECL_WITH_DEFAULTS + const char *, const ::PortableInterceptor::ObjectId & ACE_ENV_ARG_DECL_WITH_DEFAULTS ) = 0; // TAO_IDL - Generated from - // be\be_visitor_valuetype/valuetype_ch.cpp:250 + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_valuetype/valuetype_ch.cpp:250 protected: ObjectReferenceFactory (void); @@ -156,12 +158,12 @@ namespace PortableInterceptor #endif /* end #if !defined */ // TAO_IDL - Generated from - // be\be_visitor_typecode/typecode_decl.cpp:44 + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typecode/typecode_decl.cpp:44 TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr _tc_ObjectReferenceFactory; // TAO_IDL - Generated from - // be\be_valuetype.cpp:527 + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_valuetype.cpp:527 @@ -184,7 +186,7 @@ namespace PortableInterceptor #endif /* end #if !defined */ // TAO_IDL - Generated from - // be\be_visitor_valuetype/valuetype_ch.cpp:56 + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_valuetype/valuetype_ch.cpp:56 #if !defined (_PORTABLEINTERCEPTOR_OBJECTREFERENCETEMPLATE_CH_) #define _PORTABLEINTERCEPTOR_OBJECTREFERENCETEMPLATE_CH_ @@ -210,7 +212,7 @@ namespace PortableInterceptor static void _tao_any_destructor (void *); // TAO_IDL - Generated from - // be\be_visitor_valuetype/valuetype_ch.cpp:401 + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_valuetype/valuetype_ch.cpp:402 public: virtual char * server_id ( @@ -218,7 +220,7 @@ namespace PortableInterceptor ) = 0; // TAO_IDL - Generated from - // be\be_visitor_valuetype/valuetype_ch.cpp:401 + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_valuetype/valuetype_ch.cpp:402 public: virtual char * orb_id ( @@ -226,7 +228,7 @@ namespace PortableInterceptor ) = 0; // TAO_IDL - Generated from - // be\be_visitor_valuetype/valuetype_ch.cpp:401 + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_valuetype/valuetype_ch.cpp:402 public: virtual ::PortableInterceptor::AdapterName * adapter_name ( @@ -234,7 +236,7 @@ namespace PortableInterceptor ) = 0; // TAO_IDL - Generated from - // be\be_visitor_valuetype/valuetype_ch.cpp:250 + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_valuetype/valuetype_ch.cpp:250 protected: ObjectReferenceTemplate (void); @@ -251,12 +253,12 @@ namespace PortableInterceptor #endif /* end #if !defined */ // TAO_IDL - Generated from - // be\be_visitor_typecode/typecode_decl.cpp:44 + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typecode/typecode_decl.cpp:44 TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr _tc_ObjectReferenceTemplate; // TAO_IDL - Generated from - // be\be_visitor_sequence/sequence_ch.cpp:101 + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_sequence/sequence_ch.cpp:101 #if !defined (_PORTABLEINTERCEPTOR_OBJECTREFERENCETEMPLATESEQ_CH_) #define _PORTABLEINTERCEPTOR_OBJECTREFERENCETEMPLATESEQ_CH_ @@ -311,71 +313,24 @@ namespace PortableInterceptor #endif /* end #if !defined */ // TAO_IDL - Generated from - // be\be_visitor_typecode/typecode_decl.cpp:44 + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typecode/typecode_decl.cpp:44 TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr _tc_ObjectReferenceTemplateSeq; - - // TAO_IDL - Generated from - // be\be_visitor_typedef/typedef_ch.cpp:342 - - typedef CORBA::Long AdapterManagerId; - typedef CORBA::Long_out AdapterManagerId_out; - - // TAO_IDL - Generated from - // be\be_visitor_typecode/typecode_decl.cpp:44 - - TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr _tc_AdapterManagerId; - - // TAO_IDL - Generated from - // be\be_visitor_typedef/typedef_ch.cpp:342 - - typedef CORBA::Short AdapterState; - typedef CORBA::Short_out AdapterState_out; - - // TAO_IDL - Generated from - // be\be_visitor_typecode/typecode_decl.cpp:44 - - TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr _tc_AdapterState; - - // TAO_IDL - Generated from - // be\be_visitor_constant/constant_ch.cpp:52 - - const PortableInterceptor::AdapterState HOLDING = 0; - - // TAO_IDL - Generated from - // be\be_visitor_constant/constant_ch.cpp:52 - - const PortableInterceptor::AdapterState ACTIVE = 1; - - // TAO_IDL - Generated from - // be\be_visitor_constant/constant_ch.cpp:52 - - const PortableInterceptor::AdapterState DISCARDING = 2; - - // TAO_IDL - Generated from - // be\be_visitor_constant/constant_ch.cpp:52 - - const PortableInterceptor::AdapterState INACTIVE = 3; - - // TAO_IDL - Generated from - // be\be_visitor_constant/constant_ch.cpp:52 - - const PortableInterceptor::AdapterState NON_EXISTENT = 4; // TAO_IDL - Generated from -// be\be_visitor_module/module_ch.cpp:66 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_module/module_ch.cpp:66 } // module PortableInterceptor // TAO_IDL - Generated from -// be\be_visitor_valuetype/obv_module.cpp:55 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_valuetype/obv_module.cpp:55 namespace OBV_PortableInterceptor { } // TAO_IDL - Generated from -// be\be_visitor_traits.cpp:59 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_traits.cpp:59 // Traits specializations. namespace TAO @@ -409,21 +364,21 @@ namespace TAO } // TAO_IDL - Generated from -// be\be_visitor_valuetype/any_op_ch.cpp:54 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_valuetype/any_op_ch.cpp:54 TAO_ORT_Export void operator<<= (CORBA::Any &, PortableInterceptor::ObjectReferenceFactory *); // copying TAO_ORT_Export void operator<<= (CORBA::Any &, PortableInterceptor::ObjectReferenceFactory **); // non-copying TAO_ORT_Export CORBA::Boolean operator>>= (const CORBA::Any &, PortableInterceptor::ObjectReferenceFactory *&); // TAO_IDL - Generated from -// be\be_visitor_valuetype/any_op_ch.cpp:54 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_valuetype/any_op_ch.cpp:54 TAO_ORT_Export void operator<<= (CORBA::Any &, PortableInterceptor::ObjectReferenceTemplate *); // copying TAO_ORT_Export void operator<<= (CORBA::Any &, PortableInterceptor::ObjectReferenceTemplate **); // non-copying TAO_ORT_Export CORBA::Boolean operator>>= (const CORBA::Any &, PortableInterceptor::ObjectReferenceTemplate *&); // TAO_IDL - Generated from -// be\be_visitor_sequence/any_op_ch.cpp:52 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_sequence/any_op_ch.cpp:52 TAO_ORT_Export void operator<<= (CORBA::Any &, const PortableInterceptor::ObjectReferenceTemplateSeq &); // copying version TAO_ORT_Export void operator<<= (CORBA::Any &, PortableInterceptor::ObjectReferenceTemplateSeq*); // noncopying version @@ -431,7 +386,7 @@ TAO_ORT_Export CORBA::Boolean operator>>= (const CORBA::Any &, PortableIntercept TAO_ORT_Export CORBA::Boolean operator>>= (const CORBA::Any &, const PortableInterceptor::ObjectReferenceTemplateSeq *&); // TAO_IDL - Generated from -// be\be_valuetype.cpp:434 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_valuetype.cpp:434 namespace CORBA { @@ -440,13 +395,13 @@ namespace CORBA } // TAO_IDL - Generated from -// be\be_visitor_valuetype/cdr_op_ch.cpp:61 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_valuetype/cdr_op_ch.cpp:61 TAO_ORT_Export CORBA::Boolean operator<< (TAO_OutputCDR &, const PortableInterceptor::ObjectReferenceFactory *); TAO_ORT_Export CORBA::Boolean operator>> (TAO_InputCDR &, PortableInterceptor::ObjectReferenceFactory *&); // TAO_IDL - Generated from -// be\be_valuetype.cpp:434 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_valuetype.cpp:434 namespace CORBA { @@ -455,13 +410,13 @@ namespace CORBA } // TAO_IDL - Generated from -// be\be_visitor_valuetype/cdr_op_ch.cpp:61 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_valuetype/cdr_op_ch.cpp:61 TAO_ORT_Export CORBA::Boolean operator<< (TAO_OutputCDR &, const PortableInterceptor::ObjectReferenceTemplate *); TAO_ORT_Export CORBA::Boolean operator>> (TAO_InputCDR &, PortableInterceptor::ObjectReferenceTemplate *&); // TAO_IDL - Generated from -// be\be_visitor_sequence/cdr_op_ch.cpp:71 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_sequence/cdr_op_ch.cpp:71 #if !defined _TAO_CDR_OP_PortableInterceptor_ObjectReferenceTemplateSeq_H_ #define _TAO_CDR_OP_PortableInterceptor_ObjectReferenceTemplateSeq_H_ @@ -478,10 +433,10 @@ TAO_ORT_Export CORBA::Boolean operator>> ( #endif /* _TAO_CDR_OP_PortableInterceptor_ObjectReferenceTemplateSeq_H_ */ // TAO_IDL - Generated from -// be\be_codegen.cpp:978 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_codegen.cpp:958 #if defined (__ACE_INLINE__) -#include "ObjectReferenceTemplateC.i" +#include "ObjectReferenceTemplateC.inl" #endif /* defined INLINE */ #if defined(_MSC_VER) && (_MSC_VER >= 1200) diff --git a/TAO/tao/ObjRefTemplate/ObjectReferenceTemplateC.i b/TAO/tao/ObjRefTemplate/ObjectReferenceTemplateC.inl index 1185feac15c..6781d2368a2 100644 --- a/TAO/tao/ObjRefTemplate/ObjectReferenceTemplateC.i +++ b/TAO/tao/ObjRefTemplate/ObjectReferenceTemplateC.inl @@ -27,7 +27,7 @@ // TAO_IDL - Generated from -// be\be_visitor_valuetype/valuetype_ci.cpp:56 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_valuetype/valuetype_ci.cpp:56 ACE_INLINE PortableInterceptor::ObjectReferenceFactory::ObjectReferenceFactory (void) @@ -44,7 +44,7 @@ PortableInterceptor::ObjectReferenceFactory::_tao_obv_static_repository_id () } // TAO_IDL - Generated from -// be\be_visitor_valuetype/valuetype_ci.cpp:56 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_valuetype/valuetype_ci.cpp:56 ACE_INLINE PortableInterceptor::ObjectReferenceTemplate::ObjectReferenceTemplate (void) diff --git a/TAO/tao/ObjRefTemplate/ObjectReferenceTemplate_i.cpp b/TAO/tao/ObjRefTemplate/ObjectReferenceTemplate_i.cpp new file mode 100644 index 00000000000..acd324b0ce0 --- /dev/null +++ b/TAO/tao/ObjRefTemplate/ObjectReferenceTemplate_i.cpp @@ -0,0 +1,80 @@ +#include "ObjectReferenceTemplate_i.h" +#include "tao/PortableServer/POA.h" + +#include "tao/CORBA_String.h" +#include "tao/ORB_Constants.h" + +ACE_RCSID (ORT, + ObjectReferenceTemplate_i, + "$Id$") + +#if !defined (__ACE_INLINE__) +# include "ObjectReferenceTemplate_i.inl" +#endif /* ! __ACE_INLINE__ */ + +namespace TAO +{ + ObjectReferenceTemplate::ObjectReferenceTemplate ( + const char *server_id, + const char *orb_id, + PortableInterceptor::AdapterName *adapter_name, + PortableServer::POA_ptr poa) + : server_id_ (server_id), + orb_id_ (orb_id), + adapter_name_ (adapter_name), + poa_ (PortableServer::POA::_duplicate (poa)) + { + } + + ObjectReferenceTemplate::~ObjectReferenceTemplate (void) + { + } + + char * + ObjectReferenceTemplate::server_id (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return CORBA::string_dup (this->server_id_); + } + + char * + ObjectReferenceTemplate::orb_id (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + return CORBA::string_dup (this->orb_id_); + } + + PortableInterceptor::AdapterName * + ObjectReferenceTemplate::adapter_name (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + PortableInterceptor::AdapterName *adapter_name = 0; + + ACE_NEW_THROW_EX (adapter_name, + PortableInterceptor::AdapterName ( + *(this->adapter_name_)), + CORBA::NO_MEMORY ( + CORBA::SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + ENOMEM), + CORBA::COMPLETED_NO)); + ACE_CHECK_RETURN (0); + + return adapter_name; + } + + CORBA::Object_ptr + ObjectReferenceTemplate::make_object ( + const char *, + const PortableInterceptor::ObjectId & + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) + { + if (CORBA::is_nil(poa_)) + ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (), CORBA::Object::_nil ()); + + TAO_POA* tao_poa = poa_->_tao_poa_downcast (); + + return tao_poa->invoke_key_to_object (ACE_ENV_SINGLE_ARG_PARAMETER); + } +} diff --git a/TAO/tao/ObjRefTemplate/ObjectReferenceTemplate_i.h b/TAO/tao/ObjRefTemplate/ObjectReferenceTemplate_i.h new file mode 100644 index 00000000000..776e7e95d06 --- /dev/null +++ b/TAO/tao/ObjRefTemplate/ObjectReferenceTemplate_i.h @@ -0,0 +1,117 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file ObjectReferenceTemplate_i.h + * + * $Id$ + * + * This is the implementation of the + * PortableInterceptor::ObjectReferenceTemplate ValueType. + * + * @author Johnny Willemsen <jwillemsen@remedy.nl> + */ +//============================================================================= + +#ifndef TAO_OBJECT_REFERENCE_TEMPLATE_I_H +#define TAO_OBJECT_REFERENCE_TEMPLATE_I_H + +#include /**/ "ace/pre.h" + +#include "tao/ObjRefTemplate/ort_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "Default_ORTC.h" +#include "tao/PortableServer/PortableServerC.h" + +#if defined(_MSC_VER) +#if (_MSC_VER >= 1200) +#pragma warning(push) +#endif /* _MSC_VER >= 1200 */ +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +namespace TAO +{ + /** + * @class TAO_ObjectReferenceTemplate + * + * @brief Implementation of the PortableInterceptor::ObjectReferenceTemplate + * interface. This is a default implementation created to be returned + * by the IORInfo when the user requests the ORT or ORF. + */ + class TAO_ORT_Export ObjectReferenceTemplate + : public virtual OBV_TAO_Default_ORT::ObjectReferenceTemplate, + public virtual CORBA::DefaultValueRefCountBase + { + public: + /// Constructor + ObjectReferenceTemplate (const char *server_id, + const char *orb_id, + PortableInterceptor::AdapterName *adapter_name, + PortableServer::POA_ptr poa); + + /** + * @name PortableInterceptor::ObjectReferenceTemplate Methods + * + * Methods required by the + * PortableInterceptor::ObjectReferenceTemplate ValueType. + */ + //@{ + virtual char * server_id (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual char * orb_id (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual PortableInterceptor::AdapterName * adapter_name ( + ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + //@} + + /** + * @name PortableInterceptor::ObjectReferenceFactory Methods + * + * Methods required by the + * PortableInterceptor::ObjectReferenceFactory ValueType. + */ + //@{ + virtual CORBA::Object_ptr make_object ( + const char * repository_id, + const PortableInterceptor::ObjectId & id + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC (( + CORBA::SystemException + )); + //@} + + protected: + + /// Destructor + /** + * Protected destructor to enforce proper memory management via + * reference counting. + */ + ~ObjectReferenceTemplate (void); + + private: + const char *server_id_; + const char *orb_id_; + PortableInterceptor::AdapterName_var adapter_name_; + PortableServer::POA_var poa_; + }; +} +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#if defined (__ACE_INLINE__) +# include "ObjectReferenceTemplate_i.inl" +#endif /* ! __ACE_INLINE__ */ + +#include /**/ "ace/post.h" + +#endif /* TAO_OBJECT_REFERENCE_TEMPLATE_I_H */ diff --git a/TAO/tao/ObjRefTemplate/ObjectReferenceTemplate_i.inl b/TAO/tao/ObjRefTemplate/ObjectReferenceTemplate_i.inl new file mode 100644 index 00000000000..2ad999ebb73 --- /dev/null +++ b/TAO/tao/ObjRefTemplate/ObjectReferenceTemplate_i.inl @@ -0,0 +1,3 @@ +// -*- C++ -*- +// +// $Id$ diff --git a/TAO/tao/PI_Forward.pidl b/TAO/tao/PI_Forward.pidl index a1269596552..5256404e9dc 100644 --- a/TAO/tao/PI_Forward.pidl +++ b/TAO/tao/PI_Forward.pidl @@ -43,6 +43,8 @@ module PortableInterceptor typedef string ORBId; typedef CORBA::StringSeq AdapterName; typedef CORBA::OctetSeq ObjectId; + typedef long AdapterManagerId; + typedef short AdapterState; }; #endif /* _PI_FORWARD_IDL_ */ diff --git a/TAO/tao/PI_ForwardC.cpp b/TAO/tao/PI_ForwardC.cpp index d989d5183a4..ab3fc77daa3 100644 --- a/TAO/tao/PI_ForwardC.cpp +++ b/TAO/tao/PI_ForwardC.cpp @@ -26,10 +26,12 @@ // http://www.cs.wustl.edu/~schmidt/TAO.html // TAO_IDL - Generated from -// be\be_codegen.cpp:323 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_codegen.cpp:303 #include "PI_ForwardC.h" +#include "tao/CDR.h" +#include "tao/ORB_Core.h" #include "tao/Typecode.h" #if defined (__BORLANDC__) @@ -37,11 +39,11 @@ #endif /* __BORLANDC__ */ #if !defined (__ACE_INLINE__) -#include "PI_ForwardC.i" +#include "PI_ForwardC.inl" #endif /* !defined INLINE */ // TAO_IDL - Generated from -// be\be_visitor_arg_traits.cpp:64 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_arg_traits.cpp:64 // Arg traits specializations. namespace TAO @@ -50,7 +52,7 @@ namespace TAO // TAO_IDL - Generated from -// be\be_visitor_typecode/typecode_defn.cpp:284 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typecode/typecode_defn.cpp:290 static const CORBA::Long _oc_PortableInterceptor_ServerId[] = { @@ -91,7 +93,7 @@ namespace PortableInterceptor } // TAO_IDL - Generated from -// be\be_visitor_typecode/typecode_defn.cpp:284 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typecode/typecode_defn.cpp:290 static const CORBA::Long _oc_PortableInterceptor_ORBId[] = { @@ -130,7 +132,7 @@ namespace PortableInterceptor } // TAO_IDL - Generated from -// be\be_visitor_typecode/typecode_defn.cpp:284 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typecode/typecode_defn.cpp:290 static const CORBA::Long _oc_PortableInterceptor_AdapterName[] = { @@ -193,7 +195,7 @@ namespace PortableInterceptor } // TAO_IDL - Generated from -// be\be_visitor_typecode/typecode_defn.cpp:284 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typecode/typecode_defn.cpp:290 static const CORBA::Long _oc_PortableInterceptor_ObjectId[] = { @@ -256,7 +258,95 @@ namespace PortableInterceptor } // TAO_IDL - Generated from -// be\be_visitor_root/root.cpp:1633 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typecode/typecode_defn.cpp:290 + +static const CORBA::Long _oc_PortableInterceptor_AdapterManagerId[] = +{ + TAO_ENCAP_BYTE_ORDER, // byte order + 53, + ACE_NTOHL (0x49444c3a), + ACE_NTOHL (0x6f6d672e), + ACE_NTOHL (0x6f72672f), + ACE_NTOHL (0x506f7274), + ACE_NTOHL (0x61626c65), + ACE_NTOHL (0x496e7465), + ACE_NTOHL (0x72636570), + ACE_NTOHL (0x746f722f), + ACE_NTOHL (0x41646170), + ACE_NTOHL (0x7465724d), + ACE_NTOHL (0x616e6167), + ACE_NTOHL (0x65724964), + ACE_NTOHL (0x3a312e30), + ACE_NTOHL (0x0), // repository ID = IDL:omg.org/PortableInterceptor/AdapterManagerId:1.0 + 17, + ACE_NTOHL (0x41646170), + ACE_NTOHL (0x7465724d), + ACE_NTOHL (0x616e6167), + ACE_NTOHL (0x65724964), + ACE_NTOHL (0x0), // name = AdapterManagerId + CORBA::tk_long, + +}; + +static CORBA::TypeCode _tc_TAO_tc_PortableInterceptor_AdapterManagerId ( + CORBA::tk_alias, + sizeof (_oc_PortableInterceptor_AdapterManagerId), + (char *) &_oc_PortableInterceptor_AdapterManagerId, + 0, + sizeof (PortableInterceptor::AdapterManagerId) + ); + +namespace PortableInterceptor +{ + ::CORBA::TypeCode_ptr _tc_AdapterManagerId = + &_tc_TAO_tc_PortableInterceptor_AdapterManagerId; +} + +// TAO_IDL - Generated from +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typecode/typecode_defn.cpp:290 + +static const CORBA::Long _oc_PortableInterceptor_AdapterState[] = +{ + TAO_ENCAP_BYTE_ORDER, // byte order + 49, + ACE_NTOHL (0x49444c3a), + ACE_NTOHL (0x6f6d672e), + ACE_NTOHL (0x6f72672f), + ACE_NTOHL (0x506f7274), + ACE_NTOHL (0x61626c65), + ACE_NTOHL (0x496e7465), + ACE_NTOHL (0x72636570), + ACE_NTOHL (0x746f722f), + ACE_NTOHL (0x41646170), + ACE_NTOHL (0x74657253), + ACE_NTOHL (0x74617465), + ACE_NTOHL (0x3a312e30), + ACE_NTOHL (0x0), // repository ID = IDL:omg.org/PortableInterceptor/AdapterState:1.0 + 13, + ACE_NTOHL (0x41646170), + ACE_NTOHL (0x74657253), + ACE_NTOHL (0x74617465), + ACE_NTOHL (0x0), // name = AdapterState + CORBA::tk_short, + +}; + +static CORBA::TypeCode _tc_TAO_tc_PortableInterceptor_AdapterState ( + CORBA::tk_alias, + sizeof (_oc_PortableInterceptor_AdapterState), + (char *) &_oc_PortableInterceptor_AdapterState, + 0, + sizeof (PortableInterceptor::AdapterState) + ); + +namespace PortableInterceptor +{ + ::CORBA::TypeCode_ptr _tc_AdapterState = + &_tc_TAO_tc_PortableInterceptor_AdapterState; +} + +// TAO_IDL - Generated from +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_root/root.cpp:1628 #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) diff --git a/TAO/tao/PI_ForwardC.h b/TAO/tao/PI_ForwardC.h index b1da5a26d1d..9f876afd852 100644 --- a/TAO/tao/PI_ForwardC.h +++ b/TAO/tao/PI_ForwardC.h @@ -26,21 +26,25 @@ // http://www.cs.wustl.edu/~schmidt/TAO.html // TAO_IDL - Generated from -// be\be_codegen.cpp:171 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_codegen.cpp:153 #ifndef _TAO_IDL_ORIG_PI_FORWARDC_H_ #define _TAO_IDL_ORIG_PI_FORWARDC_H_ #include /**/ "ace/pre.h" -#include "OctetSeqC.h" + +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/TAO_Export.h" +#include "tao/ORB.h" +#include "tao/Environment.h" +#include "OctetSeqC.h" #include "StringSeqC.h" #if defined (TAO_EXPORT_MACRO) @@ -67,66 +71,88 @@ #endif /* __BORLANDC__ */ // TAO_IDL - Generated from -// be\be_visitor_module/module_ch.cpp:48 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_module/module_ch.cpp:48 namespace PortableInterceptor { - + // TAO_IDL - Generated from - // be\be_visitor_typedef/typedef_ch.cpp:376 - + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typedef/typedef_ch.cpp:376 + typedef char * ServerId; typedef CORBA::String_var ServerId_var; typedef CORBA::String_out ServerId_out; - + // TAO_IDL - Generated from - // be\be_visitor_typecode/typecode_decl.cpp:44 - + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typecode/typecode_decl.cpp:44 + TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr _tc_ServerId; - + // TAO_IDL - Generated from - // be\be_visitor_typedef/typedef_ch.cpp:376 - + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typedef/typedef_ch.cpp:376 + typedef char * ORBId; typedef CORBA::String_var ORBId_var; typedef CORBA::String_out ORBId_out; - + // TAO_IDL - Generated from - // be\be_visitor_typecode/typecode_decl.cpp:44 - + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typecode/typecode_decl.cpp:44 + TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr _tc_ORBId; - + // TAO_IDL - Generated from - // be\be_visitor_typedef/typedef_ch.cpp:435 - + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typedef/typedef_ch.cpp:435 + typedef CORBA::StringSeq AdapterName; typedef CORBA::StringSeq_var AdapterName_var; typedef CORBA::StringSeq_out AdapterName_out; - + // TAO_IDL - Generated from - // be\be_visitor_typecode/typecode_decl.cpp:44 - + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typecode/typecode_decl.cpp:44 + TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr _tc_AdapterName; - + // TAO_IDL - Generated from - // be\be_visitor_typedef/typedef_ch.cpp:435 - + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typedef/typedef_ch.cpp:435 + typedef CORBA::OctetSeq ObjectId; typedef CORBA::OctetSeq_var ObjectId_var; typedef CORBA::OctetSeq_out ObjectId_out; - + // TAO_IDL - Generated from - // be\be_visitor_typecode/typecode_decl.cpp:44 - + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typecode/typecode_decl.cpp:44 + TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr _tc_ObjectId; + + // TAO_IDL - Generated from + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typedef/typedef_ch.cpp:342 + + typedef CORBA::Long AdapterManagerId; + typedef CORBA::Long_out AdapterManagerId_out; + + // TAO_IDL - Generated from + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typecode/typecode_decl.cpp:44 + + TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr _tc_AdapterManagerId; + + // TAO_IDL - Generated from + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typedef/typedef_ch.cpp:342 + + typedef CORBA::Short AdapterState; + typedef CORBA::Short_out AdapterState_out; + + // TAO_IDL - Generated from + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_typecode/typecode_decl.cpp:44 + + TAO_NAMESPACE_STORAGE_CLASS ::CORBA::TypeCode_ptr _tc_AdapterState; // TAO_IDL - Generated from -// be\be_visitor_module/module_ch.cpp:66 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_module/module_ch.cpp:66 } // module PortableInterceptor // TAO_IDL - Generated from -// be\be_visitor_traits.cpp:59 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_traits.cpp:59 // Traits specializations. namespace TAO @@ -134,10 +160,10 @@ namespace TAO } // TAO_IDL - Generated from -// be\be_codegen.cpp:978 +// C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_codegen.cpp:958 #if defined (__ACE_INLINE__) -#include "PI_ForwardC.i" +#include "PI_ForwardC.inl" #endif /* defined INLINE */ #if defined(_MSC_VER) && (_MSC_VER >= 1200) diff --git a/TAO/tao/PI_ForwardC.inl b/TAO/tao/PI_ForwardC.inl new file mode 100644 index 00000000000..38aa32569ba --- /dev/null +++ b/TAO/tao/PI_ForwardC.inl @@ -0,0 +1,28 @@ +// -*- C++ -*- +// +// $Id$ + +// **** Code generated by the The ACE ORB (TAO) IDL Compiler **** +// TAO and the TAO IDL Compiler have been developed by: +// Center for Distributed Object Computing +// Washington University +// St. Louis, MO +// USA +// http://www.cs.wustl.edu/~schmidt/doc-center.html +// and +// Distributed Object Computing Laboratory +// University of California at Irvine +// Irvine, CA +// USA +// http://doc.ece.uci.edu/ +// and +// Institute for Software Integrated Systems +// Vanderbilt University +// Nashville, TN +// USA +// http://www.isis.vanderbilt.edu/ +// +// Information about TAO is available at: +// http://www.cs.wustl.edu/~schmidt/TAO.html + + diff --git a/TAO/tao/PortableInterceptor.pidl b/TAO/tao/PortableInterceptor.pidl index 61dbfdcba82..9a7d5978800 100644 --- a/TAO/tao/PortableInterceptor.pidl +++ b/TAO/tao/PortableInterceptor.pidl @@ -49,6 +49,12 @@ module PortableInterceptor { typeprefix PortableInterceptor "omg.org"; + const AdapterState HOLDING = 0; + const AdapterState ACTIVE = 1; + const AdapterState DISCARDING = 2; + const AdapterState INACTIVE = 3; + const AdapterState NON_EXISTENT = 4; + local interface Interceptor { readonly attribute string name; diff --git a/TAO/tao/PortableInterceptorC.h b/TAO/tao/PortableInterceptorC.h index 677abef7e62..590aa228e06 100644 --- a/TAO/tao/PortableInterceptorC.h +++ b/TAO/tao/PortableInterceptorC.h @@ -98,6 +98,31 @@ namespace PortableInterceptor { // TAO_IDL - Generated from + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_constant/constant_ch.cpp:52 + + const PortableInterceptor::AdapterState HOLDING = 0; + + // TAO_IDL - Generated from + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_constant/constant_ch.cpp:52 + + const PortableInterceptor::AdapterState ACTIVE = 1; + + // TAO_IDL - Generated from + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_constant/constant_ch.cpp:52 + + const PortableInterceptor::AdapterState DISCARDING = 2; + + // TAO_IDL - Generated from + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_constant/constant_ch.cpp:52 + + const PortableInterceptor::AdapterState INACTIVE = 3; + + // TAO_IDL - Generated from + // C:\ACE\develop\ACE_wrappers\TAO\TAO_IDL\be\be_visitor_constant/constant_ch.cpp:52 + + const PortableInterceptor::AdapterState NON_EXISTENT = 4; + + // TAO_IDL - Generated from // be\be_interface.cpp:611 #if !defined (_PORTABLEINTERCEPTOR_INTERCEPTOR__VAR_OUT_CH_) diff --git a/TAO/tao/PortableServer.mpc b/TAO/tao/PortableServer.mpc index 8081b5eaba9..a007761a246 100644 --- a/TAO/tao/PortableServer.mpc +++ b/TAO/tao/PortableServer.mpc @@ -1,5 +1,5 @@ //$Id$ -project : taolib, core, objreftemplate, iorinterceptor { +project : taolib, core { sharedname = TAO_PortableServer dynamicflags = TAO_PORTABLESERVER_BUILD_DLL diff --git a/TAO/tao/PortableServer/ObjectReferenceTemplate.cpp b/TAO/tao/PortableServer/ObjectReferenceTemplate.cpp deleted file mode 100644 index d34fb729be7..00000000000 --- a/TAO/tao/PortableServer/ObjectReferenceTemplate.cpp +++ /dev/null @@ -1,102 +0,0 @@ -#include "ObjectReferenceTemplate.h" -#include "POA.h" - -#include "tao/CORBA_String.h" -#include "tao/ORB_Constants.h" - - -ACE_RCSID (PortableServer, - ObjectReferenceTemplate, - "$Id$") - - -#if !defined (__ACE_INLINE__) -# include "ObjectReferenceTemplate.inl" -#endif /* ! __ACE_INLINE__ */ - - -TAO_ObjectReferenceTemplate::TAO_ObjectReferenceTemplate ( - const char *server_id, - const char *orb_id, - TAO_POA * poa) - : server_id_ (server_id), - orb_id_ (orb_id), - poa_ (poa) -{ -} - -TAO_ObjectReferenceTemplate::~TAO_ObjectReferenceTemplate (void) -{ -} - -char * -TAO_ObjectReferenceTemplate::server_id (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->server_id_); -} - -char * -TAO_ObjectReferenceTemplate::orb_id (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->orb_id_); -} - -PortableInterceptor::AdapterName * -TAO_ObjectReferenceTemplate::adapter_name (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - PortableInterceptor::AdapterName *adapter_name = 0; - - if (this->adapter_name_ != 0) - { - ACE_NEW_THROW_EX (adapter_name, - PortableInterceptor::AdapterName ( - *(this->adapter_name_)), - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO_DEFAULT_MINOR_CODE, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK_RETURN (0); - - return adapter_name; - } - else - { - if (this->poa_ == 0) - ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (), 0); - - this->adapter_name_ = - this->poa_->adapter_name (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - ACE_NEW_THROW_EX (adapter_name, - PortableInterceptor::AdapterName ( - *(this->adapter_name_)), - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO_DEFAULT_MINOR_CODE, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK_RETURN (0); - - return adapter_name; - } -} - -CORBA::Object_ptr -TAO_ObjectReferenceTemplate::make_object ( - const char *, - const PortableInterceptor::ObjectId & - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( - CORBA::SystemException - )) -{ - if (this->poa_ == 0) - ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (), CORBA::Object::_nil ()); - - return this->poa_->invoke_key_to_object (ACE_ENV_SINGLE_ARG_PARAMETER); -} diff --git a/TAO/tao/PortableServer/ObjectReferenceTemplate.h b/TAO/tao/PortableServer/ObjectReferenceTemplate.h deleted file mode 100644 index 6d805313cf7..00000000000 --- a/TAO/tao/PortableServer/ObjectReferenceTemplate.h +++ /dev/null @@ -1,127 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file ObjectReferenceTemplate.h - * - * $Id$ - * - * This is the implementation of the - * PortableInterceptor::ObjectReferenceTemplate ValueType. - * - * @author Priyanka Gontla <gontla_p@ociweb.com> - */ -//============================================================================= - -#ifndef TAO_OBJECT_REFERENCE_TEMPLATE_H -#define TAO_OBJECT_REFERENCE_TEMPLATE_H - -#include /**/ "ace/pre.h" - -#include "tao/PortableServer/portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "Default_ORTC.h" - -#if defined(_MSC_VER) -#if (_MSC_VER >= 1200) -#pragma warning(push) -#endif /* _MSC_VER >= 1200 */ -#pragma warning(disable:4250) -#endif /* _MSC_VER */ - -class TAO_POA; - -/** - * @class TAO_ObjectReferenceTemplate - * - * @brief Implementation of the PortableInterceptor::ObjectReferenceTemplate - * interface. - */ -class TAO_PortableServer_Export TAO_ObjectReferenceTemplate - : public virtual OBV_TAO_Default_ORT::ObjectReferenceTemplate, - public virtual CORBA::DefaultValueRefCountBase -{ -public: - - /// Constructor - TAO_ObjectReferenceTemplate (const char *server_id, - const char *orb_id, - TAO_POA *poa); - - /** - * @name PortableInterceptor::ObjectReferenceTemplate Methods - * - * Methods required by the - * PortableInterceptor::ObjectReferenceTemplate ValueType. - */ - //@{ - virtual char * server_id (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual char * orb_id (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - - virtual PortableInterceptor::AdapterName * adapter_name ( - ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC ((CORBA::SystemException)); - //@} - - /** - * @name PortableInterceptor::ObjectReferenceFactory Methods - * - * Methods required by the - * PortableInterceptor::ObjectReferenceFactory ValueType. - */ - //@{ - virtual CORBA::Object_ptr make_object ( - const char * repository_id, - const PortableInterceptor::ObjectId & id - ACE_ENV_ARG_DECL_WITH_DEFAULTS) - ACE_THROW_SPEC (( - CORBA::SystemException - )); - //@} - - /// Set the underlying POA pointer. - /** - * Upon destruction of the POA that this ObjectReferenceTemplate is - * associated with, the underlying POA pointer will be set to zero - * to forcibly break all ties with the POA. This is necessary to - * prevent this ObjectReferenceTemplate from invoking the POA after - * it has been destroyed. - */ - void poa (TAO_POA * poa); - -protected: - - /// Destructor - /** - * Protected destructor to enforce proper memory management via - * reference counting. - */ - ~TAO_ObjectReferenceTemplate (void); - -private: - - const char *server_id_; - const char *orb_id_; - PortableInterceptor::AdapterName_var adapter_name_; - TAO_POA *poa_; - -}; - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -#pragma warning(pop) -#endif /* _MSC_VER */ - -#if defined (__ACE_INLINE__) -# include "ObjectReferenceTemplate.inl" -#endif /* ! __ACE_INLINE__ */ - -#include /**/ "ace/post.h" - -#endif /* TAO_OBJECT_REFERENCE_TEMPLATE_H */ diff --git a/TAO/tao/PortableServer/ObjectReferenceTemplate.inl b/TAO/tao/PortableServer/ObjectReferenceTemplate.inl deleted file mode 100644 index 14de581cafc..00000000000 --- a/TAO/tao/PortableServer/ObjectReferenceTemplate.inl +++ /dev/null @@ -1,9 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -ACE_INLINE void -TAO_ObjectReferenceTemplate::poa (TAO_POA * poa) -{ - this->poa_ = poa; -} diff --git a/TAO/tao/PortableServer/POA.cpp b/TAO/tao/PortableServer/POA.cpp index e8b042b4ab7..5ee4eb96c18 100644 --- a/TAO/tao/PortableServer/POA.cpp +++ b/TAO/tao/PortableServer/POA.cpp @@ -14,10 +14,10 @@ ACE_RCSID (PortableServer, #include "tao/StringSeqC.h" -#include "tao/PortableServer/IORInfo.h" -#include "tao/PortableServer/ObjectReferenceTemplate.h" #include "tao/PortableServer/Default_Acceptor_Filter.h" - +#include "tao/PortableServer/ORT_Adapter.h" +#include "tao/PortableServer/ORT_Adapter_Factory.h" +#include "tao/PortableInterceptorC.h" #include "tao/ORB_Core.h" #include "tao/ORB.h" #include "tao/Server_Strategy_Factory.h" @@ -28,8 +28,8 @@ ACE_RCSID (PortableServer, #include "tao/Stub.h" #include "tao/Profile.h" #include "tao/TSS_Resources.h" +#include "tao/IORInterceptor_Adapter.h" #include "tao/debug.h" -#include "tao/IORInterceptor/IORInterceptor_List.h" #include "Default_Acceptor_Filter.h" #include "ace/OS_NS_wchar.h" #include "ace/OS_NS_sys_time.h" @@ -41,6 +41,7 @@ ACE_RCSID (PortableServer, // auto_ptr class #include "ace/Auto_Ptr.h" +#include "ace/Dynamic_Service.h" #if !defined (__ACE_INLINE__) # include "POA.i" @@ -171,10 +172,14 @@ TAO_POA::create_request_processing_policy (PortableServer::RequestProcessingPoli void TAO_POA::set_obj_ref_factory ( PortableInterceptor::ObjectReferenceFactory *current_factory - ACE_ENV_ARG_DECL_NOT_USED) + ACE_ENV_ARG_DECL) { - CORBA::add_ref (current_factory); - this->obj_ref_factory_ = current_factory; + if (this->ORT_adapter (ACE_ENV_SINGLE_ARG_PARAMETER)) + { + // Activate a different factory + this->ort_adapter_->set_obj_ref_factory (current_factory + ACE_ENV_ARG_PARAMETER); + } } TAO_POA::TAO_POA (const TAO_POA::String &name, @@ -194,6 +199,7 @@ TAO_POA::TAO_POA (const TAO_POA::String &name, policies_ (policies), parent_ (parent), active_object_map_ (0), + ort_adapter_ (0), adapter_state_ (PortableInterceptor::HOLDING), #if (TAO_HAS_MINIMUM_POA == 0) @@ -345,22 +351,6 @@ TAO_POA::TAO_POA (const TAO_POA::String &name, } #endif /* TAO_HAS_MINIMUM_CORBA */ - - // Create an ObjectReferenceTemplate for this POA. - ACE_NEW_THROW_EX (this->def_ort_template_, - TAO_ObjectReferenceTemplate ( - this->orb_core_.server_id (), - this->orb_core_.orbid (), - this), - CORBA::NO_MEMORY ()); - ACE_CHECK; - - this->ort_template_ = this->def_ort_template_; - - // Must increase ref count since this->obj_ref_factory_ will - // descrease it upon destruction. - CORBA::add_ref (this->ort_template_.in ()); - this->obj_ref_factory_ = this->ort_template_; } TAO_POA::~TAO_POA (void) @@ -376,6 +366,7 @@ TAO_POA::complete_destruction_i (ACE_ENV_SINGLE_ARG_DECL) // Delete the active object map. delete this->active_object_map_; + active_object_map_ = 0; // Remove POA from the POAManager. int result = this->poa_manager_.remove_poa (this); @@ -426,6 +417,17 @@ TAO_POA::complete_destruction_i (ACE_ENV_SINGLE_ARG_DECL) } + if (this->ort_adapter_ != 0) + { + TAO::ORT_Adapter_Factory *ort_factory = + this->ORT_adapter_factory (); + + ort_factory->destroy (this->ort_adapter_ ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + + this->ort_adapter_ = 0; + } + CORBA::release (this); } @@ -731,11 +733,12 @@ TAO_POA::destroy_i (CORBA::Boolean etherealize_objects, } } - PortableInterceptor::ObjectReferenceTemplateSeq seq_obj_ref_template; + TAO::ORT_Array array_obj_ref_template; CORBA::ULong i = 0; - // Remove all children POAs + // Gather all ObjectReferenceTemplates and change all adapter states + // to inactivate for (CHILDREN::iterator iterator = this->children_.begin (); iterator != this->children_.end (); ++iterator) @@ -744,35 +747,47 @@ TAO_POA::destroy_i (CORBA::Boolean etherealize_objects, // Get the adapter template related to the ChildPOA PortableInterceptor::ObjectReferenceTemplate *child_at = - child_poa->get_adapter_template (); + child_poa->get_adapter_template_i (); - CORBA::add_ref (child_at); + // In case no ORT library is linked we get zero + if (child_at != 0) + { + // Add it to the sequence of object reference templates that + // will be destroyed. + array_obj_ref_template.size (i + 1); - // Add it to the sequence of object reference templates that - // will be destroyed. - seq_obj_ref_template.length (i + 1); + array_obj_ref_template[i] = child_at; + } - seq_obj_ref_template[i] = child_at; + child_poa->adapter_state_ = + PortableInterceptor::INACTIVE; - child_poa->adapter_state_ = PortableInterceptor::INACTIVE; + ++i; + } - child_poa->adapter_state_changed (seq_obj_ref_template, - child_poa->adapter_state_ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + // Notify the state changes to the IORInterceptors + this->adapter_state_changed (array_obj_ref_template, + PortableInterceptor::INACTIVE + ACE_ENV_ARG_PARAMETER); + ACE_CHECK; - ++i; + // Destroy all child POA's now. + for (CHILDREN::iterator destroy_iterator = this->children_.begin (); + destroy_iterator != this->children_.end (); + ++destroy_iterator) + { + TAO_POA *destroy_child_poa = (*destroy_iterator).int_id_; - child_poa->destroy_i (etherealize_objects, - wait_for_completion - ACE_ENV_ARG_PARAMETER); + destroy_child_poa->destroy_i (etherealize_objects, + wait_for_completion + ACE_ENV_ARG_PARAMETER); ACE_CHECK; } +#if (TAO_HAS_MINIMUM_CORBA == 0) // // ImplRepo related. // -#if (TAO_HAS_MINIMUM_CORBA == 0) if (this->cached_policies_.lifespan () == PortableServer::PERSISTENT) { this->imr_notify_shutdown (); @@ -825,6 +840,21 @@ TAO_POA::destroy_i (CORBA::Boolean etherealize_objects, (non_servant_upcall_in_progress == 0 || &non_servant_upcall_in_progress->poa () != this)) { + TAO::ORT_Array my_array_obj_ref_template; + + // Get the adapter template + PortableInterceptor::ObjectReferenceTemplate *adapter = + this->get_adapter_template_i (); + + if (adapter != 0) + { + // Add it to the sequence of object reference templates, we just notify + // for ourselves that we are now non_existent, our childs will do it + // for themselves. + array_obj_ref_template.size (1); + array_obj_ref_template[0] = adapter; + } + // According to the ORT spec, after a POA is destroyed, its state // has to be changed to NON_EXISTENT and all the registered // interceptors are to be informed. Since, the POA is destroyed @@ -838,14 +868,10 @@ TAO_POA::destroy_i (CORBA::Boolean etherealize_objects, this->adapter_state_ = PortableInterceptor::NON_EXISTENT; - this->adapter_state_changed (seq_obj_ref_template, + this->adapter_state_changed (array_obj_ref_template, this->adapter_state_ ACE_ENV_ARG_PARAMETER); ACE_CHECK; - - // Break all ties between the ObjectReferenceTemplate and this - // POA. - this->def_ort_template_->poa (0); } else { @@ -1017,31 +1043,19 @@ TAO_POA::add_ior_component_to_profile ( void TAO_POA::adapter_state_changed ( - const PortableInterceptor::ObjectReferenceTemplateSeq &seq_obj_ref_template, + const TAO::ORT_Array &array_obj_ref_template, PortableInterceptor::AdapterState state ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) { - /// First get a list of all the interceptors. - TAO_IORInterceptor_List * interceptor_list = - this->orb_core_.ior_interceptor_list (); + TAO_IORInterceptor_Adapter *ior_adapter = + this->orb_core_.ior_interceptor_adapter (); - if (interceptor_list == 0) - return; - - TAO_IORInterceptor_List::TYPE & interceptors = - interceptor_list->interceptors (); - - const size_t interceptor_count = interceptors.size (); - - if (interceptor_count == 0) - return; - - for (size_t i = 0; i < interceptor_count; ++i) + if (ior_adapter) { - interceptors[i]->adapter_state_changed (seq_obj_ref_template, - state - ACE_ENV_ARG_PARAMETER); + ior_adapter->adapter_state_changed (array_obj_ref_template, + state + ACE_ENV_ARG_PARAMETER); ACE_CHECK; } } @@ -1055,7 +1069,8 @@ TAO_POA::get_servant_manager_i (ACE_ENV_SINGLE_ARG_DECL) { // This operation requires the USE_SERVANT_MANAGER policy; if not // present, the WrongPolicy exception is raised. - if (this->cached_policies_.request_processing () != PortableServer::USE_SERVANT_MANAGER) + if (this->cached_policies_.request_processing () != + PortableServer::USE_SERVANT_MANAGER) { ACE_THROW_RETURN (PortableServer::POA::WrongPolicy (), PortableServer::ServantManager::_nil ()); @@ -1064,7 +1079,8 @@ TAO_POA::get_servant_manager_i (ACE_ENV_SINGLE_ARG_DECL) // This operation returns the servant manager associated with the // POA. If no servant manager has been associated with the POA, it // returns a null reference. - if (this->cached_policies_.servant_retention () == PortableServer::RETAIN) + if (this->cached_policies_.servant_retention () == + PortableServer::RETAIN) return PortableServer::ServantManager::_duplicate (this->servant_activator_.in ()); else return PortableServer::ServantManager::_duplicate (this->servant_locator_.in ()); @@ -1921,14 +1937,32 @@ TAO_POA::create_reference_i (const char *intf, 1, priority); + return this->invoke_key_to_object_helper_i (intf, + user_id + ACE_ENV_ARG_PARAMETER); +} + +CORBA::Object_ptr +TAO_POA::invoke_key_to_object_helper_i (const char * repository_id, + const PortableServer::ObjectId & id + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ const PortableInterceptor::ObjectId &user_oid = - ACE_reinterpret_cast (const PortableInterceptor::ObjectId &, - user_id); + reinterpret_cast <const PortableInterceptor::ObjectId &>(id); // Ask the ORT to create the object. - return this->obj_ref_factory_->make_object (intf, + if (this->ORT_adapter_i ()) + { + // Ask the ORT to create the object. + return this->ort_adapter_->make_object (repository_id, user_oid ACE_ENV_ARG_PARAMETER); + } + else + { + return this->invoke_key_to_object (ACE_ENV_SINGLE_ARG_PARAMETER); + } } CORBA::Object_ptr @@ -2005,13 +2039,8 @@ TAO_POA::create_reference_with_id_i (const PortableServer::ObjectId &user_id, 1, priority); - const PortableInterceptor::ObjectId &user_oid = - ACE_reinterpret_cast (const PortableInterceptor::ObjectId &, - user_id); - - // Ask the ORT to create the object. - return this->obj_ref_factory_->make_object (intf, - user_oid + return this->invoke_key_to_object_helper_i (intf, + user_id ACE_ENV_ARG_PARAMETER); } @@ -2253,19 +2282,14 @@ TAO_POA::servant_to_reference_i (PortableServer::Servant servant 1, priority); - const PortableInterceptor::ObjectId &user_oid = - ACE_reinterpret_cast (const PortableInterceptor::ObjectId &, - user_id); - // Ask the ORT to create the object. // @@NOTE:There is a possible deadlock lurking here. We held the // lock, and we are possibly trying to make a call into the // application code. Think what would happen if the app calls us // back. We need to get to this at some point. - return this->obj_ref_factory_->make_object ( - servant->_interface_repository_id (), - user_oid - ACE_ENV_ARG_PARAMETER); + return this->invoke_key_to_object_helper_i (servant->_interface_repository_id (), + user_id + ACE_ENV_ARG_PARAMETER); } PortableServer::Servant @@ -2605,13 +2629,8 @@ TAO_POA::id_to_reference_i (const PortableServer::ObjectId &id 1, priority); - const PortableInterceptor::ObjectId &user_oid = - ACE_reinterpret_cast (const PortableInterceptor::ObjectId &, - id); - - // Ask the ORT to create the object. - return this->obj_ref_factory_->make_object (servant->_interface_repository_id (), - user_oid + return this->invoke_key_to_object_helper_i (servant->_interface_repository_id (), + id ACE_ENV_ARG_PARAMETER); } else @@ -3740,127 +3759,26 @@ TAO_POA::key_to_stub_i (const TAO::ObjectKey &key, void TAO_POA::establish_components (ACE_ENV_SINGLE_ARG_DECL) { - // Iterate over the registered IOR interceptors so that they may be - // given the opportunity to add tagged components to the profiles - // for this servant. - /// First get a list of all the interceptors. - TAO_IORInterceptor_List * interceptor_list = - this->orb_core_.ior_interceptor_list (); - - if (interceptor_list == 0) - return; - - TAO_IORInterceptor_List::TYPE & interceptors = - interceptor_list->interceptors (); - - const size_t interceptor_count = interceptors.size (); - - if (interceptor_count == 0) - return; + TAO_IORInterceptor_Adapter *ior_adapter = + this->orb_core_.ior_interceptor_adapter (); - TAO_IORInfo *tao_info = 0; - ACE_NEW_THROW_EX (tao_info, - TAO_IORInfo (this), - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO_DEFAULT_MINOR_CODE, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK; - - PortableInterceptor::IORInfo_var info = tao_info; - - // Release the POA during IORInterceptor calls to avoid potential - // deadlocks. - TAO_Object_Adapter::Non_Servant_Upcall non_servant_upcall (*this); - ACE_UNUSED_ARG (non_servant_upcall); - - for (size_t i = 0; i < interceptor_count; ++i) + if (ior_adapter) { - ACE_TRY - { - interceptors[i]->establish_components (info.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - // According to the Portable Interceptors specification, - // IORInterceptor::establish_components() must not throw an - // exception. If it does, then the ORB is supposed to - // ignore it and continue processing the remaining - // IORInterceptors. - if (TAO_debug_level > 1) - { - CORBA::String_var name = interceptors[i]->name ( - ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - // @@ What do we do if we get an exception here? - - if (name.in () != 0) - { - ACE_DEBUG ((LM_WARNING, - "(%P|%t) Exception thrown while processing " - "IORInterceptor \"%s\">\n", - ACE_TEXT_CHAR_TO_TCHAR (name.in ()))); - } - - ACE_PRINT_TAO_EXCEPTION (ACE_ANY_EXCEPTION, - "Ignoring exception in " - "IORInterceptor::establish_components"); - } - } - ACE_ENDTRY; + ior_adapter->establish_components (this ACE_ENV_ARG_PARAMETER); ACE_CHECK; } - - tao_info->components_established (); - - this->components_established (info.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - // The IORInfo instance is no longer valid. Invalidate it to - // prevent the user from peforming "illegal" operations. - tao_info->invalidate (); } void TAO_POA::components_established (PortableInterceptor::IORInfo_ptr info ACE_ENV_ARG_DECL) { - // 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 * interceptor_list = - this->orb_core_.ior_interceptor_list (); + TAO_IORInterceptor_Adapter *ior_adapter = + this->orb_core_.ior_interceptor_adapter (); - if (interceptor_list == 0) - return; - - TAO_IORInterceptor_List::TYPE & interceptors = - interceptor_list->interceptors (); - - const size_t interceptor_count = interceptors.size (); - - // All the establish_components() interception points have been - // invoked. Now call the components_established() interception point - // on all the IORInterceptors. - for (size_t j = 0; j < interceptor_count; ++j) + if (ior_adapter) { - ACE_TRY - { - interceptors[j]->components_established ( - info - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_THROW (CORBA::OBJ_ADAPTER (CORBA::OMGVMCID | 6, - CORBA::COMPLETED_NO)); - } - ACE_ENDTRY; + ior_adapter->components_established (info ACE_ENV_ARG_PARAMETER); ACE_CHECK; } } @@ -4170,6 +4088,82 @@ TAO_POA::imr_notify_shutdown (void) #endif /* TAO_HAS_MINIMUM_CORBA */ +TAO::ORT_Adapter_Factory * +TAO_POA::ORT_adapter_factory (void) +{ + return ACE_Dynamic_Service<TAO::ORT_Adapter_Factory>::instance ( + TAO_POA::ort_adapter_factory_name ()); +} + +TAO::ORT_Adapter * +TAO_POA::ORT_adapter_i (void) +{ + if (this->ort_adapter_ != 0) + return this->ort_adapter_; + + ACE_DECLARE_NEW_CORBA_ENV; + ACE_TRY + { + TAO::ORT_Adapter_Factory * ort_ap_factory = + this->ORT_adapter_factory (); + + if (!ort_ap_factory) + return 0; + + // Get the full adapter name of this POA, do this before we + // create the adapter so that in case this fails, we just + // return 0 and not a not activated adapter + PortableInterceptor::AdapterName *adapter_name = + this->adapter_name_i (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + this->ort_adapter_ = + ort_ap_factory->create (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + + if (!ort_adapter_) + return 0; + + // @todo We have to look at this, we activate it but hold the POA lock, + // in case we are called by ORT_adapter, we shouldn't keep the lock + // here, but then the ort_adapter should be guarded against multiple + // activations. + this->ort_adapter_->activate (this->orb_core_.server_id (), + this->orb_core_.orbid (), + adapter_name, + this + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "(%P|%t) Cannot initialize the " + "object_reference_template_adapter\n"); + } + ACE_ENDTRY; + ACE_CHECK_RETURN (0); + + return this->ort_adapter_; +} + +TAO::ORT_Adapter * +TAO_POA::ORT_adapter (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + if (this->ort_adapter_ != 0) + return this->ort_adapter_; + + // Lock access for the duration of this transaction. + TAO_POA_GUARD_RETURN (0); + + // DCL .. + if (this->ort_adapter_ != 0) + return this->ort_adapter_; + + return this->ORT_adapter_i (); +} + TAO_POA_Guard::TAO_POA_Guard (TAO_POA &poa ACE_ENV_ARG_DECL, int check_for_destruction) @@ -4304,6 +4298,53 @@ TAO_POA::Key_To_Object_Params::set (PortableServer::ObjectId_var &system_id, this->priority_ = priority; } +void +TAO_POA::ort_adapter_factory_name (const char *name) +{ + TAO_POA_Static_Resources::instance ()->ort_adapter_factory_name_ = + name; +} + +const char * +TAO_POA::ort_adapter_factory_name (void) +{ + return TAO_POA_Static_Resources::instance ()->ort_adapter_factory_name_.c_str(); +} + +// Initialize instance_ to 0, since this is what we test for in the call +// to instance (). Note that this does not require a constructor call, so +// it is always initialized by the time that instance () can be called. +TAO_POA_Static_Resources* TAO_POA_Static_Resources::instance_ = 0; + +// Force an instance to be created at module initialization time, +// since we do not want to worry about double checked locking and +// the race condition to initialize the lock. +TAO_POA_Static_Resources* TAO_POA_Static_Resources::initialization_reference_ = + TAO_POA_Static_Resources::instance (); + +TAO_POA_Static_Resources* +TAO_POA_Static_Resources::instance (void) +{ + if (TAO_POA_Static_Resources::instance_ == 0) + { + // This new is never freed on purpose. The data specified by + // it needs to be around for the last shared library that references + // this class. This could occur in a destructor in a shared library + // that is unloaded after this one. One solution to avoid this + // harmless memory leak would be to use reference counting. + ACE_NEW_RETURN (TAO_POA_Static_Resources::instance_, + TAO_POA_Static_Resources (), + 0); + } + + return TAO_POA_Static_Resources::instance_; +} + +TAO_POA_Static_Resources::TAO_POA_Static_Resources (void) + : ort_adapter_factory_name_ ("ORT_Adapter_Factory") +{ +} + #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_Array_Base<TAO_Active_Object_Map::Map_Entry *>; @@ -4321,13 +4362,11 @@ template class ACE_Write_Guard<ACE_Lock>; template class ACE_Read_Guard<ACE_Lock>; template class ACE_Array_Base <IOP::ProfileId>; -//template class auto_ptr<TAO_Active_Object_Map_Iterator_Impl>; template class auto_ptr<TAO_Active_Object_Map>; # if defined (ACE_LACKS_AUTO_PTR) \ || !(defined (ACE_HAS_STANDARD_CPP_LIBRARY) \ && (ACE_HAS_STANDARD_CPP_LIBRARY != 0)) -//template class ACE_Auto_Basic_Ptr<TAO_Active_Object_Map_Iterator_Impl>; template class ACE_Auto_Basic_Ptr<TAO_Active_Object_Map>; # endif /* ACE_LACKS_AUTO_PTR */ @@ -4349,13 +4388,11 @@ template class ACE_Node<TAO_POA *>; #pragma instantiate ACE_Write_Guard<ACE_Lock> #pragma instantiate ACE_Read_Guard<ACE_Lock> -//#pragma instantiate auto_ptr<TAO_Active_Object_Map_Iterator_Impl> #pragma instantiate auto_ptr<TAO_Active_Object_Map> # if defined (ACE_LACKS_AUTO_PTR) \ || !(defined (ACE_HAS_STANDARD_CPP_LIBRARY) \ && (ACE_HAS_STANDARD_CPP_LIBRARY != 0)) -//# pragma instantiate ACE_Auto_Basic_Ptr<TAO_Active_Object_Map_Iterator_Impl> # pragma instantiate ACE_Auto_Basic_Ptr<TAO_Active_Object_Map> # endif /* ACE_LACKS_AUTO_PTR */ diff --git a/TAO/tao/PortableServer/POA.h b/TAO/tao/PortableServer/POA.h index 3b73f2f5b52..6de036d8770 100644 --- a/TAO/tao/PortableServer/POA.h +++ b/TAO/tao/PortableServer/POA.h @@ -42,12 +42,9 @@ #include "tao/LocalObject.h" // Portable Interceptor -#include "tao/PortableInterceptorC.h" +#include "tao/PI_ForwardC.h" -// Map #include "ace/Hash_Map_Manager_T.h" - -// ACE_Array_Base #include "ace/Array_Base.h" // Locking @@ -59,6 +56,8 @@ // OctetSeq #include "tao/OctetSeqC.h" +#include "ORT_Adapter.h" + // This is to remove "inherits via dominance" warnings from MSVC. // MSVC is being a little too paranoid. #if defined(_MSC_VER) @@ -68,15 +67,11 @@ #pragma warning(disable:4250) #endif /* _MSC_VER */ -class TAO_Acceptor_Filter; -class TAO_Acceptor_Registry; class TAO_Temporary_Creation_Time; -class TAO_ObjectReferenceTemplate; class TAO_Creation_Time { public: - TAO_Creation_Time (const ACE_Time_Value &creation_time); TAO_Creation_Time (void); @@ -136,6 +131,9 @@ protected: // Forward Declaration class ServerObject_i; +class TAO_Acceptor_Filter; +class TAO_Acceptor_Registry; +class TAO_IORInfo; namespace PortableInterceptor { @@ -143,6 +141,12 @@ namespace PortableInterceptor typedef IORInfo *IORInfo_ptr; } +namespace TAO +{ + class ORT_Adapter; + class ORT_Adapter_Factory; +} + /** * @class TAO_POA * @@ -162,7 +166,7 @@ public: friend class TAO_POA_Current_Impl; friend class TAO_POA_Manager; friend class TAO_RT_Collocation_Resolver; - friend class TAO_ObjectReferenceTemplate; + friend class TAO_IORInfo; typedef ACE_CString String; @@ -272,20 +276,6 @@ public: PortableInterceptor::AdapterName *adapter_name (ACE_ENV_SINGLE_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); - /// Accessor methods to ObjectReferenceTemplate - PortableInterceptor::ObjectReferenceTemplate * get_adapter_template (void); - - void set_adapter_template (PortableInterceptor::ObjectReferenceTemplate * - object_ref_template - ACE_ENV_ARG_DECL); - - /// Accessor methods to PortableInterceptor::ObjectReferenceFactory - PortableInterceptor::ObjectReferenceFactory * get_obj_ref_factory (void); - - void set_obj_ref_factory ( - PortableInterceptor::ObjectReferenceFactory *current_factory - ACE_ENV_ARG_DECL); - /// Store the given TaggedComponent for eventual insertion into all /// object reference profiles. void save_ior_component (const IOP::TaggedComponent &component @@ -406,8 +396,9 @@ public: ACE_THROW_SPEC ((CORBA::SystemException)); #if (TAO_HAS_MINIMUM_POA == 0) - // Methods added by the MIOP specification. - + // Methods added by the + /// @name MIOP specification methods + //@{ virtual PortableServer::ObjectId * create_id_for_reference ( CORBA::Object_ptr the_ref ACE_ENV_ARG_DECL_WITH_DEFAULTS @@ -446,11 +437,9 @@ public: CORBA::SystemException, PortableServer::NotAGroupObject )); - - // End methods added by MIOP. + //@} #endif /* TAO_HAS_MINIMUM_POA == 0 */ - /// Accessor for POA policies. TAO_POA_Policy_Set &policies (void); @@ -557,6 +546,12 @@ public: CORBA::Boolean waiting_destruction (void) const; + static void ort_adapter_factory_name (const char *name); + + static const char *ort_adapter_factory_name (void); + + CORBA::Object_ptr invoke_key_to_object (ACE_ENV_SINGLE_ARG_DECL); + protected: /// Template method for creating new POA's of this type. @@ -613,10 +608,9 @@ protected: /// Method to notify the IOR Interceptors when there is a state /// changed not related to POAManager. void adapter_state_changed ( - const PortableInterceptor::ObjectReferenceTemplateSeq &seq_obj_ref_template, + const TAO::ORT_Array &array_obj_ref_template, PortableInterceptor::AdapterState state - ACE_ENV_ARG_DECL - ) + ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); /// Add the given tagged component to all profiles. @@ -658,21 +652,18 @@ protected: #endif /* TAO_HAS_MINIMUM_POA == 0 */ -// -// ImplRepo related. -// #if (TAO_HAS_MINIMUM_CORBA == 0) + /// @name Implementation repository related methods + //@{ /// ImplRepo helper method, notify the ImplRepo on startup void imr_notify_startup (ACE_ENV_SINGLE_ARG_DECL); /// ImplRepo helper method, notify the ImplRepo on shutdown void imr_notify_shutdown (void); - + //@} #endif /* TAO_HAS_MINIMUM_CORBA */ - CORBA::Object_ptr invoke_key_to_object (ACE_ENV_SINGLE_ARG_DECL); - /// Wrapper for the ORB's key_to_object that will alter the object pointer /// if the ImplRepo is used. CORBA::Object_ptr key_to_object (const TAO::ObjectKey &key, @@ -859,6 +850,24 @@ protected: static TAO_POA_Policy_Set &default_poa_policies (void); protected: + /// Accessor methods to ObjectReferenceTemplate + PortableInterceptor::ObjectReferenceTemplate * + get_adapter_template (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Accessor methods to ObjectReferenceTemplate, non locked version + PortableInterceptor::ObjectReferenceTemplate *get_adapter_template_i (void); + + /// Accessor methods to PortableInterceptor::ObjectReferenceFactory + PortableInterceptor::ObjectReferenceFactory * + get_obj_ref_factory (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Set the object reference factory + void set_obj_ref_factory ( + PortableInterceptor::ObjectReferenceFactory *current_factory + ACE_ENV_ARG_DECL); + TAO_SERVANT_LOCATION locate_servant_i (const PortableServer::ObjectId &id, PortableServer::Servant &servant @@ -873,6 +882,23 @@ protected: ACE_ENV_ARG_DECL ); + CORBA::Object_ptr + invoke_key_to_object_helper_i (const char * repository_id, + const PortableServer::ObjectId & id + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Get the ORT adapter, in case there is no adapter yet, this method will + /// try to create one and hold the POA lock + TAO::ORT_Adapter *ORT_adapter (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)); + + /// Get the ORT adapter, in case there is no adapter yet, this method will + /// try to create one but assumes the POA lock is already hole + TAO::ORT_Adapter *ORT_adapter_i (void); + + TAO::ORT_Adapter_Factory *ORT_adapter_factory (void); + const TAO_Creation_Time &creation_time (void); CORBA::Boolean persistent (void); @@ -935,13 +961,8 @@ protected: CORBA::OctetSeq id_; - /// Keep a copy of the pointer to the actual implementation around - /// so that we can call some TAO-specific methods on it. - TAO_ObjectReferenceTemplate * def_ort_template_; - - PortableInterceptor::ObjectReferenceTemplate_var ort_template_; - - PortableInterceptor::ObjectReferenceFactory_var obj_ref_factory_; + /// Pointer to the object reference template adapter. + TAO::ORT_Adapter *ort_adapter_; /// Adapter can be accepting, rejecting etc. PortableInterceptor::AdapterState adapter_state_; @@ -1073,6 +1094,56 @@ protected: #endif /* TAO_HAS_MINIMUM_POA == 0 */ +/** + * @class TAO_POA_Static_Resources + * + * @brief The static (global) resoures of all POA's. + * + * This class is used by the POA to store the resources global to + * all POA's. All instance variables that would have been + * declared "static" in TAO_POA, should be declared in this class + * to avoid the "static initialization order fiasco" as described in + * http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.11. + * Briefly, this is the problem that occurs if any static initializers + * in any other code call into set static members of TAO_POA. + * Since the order in which these initializers execute is unspecified, + * uninitialized members can be accessed. + */ +class TAO_PortableServer_Export TAO_POA_Static_Resources +{ +public: + + /// Return the singleton instance. + static TAO_POA_Static_Resources* instance (void); + +public: + + /** + * Name of the factory object used to adapt function calls on the + * PortableInterceptor interfaces ORT. The default value is + * "ObjectReferenceTemplate_Adapter_Factory". If the ORT library is linked, + * the corresponding accessor function + * objectreferencefactory_adapter_factory_name() will be called to set + * the value to "Concrete_ObjectReferenceTemplate_Adapter_Factory". + */ + ACE_CString ort_adapter_factory_name_; + +private: + /// Constructor. + TAO_POA_Static_Resources (void); + +private: + /// The singleton instance. + static TAO_POA_Static_Resources* instance_; + + /// Mostly unused variable whose sole purpose is to enforce + /// the instantiation of a TAO_POA_Static_Resources instance + /// at initialization time. + static TAO_POA_Static_Resources* initialization_reference_; +}; + +// **************************************************************** + #if defined(_MSC_VER) && (_MSC_VER >= 1200) #pragma warning(pop) #endif /* _MSC_VER */ diff --git a/TAO/tao/PortableServer/POA.i b/TAO/tao/PortableServer/POA.i index 761d5d67c13..9821fa6efb4 100644 --- a/TAO/tao/PortableServer/POA.i +++ b/TAO/tao/PortableServer/POA.i @@ -464,15 +464,38 @@ TAO_POA::adapter_name (ACE_ENV_SINGLE_ARG_DECL) } ACE_INLINE PortableInterceptor::ObjectReferenceTemplate * -TAO_POA::get_adapter_template () +TAO_POA::get_adapter_template (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + if (this->ORT_adapter (ACE_ENV_SINGLE_ARG_PARAMETER)) + { + return this->ort_adapter_->get_adapter_template(); + } + + return 0; +} + +ACE_INLINE PortableInterceptor::ObjectReferenceTemplate * +TAO_POA::get_adapter_template_i () { - return this->ort_template_; + if (this->ORT_adapter_i ()) + { + return this->ort_adapter_->get_adapter_template (); + } + + return 0; } ACE_INLINE PortableInterceptor::ObjectReferenceFactory * -TAO_POA::get_obj_ref_factory () +TAO_POA::get_obj_ref_factory (ACE_ENV_SINGLE_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) { - return this->obj_ref_factory_; + if (this->ORT_adapter (ACE_ENV_SINGLE_ARG_PARAMETER)) + { + return this->ort_adapter_->get_obj_ref_factory(); + } + + return 0; } #if (TAO_HAS_MINIMUM_POA == 0) diff --git a/TAO/tao/PortableServer/POAManager.cpp b/TAO/tao/PortableServer/POAManager.cpp index 66a9c9eba95..3c484a85c23 100644 --- a/TAO/tao/PortableServer/POAManager.cpp +++ b/TAO/tao/PortableServer/POAManager.cpp @@ -3,11 +3,9 @@ #include "POAManager.h" #include "POA.h" #include "poa_macros.h" -#include "tao/IORInterceptor/IORInterceptorC.h" #include "tao/Server_Strategy_Factory.h" -#include "tao/Interceptor_List.h" #include "tao/ORB_Core.h" -#include "tao/IORInterceptor/IORInterceptor_List.h" +#include "tao/IORInterceptor_Adapter.h" #if !defined (__ACE_INLINE__) # include "POAManager.i" @@ -140,29 +138,14 @@ TAO_POA_Manager::adapter_manager_state_changed (PortableServer::POAManager::Stat { PortableInterceptor::AdapterState adapter_state = state; - /// Whenever the POAManager state is changed, the - /// adapter_manager_state_changed method is to be invoked on all the IOR - /// Interceptors. - TAO_IORInterceptor_List *interceptor_list = - this->object_adapter_.orb_core ().ior_interceptor_list (); + TAO_IORInterceptor_Adapter *ior_adapter = + this->object_adapter_.orb_core ().ior_interceptor_adapter (); - if (interceptor_list == 0) - return; - - TAO_IORInterceptor_List::TYPE &interceptors = - interceptor_list->interceptors (); - - const size_t interceptor_count = interceptors.size (); - - if (interceptor_count == 0) - return; - - for (size_t i = 0; i < interceptor_count; ++i) + if (ior_adapter) { - interceptors[i]->adapter_manager_state_changed ( - TAO_POA_Manager::poa_manager_id_, - adapter_state - ACE_ENV_ARG_PARAMETER); + ior_adapter->adapter_manager_state_changed (TAO_POA_Manager::poa_manager_id_, + adapter_state + ACE_ENV_ARG_PARAMETER); ACE_CHECK; } } diff --git a/TAO/tao/PortableServer/POAManager.h b/TAO/tao/PortableServer/POAManager.h index c0e8019d9a3..93db1c0d551 100644 --- a/TAO/tao/PortableServer/POAManager.h +++ b/TAO/tao/PortableServer/POAManager.h @@ -29,7 +29,6 @@ #include "tao/LocalObject.h" #include "tao/PortableInterceptorC.h" -#include "tao/ObjRefTemplate/ObjectReferenceTemplateC.h" #include "ace/Unbounded_Set.h" // Forward decl. |