summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2004-08-20 11:47:31 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2004-08-20 11:47:31 +0000
commitfc88fcb477a4e2f86dad70339840ee178e751c23 (patch)
tree56b74a5e09aa292b5e65b9cfc46a33f0e5a22550
parent5505c32e5e704f36944c0efb42ff6ae33de420b9 (diff)
downloadATCD-fc88fcb477a4e2f86dad70339840ee178e751c23.tar.gz
ChangeLogTag: Fri Aug 20 11:44:12 UTC 2004 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r--TAO/tao/IORInterceptor.mpc2
-rw-r--r--TAO/tao/IORInterceptor/IORInfo.cpp (renamed from TAO/tao/PortableServer/IORInfo.cpp)5
-rw-r--r--TAO/tao/IORInterceptor/IORInfo.h (renamed from TAO/tao/PortableServer/IORInfo.h)2
-rw-r--r--TAO/tao/IORInterceptor/IORInfo.inl (renamed from TAO/tao/PortableServer/IORInfo.inl)0
-rw-r--r--TAO/tao/IORInterceptor/IORInterceptor_Adapter_Factory_Impl.cpp2
-rw-r--r--TAO/tao/IORInterceptor/IORInterceptor_Adapter_Impl.cpp162
-rw-r--r--TAO/tao/IORInterceptor/IORInterceptor_Adapter_Impl.h25
-rw-r--r--TAO/tao/IORInterceptor/IORInterceptor_List.h1
-rw-r--r--TAO/tao/IORInterceptor_Adapter.h38
-rw-r--r--TAO/tao/ORB_Core.cpp11
-rw-r--r--TAO/tao/ORB_Core.h9
-rw-r--r--TAO/tao/PortableServer.mpc2
-rw-r--r--TAO/tao/PortableServer/ORTRework.txt37
-rw-r--r--TAO/tao/PortableServer/POA.cpp140
-rw-r--r--TAO/tao/PortableServer/POAManager.cpp31
-rw-r--r--bin/MakeProjectCreator/config/iorinterceptor.mpb2
-rw-r--r--bin/MakeProjectCreator/config/objreftemplate.mpb2
-rw-r--r--bin/MakeProjectCreator/config/portableserver.mpb2
18 files changed, 300 insertions, 173 deletions
diff --git a/TAO/tao/IORInterceptor.mpc b/TAO/tao/IORInterceptor.mpc
index 5235c369482..5141059d624 100644
--- a/TAO/tao/IORInterceptor.mpc
+++ b/TAO/tao/IORInterceptor.mpc
@@ -1,5 +1,5 @@
//$Id$
-project : taolib, objreftemplate, core {
+project : taolib, portableserver, objreftemplate, core {
sharedname = TAO_IORInterceptor
dynamicflags = TAO_IORINTERCEPTOR_BUILD_DLL
diff --git a/TAO/tao/PortableServer/IORInfo.cpp b/TAO/tao/IORInterceptor/IORInfo.cpp
index 005b850cbdd..17904d46e1c 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__ */
diff --git a/TAO/tao/PortableServer/IORInfo.h b/TAO/tao/IORInterceptor/IORInfo.h
index 2cc5954e87a..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/IORInfoC.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/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.h b/TAO/tao/IORInterceptor/IORInterceptor_List.h
index 496221ffb99..8402af38b09 100644
--- a/TAO/tao/IORInterceptor/IORInterceptor_List.h
+++ b/TAO/tao/IORInterceptor/IORInterceptor_List.h
@@ -75,7 +75,6 @@ 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/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index 7530bde6ff3..5abdf1c2e1c 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)
{
diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h
index 82c7df7975d..2b5565a4f45 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;
@@ -931,13 +930,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
@@ -1073,8 +1074,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.mpc b/TAO/tao/PortableServer.mpc
index 96558955e10..b99de8ae06c 100644
--- a/TAO/tao/PortableServer.mpc
+++ b/TAO/tao/PortableServer.mpc
@@ -1,5 +1,5 @@
//$Id$
-project : taolib, core, iorinterceptor {
+project : taolib, core, valuetype {
sharedname = TAO_PortableServer
dynamicflags = TAO_PORTABLESERVER_BUILD_DLL
diff --git a/TAO/tao/PortableServer/ORTRework.txt b/TAO/tao/PortableServer/ORTRework.txt
index d2af090c8ca..c06f7dfc279 100644
--- a/TAO/tao/PortableServer/ORTRework.txt
+++ b/TAO/tao/PortableServer/ORTRework.txt
@@ -1,3 +1,40 @@
+Fri Aug 20 11:44:12 UTC 2004 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * tao/IORInterceptor.mpc:
+ IORInterceptor is now dependent on PortableServer
+
+ * tao/IORInterceptor_Adapter.h:
+ Added several new pure virtual methods that must be implemented by
+ the real adapter implementations
+
+ * tao/ORB_Core.{h,cpp}:
+ Removed ior_interceptor_list(), make ior_interceptor_adapter()
+ public, the POA will just retrieve the ior_interceptor_adapter from
+ the ORB core and will use it then from then.
+
+ * tao/PortableServer.mpc:
+ PortableServer is not dependent on IORInterceptor anymore.
+
+ * tao/IORInterceptor/IORInterceptor_Adapter_Factory_Impl.cpp:
+ Initialise pointer with 0.
+
+ * tao/IORInterceptor/IORInterceptor_Adapter_Impl.{h,cpp}:
+ Implemented new pure virtual methods from the base, this code was
+ previously in the POA, but couples the POA to the IORInterceptor, by
+ moving it here we can decouple it
+
+ * tao/PortableServer/POA.cpp:
+ * tao/PortableServer/POAManager.cpp:
+ Instead of handling IORInterceptors here, just try to retrieve the
+ IORInterceptor adapter from the ORB Core and pass the call to the
+ adapter, this removes the dependency of the POA on IORInterceptor
+
+ * tao/PortableServer/IORInfo.{h,cpp,inl}:
+ * tao/IORInterceptor/IORInfo.{h,cpp,inl}:
+ Moved this class from PortableServer to IORInterceptor, because of
+ the changes above the usage of IORInfo is restricted to the
+ IORInterceptor library
+
Fri Aug 20 07:59:12 UTC 2004 Johnny Willemsen <jwillemsen@remedy.nl>
* tao/IORInterceptor/IORInterceptor.pidl:
diff --git a/TAO/tao/PortableServer/POA.cpp b/TAO/tao/PortableServer/POA.cpp
index 4c9f7b936e6..206b1971473 100644
--- a/TAO/tao/PortableServer/POA.cpp
+++ b/TAO/tao/PortableServer/POA.cpp
@@ -14,7 +14,7 @@ ACE_RCSID (PortableServer,
#include "tao/StringSeqC.h"
-#include "tao/PortableServer/IORInfo.h"
+#include "tao/IORInterceptor/IORInfoC.h" // needed for the HOLDING and other state constants, would like to zap this
#include "tao/PortableServer/Default_Acceptor_Filter.h"
#include "tao/PortableServer/ObjectReferenceTemplate_Adapter.h"
#include "tao/PortableServer/ObjectReferenceTemplate_Adapter_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"
@@ -1023,17 +1023,16 @@ TAO_POA::adapter_state_changed (
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;
-
- interceptor_list->adapter_state_changed (array_obj_ref_template,
- state
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
+ if (ior_adapter)
+ {
+ ior_adapter->adapter_state_changed (array_obj_ref_template,
+ state
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
}
#if (TAO_HAS_MINIMUM_POA == 0)
@@ -3733,127 +3732,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_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);
+ TAO_IORInterceptor_Adapter *ior_adapter =
+ this->orb_core_.ior_interceptor_adapter ();
- 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 ();
-
- if (interceptor_list == 0)
- return;
+ TAO_IORInterceptor_Adapter *ior_adapter =
+ this->orb_core_.ior_interceptor_adapter ();
- 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;
}
}
diff --git a/TAO/tao/PortableServer/POAManager.cpp b/TAO/tao/PortableServer/POAManager.cpp
index 66a9c9eba95..c6e9275fd2e 100644
--- a/TAO/tao/PortableServer/POAManager.cpp
+++ b/TAO/tao/PortableServer/POAManager.cpp
@@ -3,11 +3,11 @@
#include "POAManager.h"
#include "POA.h"
#include "poa_macros.h"
-#include "tao/IORInterceptor/IORInterceptorC.h"
+#include "tao/IORInterceptor/IORInfoC.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 +140,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_,
+ state
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
}
}
diff --git a/bin/MakeProjectCreator/config/iorinterceptor.mpb b/bin/MakeProjectCreator/config/iorinterceptor.mpb
index 208e574c7ad..43310026ccd 100644
--- a/bin/MakeProjectCreator/config/iorinterceptor.mpb
+++ b/bin/MakeProjectCreator/config/iorinterceptor.mpb
@@ -1,7 +1,7 @@
// -*- MPC -*-
// $Id$
-project : taolib, objreftemplate, valuetype {
+project : taolib, portableserver, objreftemplate, valuetype {
after += IORInterceptor
libs += TAO_IORInterceptor
}
diff --git a/bin/MakeProjectCreator/config/objreftemplate.mpb b/bin/MakeProjectCreator/config/objreftemplate.mpb
index 78215f78863..e887919b2c7 100644
--- a/bin/MakeProjectCreator/config/objreftemplate.mpb
+++ b/bin/MakeProjectCreator/config/objreftemplate.mpb
@@ -1,7 +1,7 @@
// -*- MPC -*-
// $Id$
-project : valuetype {
+project : portableserver, valuetype {
after += ObjRefTemplate
libs += TAO_ObjRefTemplate
}
diff --git a/bin/MakeProjectCreator/config/portableserver.mpb b/bin/MakeProjectCreator/config/portableserver.mpb
index 44cfd1d4814..10ea2d17f17 100644
--- a/bin/MakeProjectCreator/config/portableserver.mpb
+++ b/bin/MakeProjectCreator/config/portableserver.mpb
@@ -1,7 +1,7 @@
// -*- MPC -*-
// $Id$
-project : taolib, objreftemplate, valuetype, iorinterceptor {
+project : taolib, valuetype {
after += PortableServer
libs += TAO_PortableServer
}