summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryamuna <yamuna@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-06-26 23:50:47 +0000
committeryamuna <yamuna@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-06-26 23:50:47 +0000
commitb5a916f9606349ee95745110b6d4cb2a9666598d (patch)
tree9af859564e668b9f265103b7d372fbb98bf29716
parent153a9f23691da174c79c824d3cb7ab627dd046c6 (diff)
downloadATCD-b5a916f9606349ee95745110b6d4cb2a9666598d.tar.gz
ChangelogTag: Wed June 26 2:09:00 2002 Yamuna Krishnamurthy <yamuna@oomworks.com>
-rw-r--r--TAO/tao/RTCORBA/Linear_Network_Priority_Mapping.cpp130
-rw-r--r--TAO/tao/RTCORBA/Linear_Network_Priority_Mapping.h73
-rw-r--r--TAO/tao/RTCORBA/Linear_Network_Priority_Mapping.i1
-rw-r--r--TAO/tao/RTCORBA/Network_Priority_Mapping.cpp15
-rw-r--r--TAO/tao/RTCORBA/Network_Priority_Mapping.h62
-rw-r--r--TAO/tao/RTCORBA/Network_Priority_Mapping.i1
-rw-r--r--TAO/tao/RTCORBA/Network_Priority_Mapping_Manager.cpp71
-rw-r--r--TAO/tao/RTCORBA/Network_Priority_Mapping_Manager.h164
-rw-r--r--TAO/tao/RTCORBA/Network_Priority_Mapping_Manager.i220
-rw-r--r--TAO/tao/RTCORBA/RT_Protocols_Hooks.cpp277
-rw-r--r--TAO/tao/RTCORBA/RT_Protocols_Hooks.h61
-rw-r--r--TAO/tao/RTPortableServer/RT_POA.h2
-rw-r--r--TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp49
-rw-r--r--TAO/tao/RTPortableServer/RT_Servant_Dispatcher.h5
-rw-r--r--TAO/tao/Strategies/UIOP_Acceptor.cpp2
-rw-r--r--TAO/tao/Strategies/UIOP_Connector.cpp2
16 files changed, 1118 insertions, 17 deletions
diff --git a/TAO/tao/RTCORBA/Linear_Network_Priority_Mapping.cpp b/TAO/tao/RTCORBA/Linear_Network_Priority_Mapping.cpp
new file mode 100644
index 00000000000..5f9e9c555a8
--- /dev/null
+++ b/TAO/tao/RTCORBA/Linear_Network_Priority_Mapping.cpp
@@ -0,0 +1,130 @@
+// $Id$
+
+#include "tao/orbconf.h"
+
+#include "Linear_Network_Priority_Mapping.h"
+#include "tao/debug.h"
+#include "ace/Sched_Params.h"
+
+#if !defined (__ACE_INLINE__)
+# include "Linear_Network_Priority_Mapping.i"
+#endif /* ! __ACE_INLINE__ */
+
+ACE_RCSID(Strategies, Linear_Network_Priority_Mapping, "$Id$")
+
+#define IPDSFIELD_DSCP_DEFAULT 0x00
+#define IPDSFIELD_DSCP_CS1 0x08
+#define IPDSFIELD_DSCP_CS2 0x10
+#define IPDSFIELD_DSCP_CS3 0x18
+#define IPDSFIELD_DSCP_CS4 0x20
+#define IPDSFIELD_DSCP_CS5 0x28
+#define IPDSFIELD_DSCP_CS6 0x30
+#define IPDSFIELD_DSCP_CS7 0x38
+#define IPDSFIELD_DSCP_AF11 0x0A
+#define IPDSFIELD_DSCP_AF12 0x0C
+#define IPDSFIELD_DSCP_AF13 0x0E
+#define IPDSFIELD_DSCP_AF21 0x12
+#define IPDSFIELD_DSCP_AF22 0x14
+#define IPDSFIELD_DSCP_AF23 0x16
+#define IPDSFIELD_DSCP_AF31 0x1A
+#define IPDSFIELD_DSCP_AF32 0x1C
+#define IPDSFIELD_DSCP_AF33 0x1E
+#define IPDSFIELD_DSCP_AF41 0x22
+#define IPDSFIELD_DSCP_AF42 0x24
+#define IPDSFIELD_DSCP_AF43 0x26
+#define IPDSFIELD_ECT_MASK 0x02
+#define IPDSFIELD_CE_MASK 0x01
+#define IPDSFIELD_DSCP_EF 0x2E
+
+
+int dscp [] =
+ {
+ // IPDSFIELD_DSCP_DEFAULT ,
+ IPDSFIELD_DSCP_CS1 ,
+ IPDSFIELD_DSCP_CS2 ,
+ IPDSFIELD_DSCP_CS3 ,
+ IPDSFIELD_DSCP_CS4 ,
+ IPDSFIELD_DSCP_CS5 ,
+ IPDSFIELD_DSCP_CS6 ,
+ IPDSFIELD_DSCP_CS7 ,
+ IPDSFIELD_DSCP_AF11 ,
+ IPDSFIELD_DSCP_AF12 ,
+ IPDSFIELD_DSCP_AF13 ,
+ IPDSFIELD_DSCP_AF21 ,
+ IPDSFIELD_DSCP_AF22 ,
+ IPDSFIELD_DSCP_AF23 ,
+ IPDSFIELD_DSCP_AF31 ,
+ IPDSFIELD_DSCP_AF32 ,
+ IPDSFIELD_DSCP_AF33 ,
+ IPDSFIELD_DSCP_AF41 ,
+ IPDSFIELD_DSCP_AF42 ,
+ IPDSFIELD_DSCP_AF43 ,
+ IPDSFIELD_DSCP_EF
+ };
+
+const char *dscp_char[]=
+ {
+ //"Normal",
+ "CS1",
+ "CS2",
+ "CS3",
+ "CS4",
+ "CS5",
+ "CS6",
+ "CS7",
+ "Assured Forwarding 11",
+ "Assured Forwarding 12",
+ "Assured Forwarding 13",
+ "Assured Forwarding 21",
+ "Assured Forwarding 22",
+ "Assured Forwarding 23",
+ "Assured Forwarding 31",
+ "Assured Forwarding 32",
+ "Assured Forwarding 33",
+ "Assured Forwarding 41",
+ "Assured Forwarding 42",
+ "Assured Forwarding 43",
+ "Expedited Forwarding"
+ };
+
+
+TAO_Linear_Network_Priority_Mapping::TAO_Linear_Network_Priority_Mapping (long policy)
+ :policy_ (policy)
+{
+ this->min_ = 0; //ACE_Sched_Params::priority_min (this->policy_);
+ this->max_ = 32767; //ACE_Sched_Params::priority_max (this->policy_);
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "Min = %d\n Max = %d\n",
+ this->min_,
+ this->max_));
+ this->increment_ = (((this->max_ - this->min_) + 1) / 20) + 1;
+}
+
+TAO_Linear_Network_Priority_Mapping::~TAO_Linear_Network_Priority_Mapping (void)
+{
+}
+
+CORBA::Boolean
+TAO_Linear_Network_Priority_Mapping::to_network (RTCORBA::Priority corba_priority,
+ RTCORBA::NetworkPriority &network_priority)
+{
+ network_priority = dscp [(corba_priority - this->min_) / this->increment_];
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_Linear_Network_Priority_Mapping::to_network = %x increment = %d\n",
+ network_priority,
+ this->increment_));
+ return 1;
+}
+
+CORBA::Boolean
+TAO_Linear_Network_Priority_Mapping::to_CORBA (RTCORBA::NetworkPriority /*network_priority*/,
+ RTCORBA::Priority &/*corba_priority*/)
+{
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_Linear_Network_Priority_Mapping::to_corba\n"));
+ return 1;
+}
diff --git a/TAO/tao/RTCORBA/Linear_Network_Priority_Mapping.h b/TAO/tao/RTCORBA/Linear_Network_Priority_Mapping.h
new file mode 100644
index 00000000000..e6514166f6a
--- /dev/null
+++ b/TAO/tao/RTCORBA/Linear_Network_Priority_Mapping.h
@@ -0,0 +1,73 @@
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO
+//
+// = FILENAME
+// Linear_Network_Priority_Mapping.h
+//
+// = DESCRIPTION
+// Declares the Linear_Network_Priority_Mapping interface,
+//
+// = AUTHOR
+// Yamuna Krishnamurthy (yamuna@oomworks.com)
+//
+// ============================================================================
+
+#ifndef TAO_LINEAR_NETWORK_PRIORITY_MAPPING_H
+#define TAO_LINEAR_NETWORK_PRIORITY_MAPPING_H
+#include "ace/pre.h"
+
+#include "tao/orbconf.h"
+
+#include "rtcorba_export.h"
+#include "Network_Priority_Mapping.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+class TAO_RTCORBA_Export TAO_Linear_Network_Priority_Mapping : public TAO_Network_Priority_Mapping
+{
+ //
+ // = TITLE
+ // A simple implementation of the Network_Priority_Mapping interface
+ //
+ // = DESCRIPTION
+ // This implementation uses linear mapping between the range of
+ // priorities for a given scheduling class (ACE_SCHED_OTHER,
+ // ACE_SCHED_FIFO, ACE_SCHED_RR) and the valid range of CORBA
+ // priorities (0...32767)
+ //
+public:
+ TAO_Linear_Network_Priority_Mapping (long policy);
+ // Default constructor
+
+ virtual ~TAO_Linear_Network_Priority_Mapping (void);
+ // The destructor
+
+ virtual CORBA::Boolean
+ to_network (RTCORBA::Priority corba_priority,
+ RTCORBA::NetworkPriority &network_priority);
+ virtual CORBA::Boolean
+ to_CORBA (RTCORBA::NetworkPriority network_priority,
+ RTCORBA::Priority &corba_priority);
+ private:
+ long policy_;
+ // The scheduling policy
+
+ int min_;
+ int max_;
+
+ int increment_;
+
+};
+
+#if defined (__ACE_INLINE__)
+# include "Linear_Network_Priority_Mapping.i"
+#endif /* __ACE_INLINE__ */
+
+#include "ace/post.h"
+#endif /* TAO_LINEAR_NETWORK_PRIORITY_MAPPING_H */
diff --git a/TAO/tao/RTCORBA/Linear_Network_Priority_Mapping.i b/TAO/tao/RTCORBA/Linear_Network_Priority_Mapping.i
new file mode 100644
index 00000000000..cfa1da318d3
--- /dev/null
+++ b/TAO/tao/RTCORBA/Linear_Network_Priority_Mapping.i
@@ -0,0 +1 @@
+// $Id$
diff --git a/TAO/tao/RTCORBA/Network_Priority_Mapping.cpp b/TAO/tao/RTCORBA/Network_Priority_Mapping.cpp
new file mode 100644
index 00000000000..02266b30e43
--- /dev/null
+++ b/TAO/tao/RTCORBA/Network_Priority_Mapping.cpp
@@ -0,0 +1,15 @@
+// $Id$
+
+#include "tao/orbconf.h"
+
+#include "Network_Priority_Mapping.h"
+
+#if !defined (__ACE_INLINE__)
+# include "Network_Priority_Mapping.i"
+#endif /* ! __ACE_INLINE__ */
+
+ACE_RCSID(tao, Network_Priority_Mapping, "$Id$")
+
+TAO_Network_Priority_Mapping::~TAO_Network_Priority_Mapping (void)
+{
+}
diff --git a/TAO/tao/RTCORBA/Network_Priority_Mapping.h b/TAO/tao/RTCORBA/Network_Priority_Mapping.h
new file mode 100644
index 00000000000..5e866be207c
--- /dev/null
+++ b/TAO/tao/RTCORBA/Network_Priority_Mapping.h
@@ -0,0 +1,62 @@
+
+//=============================================================================
+/**
+ * @file Network_Priority_Mapping.h
+ *
+ * $Id$
+ *
+ * Class that declares the Network Priority Mapping
+ * that can be overriden to provide different mappings
+ *
+ *
+ * @author Yamuna Krishnamurthy (yamuna@oomworks.com)
+ */
+//=============================================================================
+
+
+#ifndef TAO_NETWORK_PRIORITY_MAPPING_H
+#define TAO_NETWORK_PRIORITY_MAPPING_H
+#include "ace/pre.h"
+
+#include "tao/orbconf.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#define TAO_RTCORBA_SAFE_INCLUDE
+#include "RTCORBAC.h"
+#undef TAO_RTCORBA_SAFE_INCLUDE
+
+
+/**
+ * @class TAO_Network_Priority_Mapping
+ *
+ * @brief The interface for priority mapping.
+ *
+ * Check the RT-CORBA spec (orbos/99-02-12) secions 4.5.2
+ */
+class TAO_RTCORBA_Export TAO_Network_Priority_Mapping
+{
+public:
+ /// The destructor
+ virtual ~TAO_Network_Priority_Mapping (void);
+
+ virtual CORBA::Boolean
+ to_network (RTCORBA::Priority corba_priority,
+ RTCORBA::NetworkPriority &network_priority) = 0;
+ virtual CORBA::Boolean
+ to_CORBA (RTCORBA::NetworkPriority network_priority,
+ RTCORBA::Priority &corba_priority) = 0;
+};
+
+#if defined (__ACE_INLINE__)
+# include "Network_Priority_Mapping.i"
+#endif /* __ACE_INLINE__ */
+
+#include "ace/post.h"
+#endif /* TAO_NETWORK_PRIORITY_MAPPING_H */
+
+
+
+
diff --git a/TAO/tao/RTCORBA/Network_Priority_Mapping.i b/TAO/tao/RTCORBA/Network_Priority_Mapping.i
new file mode 100644
index 00000000000..cfa1da318d3
--- /dev/null
+++ b/TAO/tao/RTCORBA/Network_Priority_Mapping.i
@@ -0,0 +1 @@
+// $Id$
diff --git a/TAO/tao/RTCORBA/Network_Priority_Mapping_Manager.cpp b/TAO/tao/RTCORBA/Network_Priority_Mapping_Manager.cpp
new file mode 100644
index 00000000000..09707a67164
--- /dev/null
+++ b/TAO/tao/RTCORBA/Network_Priority_Mapping_Manager.cpp
@@ -0,0 +1,71 @@
+// $Id$
+
+#include "Network_Priority_Mapping_Manager.h"
+
+#if ! defined (__ACE_INLINE__)
+#include "Network_Priority_Mapping_Manager.i"
+#endif /* __ACE_INLINE__ */
+
+ACE_RCSID(TAO, RT_ORB, "$Id$")
+
+TAO_Network_Priority_Mapping_Manager::~TAO_Network_Priority_Mapping_Manager (void)
+{
+ delete mapping_;
+}
+
+TAO_Network_Priority_Mapping_Manager_ptr
+TAO_Network_Priority_Mapping_Manager::_narrow (CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL)
+{
+ return TAO_Network_Priority_Mapping_Manager::_unchecked_narrow (obj ACE_ENV_ARG_PARAMETER);
+}
+
+TAO_Network_Priority_Mapping_Manager_ptr
+TAO_Network_Priority_Mapping_Manager::_unchecked_narrow (CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL_NOT_USED)
+{
+ if (CORBA::is_nil (obj))
+ return TAO_Network_Priority_Mapping_Manager::_nil ();
+ return
+ ACE_reinterpret_cast
+ (
+ TAO_Network_Priority_Mapping_Manager_ptr,
+ obj->_tao_QueryInterface
+ (
+ ACE_reinterpret_cast (ptr_arith_t,
+ &TAO_Network_Priority_Mapping_Manager::_narrow)
+ )
+ );
+}
+
+TAO_Network_Priority_Mapping_Manager_ptr
+TAO_Network_Priority_Mapping_Manager::_duplicate (TAO_Network_Priority_Mapping_Manager_ptr obj)
+{
+ if (!CORBA::is_nil (obj))
+ obj->_add_ref ();
+ return obj;
+}
+
+void *
+TAO_Network_Priority_Mapping_Manager::_tao_QueryInterface (ptr_arith_t type)
+{
+ void *retv = 0;
+ if (type == ACE_reinterpret_cast
+ (ptr_arith_t,
+ &TAO_Network_Priority_Mapping_Manager::_narrow))
+ retv = ACE_reinterpret_cast (void*, this);
+ else if (type == ACE_reinterpret_cast (ptr_arith_t, &CORBA::Object::_narrow))
+ retv = ACE_reinterpret_cast (void *,
+ ACE_static_cast (CORBA::Object_ptr, this));
+
+ if (retv)
+ this->_add_ref ();
+ return retv;
+}
+
+const char*
+TAO_Network_Priority_Mapping_Manager::_interface_repository_id (void) const
+{
+ return "IDL:Network_Priority_Mapping_Manager:1.0";
+}
+
diff --git a/TAO/tao/RTCORBA/Network_Priority_Mapping_Manager.h b/TAO/tao/RTCORBA/Network_Priority_Mapping_Manager.h
new file mode 100644
index 00000000000..b4cdfb51a80
--- /dev/null
+++ b/TAO/tao/RTCORBA/Network_Priority_Mapping_Manager.h
@@ -0,0 +1,164 @@
+/* -*- C++ -*- */
+//=============================================================================
+/**
+ * @file Network_Priority_Mapping_Manager.h
+ *
+ * $Id$
+ *
+ * @author Yamuna Krishnamurthy (yamuna@oomworks.com)
+ */
+//=============================================================================
+
+
+#ifndef TAO_NETWORK_PRIORITY_MAPPING_MANAGER_H
+#define TAO_NETWORK_PRIORITY_MAPPING_MANAGER_H
+#include "ace/pre.h"
+
+#include "tao/orbconf.h"
+#include "rtcorba_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if defined(_MSC_VER)
+#if (_MSC_VER >= 1200)
+#pragma warning(push)
+#endif /* _MSC_VER >= 1200 */
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+#include "Network_Priority_Mapping.h"
+#include "tao/LocalObject.h"
+
+class TAO_Network_Priority_Mapping_Manager;
+class TAO_Network_Priority_Mapping_Manager_var;
+typedef TAO_Network_Priority_Mapping_Manager *TAO_Network_Priority_Mapping_Manager_ptr;
+
+
+/**
+ * @class TAO_Network_Priority_Mapping_Manager
+ *
+ * @brief Network_Priority_Mapping_Manager pseudo-objref.
+ *
+ * Allows setting of user-defined Network_Priority_Mapping at run-time.
+ */
+class TAO_RTCORBA_Export TAO_Network_Priority_Mapping_Manager :
+ public virtual TAO_Local_RefCounted_Object
+{
+
+public:
+ /// Constructor.
+ TAO_Network_Priority_Mapping_Manager (RTCORBA::NetworkPriorityMapping * mapping);
+
+ ///
+ void mapping (RTCORBA::NetworkPriorityMapping * mapping);
+
+ ///
+ RTCORBA::NetworkPriorityMapping *mapping (void);
+
+public:
+#if !defined(__GNUC__) || !defined (ACE_HAS_GNUG_PRE_2_8)
+ typedef TAO_Network_Priority_Mapping_Manager_ptr _ptr_type;
+ typedef TAO_Network_Priority_Mapping_Manager_var _var_type;
+#endif /* ! __GNUC__ || g++ >= 2.8 */
+
+ // the static operations
+ static TAO_Network_Priority_Mapping_Manager_ptr _duplicate (TAO_Network_Priority_Mapping_Manager_ptr obj);
+ static TAO_Network_Priority_Mapping_Manager_ptr _narrow (
+ CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ static TAO_Network_Priority_Mapping_Manager_ptr _unchecked_narrow (
+ CORBA::Object_ptr obj
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS);
+
+ static TAO_Network_Priority_Mapping_Manager_ptr _nil (void)
+ {
+ return (TAO_Network_Priority_Mapping_Manager_ptr)0;
+ }
+
+ virtual void *_tao_QueryInterface (ptr_arith_t type);
+
+ virtual const char* _interface_repository_id (void) const;
+
+protected:
+
+ /// Protected destructor to enforce proper memory management of this
+ /// reference counted object.
+ ~TAO_Network_Priority_Mapping_Manager (void);
+
+private:
+
+ TAO_Network_Priority_Mapping_Manager (const TAO_Network_Priority_Mapping_Manager &);
+ void operator= (const TAO_Network_Priority_Mapping_Manager &);
+
+private:
+
+ TAO_Network_Priority_Mapping *mapping_;
+};
+
+class TAO_RTCORBA_Export TAO_Network_Priority_Mapping_Manager_var : public TAO_Base_var
+{
+public:
+ TAO_Network_Priority_Mapping_Manager_var (void); // default constructor
+ TAO_Network_Priority_Mapping_Manager_var (TAO_Network_Priority_Mapping_Manager_ptr);
+ TAO_Network_Priority_Mapping_Manager_var (const TAO_Network_Priority_Mapping_Manager_var &); // copy constructor
+ ~TAO_Network_Priority_Mapping_Manager_var (void); // destructor
+
+ TAO_Network_Priority_Mapping_Manager_var &operator= (TAO_Network_Priority_Mapping_Manager_ptr);
+ TAO_Network_Priority_Mapping_Manager_var &operator= (const TAO_Network_Priority_Mapping_Manager_var &);
+ TAO_Network_Priority_Mapping_Manager_ptr operator-> (void) const;
+
+ /// in, inout, out, _retn
+ operator const TAO_Network_Priority_Mapping_Manager_ptr &() const;
+ operator TAO_Network_Priority_Mapping_Manager_ptr &();
+ TAO_Network_Priority_Mapping_Manager_ptr in (void) const;
+ TAO_Network_Priority_Mapping_Manager_ptr &inout (void);
+ TAO_Network_Priority_Mapping_Manager_ptr &out (void);
+ TAO_Network_Priority_Mapping_Manager_ptr _retn (void);
+ TAO_Network_Priority_Mapping_Manager_ptr ptr (void) const;
+
+ // Hooks used by template sequence and object manager classes
+ // for non-defined forward declared interfaces.
+ static TAO_Network_Priority_Mapping_Manager_ptr duplicate (TAO_Network_Priority_Mapping_Manager_ptr);
+ static void release (TAO_Network_Priority_Mapping_Manager_ptr);
+ static TAO_Network_Priority_Mapping_Manager_ptr nil (void);
+ static TAO_Network_Priority_Mapping_Manager_ptr narrow (CORBA::Object * ACE_ENV_ARG_DECL_NOT_USED);
+ static CORBA::Object * upcast (void *);
+
+private:
+ /// Unimplemented - prevents widening assignment.
+ TAO_Network_Priority_Mapping_Manager_ptr ptr_;
+ TAO_Network_Priority_Mapping_Manager_var (const TAO_Base_var &rhs);
+ TAO_Network_Priority_Mapping_Manager_var &operator= (const TAO_Base_var &rhs);
+};
+
+class TAO_RTCORBA_Export TAO_Network_Priority_Mapping_Manager_out
+{
+public:
+ TAO_Network_Priority_Mapping_Manager_out (TAO_Network_Priority_Mapping_Manager_ptr &);
+ TAO_Network_Priority_Mapping_Manager_out (TAO_Network_Priority_Mapping_Manager_var &);
+ TAO_Network_Priority_Mapping_Manager_out (const TAO_Network_Priority_Mapping_Manager_out &);
+ TAO_Network_Priority_Mapping_Manager_out &operator= (const TAO_Network_Priority_Mapping_Manager_out &);
+ TAO_Network_Priority_Mapping_Manager_out &operator= (const TAO_Network_Priority_Mapping_Manager_var &);
+ TAO_Network_Priority_Mapping_Manager_out &operator= (TAO_Network_Priority_Mapping_Manager_ptr);
+ operator TAO_Network_Priority_Mapping_Manager_ptr &();
+ TAO_Network_Priority_Mapping_Manager_ptr &ptr (void);
+ TAO_Network_Priority_Mapping_Manager_ptr operator-> (void);
+
+private:
+ TAO_Network_Priority_Mapping_Manager_ptr &ptr_;
+};
+
+#if defined (__ACE_INLINE__)
+#include "Network_Priority_Mapping_Manager.i"
+#endif /* __ACE_INLINE__ */
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include "ace/post.h"
+#endif /* TAO_NETWORK_PRIORITY_MAPPING_MANAGER_H */
+
diff --git a/TAO/tao/RTCORBA/Network_Priority_Mapping_Manager.i b/TAO/tao/RTCORBA/Network_Priority_Mapping_Manager.i
new file mode 100644
index 00000000000..4540b1d1cf4
--- /dev/null
+++ b/TAO/tao/RTCORBA/Network_Priority_Mapping_Manager.i
@@ -0,0 +1,220 @@
+// $Id$
+
+// *************************************************************
+// Inline operations for class TAO_Network_Priority_Mapping_Manager_var
+// *************************************************************
+
+ACE_INLINE
+TAO_Network_Priority_Mapping_Manager_var::TAO_Network_Priority_Mapping_Manager_var (void) // default constructor
+ : ptr_ (TAO_Network_Priority_Mapping_Manager::_nil ())
+{}
+
+ACE_INLINE
+TAO_Network_Priority_Mapping_Manager_var::TAO_Network_Priority_Mapping_Manager_var (TAO_Network_Priority_Mapping_Manager_ptr p)
+ : ptr_ (p)
+{}
+
+ACE_INLINE ::TAO_Network_Priority_Mapping_Manager_ptr
+TAO_Network_Priority_Mapping_Manager_var::ptr (void) const
+{
+ return this->ptr_;
+}
+
+ACE_INLINE
+TAO_Network_Priority_Mapping_Manager_var::TAO_Network_Priority_Mapping_Manager_var (const ::TAO_Network_Priority_Mapping_Manager_var &p) // copy constructor
+ : TAO_Base_var (),
+ ptr_ (TAO_Network_Priority_Mapping_Manager::_duplicate (p.ptr ()))
+{}
+
+ACE_INLINE
+TAO_Network_Priority_Mapping_Manager_var::~TAO_Network_Priority_Mapping_Manager_var (void) // destructor
+{
+ CORBA::release (this->ptr_);
+}
+
+ACE_INLINE TAO_Network_Priority_Mapping_Manager_var &
+TAO_Network_Priority_Mapping_Manager_var::operator= (TAO_Network_Priority_Mapping_Manager_ptr p)
+{
+ CORBA::release (this->ptr_);
+ this->ptr_ = p;
+ return *this;
+}
+
+ACE_INLINE TAO_Network_Priority_Mapping_Manager_var &
+TAO_Network_Priority_Mapping_Manager_var::operator= (const ::TAO_Network_Priority_Mapping_Manager_var &p)
+{
+ if (this != &p)
+ {
+ CORBA::release (this->ptr_);
+ this->ptr_ = ::TAO_Network_Priority_Mapping_Manager::_duplicate (p.ptr ());
+ }
+ return *this;
+}
+
+ACE_INLINE
+TAO_Network_Priority_Mapping_Manager_var::operator const ::TAO_Network_Priority_Mapping_Manager_ptr &() const // cast
+{
+ return this->ptr_;
+}
+
+ACE_INLINE
+TAO_Network_Priority_Mapping_Manager_var::operator ::TAO_Network_Priority_Mapping_Manager_ptr &() // cast
+{
+ return this->ptr_;
+}
+
+ACE_INLINE ::TAO_Network_Priority_Mapping_Manager_ptr
+TAO_Network_Priority_Mapping_Manager_var::operator-> (void) const
+{
+ return this->ptr_;
+}
+
+ACE_INLINE ::TAO_Network_Priority_Mapping_Manager_ptr
+TAO_Network_Priority_Mapping_Manager_var::in (void) const
+{
+ return this->ptr_;
+}
+
+ACE_INLINE ::TAO_Network_Priority_Mapping_Manager_ptr &
+TAO_Network_Priority_Mapping_Manager_var::inout (void)
+{
+ return this->ptr_;
+}
+
+ACE_INLINE ::TAO_Network_Priority_Mapping_Manager_ptr &
+TAO_Network_Priority_Mapping_Manager_var::out (void)
+{
+ CORBA::release (this->ptr_);
+ this->ptr_ = ::TAO_Network_Priority_Mapping_Manager::_nil ();
+ return this->ptr_;
+}
+
+ACE_INLINE ::TAO_Network_Priority_Mapping_Manager_ptr
+TAO_Network_Priority_Mapping_Manager_var::_retn (void)
+{
+ // yield ownership of managed obj reference
+ ::TAO_Network_Priority_Mapping_Manager_ptr val = this->ptr_;
+ this->ptr_ = ::TAO_Network_Priority_Mapping_Manager::_nil ();
+ return val;
+}
+
+ACE_INLINE ::TAO_Network_Priority_Mapping_Manager_ptr
+TAO_Network_Priority_Mapping_Manager_var::duplicate (TAO_Network_Priority_Mapping_Manager_ptr p)
+{
+ return ::TAO_Network_Priority_Mapping_Manager::_duplicate (p);
+}
+
+ACE_INLINE void
+TAO_Network_Priority_Mapping_Manager_var::release (TAO_Network_Priority_Mapping_Manager_ptr p)
+{
+ CORBA::release (p);
+}
+
+ACE_INLINE ::TAO_Network_Priority_Mapping_Manager_ptr
+TAO_Network_Priority_Mapping_Manager_var::nil (void)
+{
+ return ::TAO_Network_Priority_Mapping_Manager::_nil ();
+}
+
+ACE_INLINE ::TAO_Network_Priority_Mapping_Manager_ptr
+TAO_Network_Priority_Mapping_Manager_var::narrow (
+ CORBA::Object *p
+ ACE_ENV_ARG_DECL
+ )
+{
+ return ::TAO_Network_Priority_Mapping_Manager::_narrow (p ACE_ENV_ARG_PARAMETER);
+}
+
+ACE_INLINE CORBA::Object *
+TAO_Network_Priority_Mapping_Manager_var::upcast (void *src)
+{
+ TAO_Network_Priority_Mapping_Manager **tmp =
+ ACE_static_cast (TAO_Network_Priority_Mapping_Manager **, src);
+ return *tmp;
+}
+
+
+// *************************************************************
+// Inline operations for class TAO_Network_Priority_Mapping_Manager_out
+// *************************************************************
+
+ACE_INLINE
+TAO_Network_Priority_Mapping_Manager_out::TAO_Network_Priority_Mapping_Manager_out (TAO_Network_Priority_Mapping_Manager_ptr &p)
+ : ptr_ (p)
+{
+ this->ptr_ = ::TAO_Network_Priority_Mapping_Manager::_nil ();
+}
+
+ACE_INLINE
+TAO_Network_Priority_Mapping_Manager_out::TAO_Network_Priority_Mapping_Manager_out (TAO_Network_Priority_Mapping_Manager_var &p) // constructor from _var
+ : ptr_ (p.out ())
+{
+ CORBA::release (this->ptr_);
+ this->ptr_ = ::TAO_Network_Priority_Mapping_Manager::_nil ();
+}
+
+ACE_INLINE
+TAO_Network_Priority_Mapping_Manager_out::TAO_Network_Priority_Mapping_Manager_out (const ::TAO_Network_Priority_Mapping_Manager_out &p) // copy constructor
+ : ptr_ (ACE_const_cast (TAO_Network_Priority_Mapping_Manager_out &, p).ptr_)
+{}
+
+ACE_INLINE ::TAO_Network_Priority_Mapping_Manager_out &
+TAO_Network_Priority_Mapping_Manager_out::operator= (const ::TAO_Network_Priority_Mapping_Manager_out &p)
+{
+ this->ptr_ = ACE_const_cast (TAO_Network_Priority_Mapping_Manager_out&, p).ptr_;
+ return *this;
+}
+
+ACE_INLINE TAO_Network_Priority_Mapping_Manager_out &
+TAO_Network_Priority_Mapping_Manager_out::operator= (const ::TAO_Network_Priority_Mapping_Manager_var &p)
+{
+ this->ptr_ = ::TAO_Network_Priority_Mapping_Manager::_duplicate (p.ptr ());
+ return *this;
+}
+
+ACE_INLINE TAO_Network_Priority_Mapping_Manager_out &
+TAO_Network_Priority_Mapping_Manager_out::operator= (TAO_Network_Priority_Mapping_Manager_ptr p)
+{
+ this->ptr_ = p;
+ return *this;
+}
+
+ACE_INLINE
+TAO_Network_Priority_Mapping_Manager_out::operator ::TAO_Network_Priority_Mapping_Manager_ptr &() // cast
+{
+ return this->ptr_;
+}
+
+ACE_INLINE ::TAO_Network_Priority_Mapping_Manager_ptr &
+TAO_Network_Priority_Mapping_Manager_out::ptr (void) // ptr
+{
+ return this->ptr_;
+}
+
+ACE_INLINE ::TAO_Network_Priority_Mapping_Manager_ptr
+TAO_Network_Priority_Mapping_Manager_out::operator-> (void)
+{
+ return this->ptr_;
+}
+
+///////////////////////////////////////////////////////////////////////////
+ACE_INLINE
+TAO_Network_Priority_Mapping_Manager::TAO_Network_Priority_Mapping_Manager (RTCORBA::NetworkPriorityMapping * mapping)
+ : mapping_ (mapping)
+{
+}
+
+ACE_INLINE RTCORBA::NetworkPriorityMapping *
+TAO_Network_Priority_Mapping_Manager::mapping (void)
+{
+ return mapping_;
+}
+
+ACE_INLINE void
+TAO_Network_Priority_Mapping_Manager::mapping (RTCORBA::NetworkPriorityMapping *mapping)
+{
+ delete mapping_;
+ mapping_ = mapping;
+}
+
+
diff --git a/TAO/tao/RTCORBA/RT_Protocols_Hooks.cpp b/TAO/tao/RTCORBA/RT_Protocols_Hooks.cpp
index a9130638089..bb3508ef669 100644
--- a/TAO/tao/RTCORBA/RT_Protocols_Hooks.cpp
+++ b/TAO/tao/RTCORBA/RT_Protocols_Hooks.cpp
@@ -7,9 +7,12 @@
#include "tao/Acceptor_Registry.h"
#include "tao/Thread_Lane_Resources.h"
#include "tao/Protocol_Factory.h"
+//#include "tao/Pluggable.h"
#include "tao/Transport_Acceptor.h"
+#include "tao/Transport_Connector.h"
#include "Priority_Mapping_Manager.h"
#include "RT_Stub.h"
+#include "tao/IIOP_Connection_Handler.h"
#include "ace/Dynamic_Service.h"
@@ -35,23 +38,36 @@ TAO_RT_Protocols_Hooks::init_hooks (TAO_ORB_Core *orb_core
ACE_ENV_ARG_DECL)
{
this->orb_core_ = orb_core;
-
+
// Save a reference to the priority mapping manager.
CORBA::Object_var obj =
orb_core->object_ref_table ().resolve_initial_references (TAO_OBJID_PRIORITYMAPPINGMANAGER
- ACE_ENV_ARG_PARAMETER);
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
this->mapping_manager_ =
TAO_Priority_Mapping_Manager::_narrow (obj.in ()
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
+
+ // Save a reference to the priority mapping manager.
+ CORBA::Object_var object =
+ orb_core->object_ref_table ().resolve_initial_references (TAO_OBJID_NETWORKPRIORITYMAPPINGMANAGER
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ this->network_mapping_manager_ =
+ TAO_Network_Priority_Mapping_Manager::_narrow (object.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
}
int
TAO_RT_Protocols_Hooks::call_client_protocols_hook (int &send_buffer_size,
int &recv_buffer_size,
int &no_delay,
+ int &enable_network_priority,
const char *protocol_type)
{
if (TAO_RT_Protocols_Hooks::client_protocols_hook_ == 0)
@@ -61,6 +77,7 @@ TAO_RT_Protocols_Hooks::call_client_protocols_hook (int &send_buffer_size,
send_buffer_size,
recv_buffer_size,
no_delay,
+ enable_network_priority,
protocol_type);
return 0;
@@ -77,6 +94,7 @@ int
TAO_RT_Protocols_Hooks::call_server_protocols_hook (int &send_buffer_size,
int &recv_buffer_size,
int &no_delay,
+ int &enable_network_priority,
const char *protocol_type)
{
if (TAO_RT_Protocols_Hooks::server_protocols_hook_ == 0)
@@ -87,6 +105,7 @@ TAO_RT_Protocols_Hooks::call_server_protocols_hook (int &send_buffer_size,
send_buffer_size,
recv_buffer_size,
no_delay,
+ enable_network_priority,
protocol_type);
if (result_value != 0)
@@ -102,6 +121,257 @@ TAO_RT_Protocols_Hooks::set_server_protocols_hook (Server_Protocols_Hook hook)
// Saving the hook pointer so that we can use it later when needed.
}
+int
+TAO_RT_Protocols_Hooks::update_client_protocol_properties (TAO_Stub *stub,
+ /* int &send_buffer_size,
+ int &recv_buffer_size,
+ int &no_delay,
+ int &enable_network_priority,
+ */
+ TAO_Connection_Handler *connection_handler,
+ const char *protocol_type)
+{
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_RT_Protocols_Hooks::get_effective_client_protocol_properties\n"));
+
+ ACE_TRY_NEW_ENV
+ {
+ RTCORBA::ProtocolProperties_var properties =
+ RTCORBA::ProtocolProperties::_nil ();
+
+ TAO_RT_Stub *rt_stub = ACE_dynamic_cast (TAO_RT_Stub *,
+ stub);
+
+ CORBA::Policy* policy = rt_stub->client_protocol ();
+
+ RTCORBA::ClientProtocolPolicy_var client_protocols_policy;
+ TAO_ClientProtocolPolicy *client_protocols = 0;
+
+ if (!CORBA::is_nil (policy))
+ {
+ client_protocols_policy =
+ RTCORBA::ClientProtocolPolicy::_narrow (policy
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ client_protocols =
+ ACE_dynamic_cast (TAO_ClientProtocolPolicy *,
+ client_protocols_policy.in ());
+
+ if (client_protocols != 0)
+ {
+ //TAO_ClientProtocolPolicy
+ RTCORBA::ProtocolList & protocols =
+ client_protocols->protocols_rep ();
+
+ for (CORBA::ULong j = 0; j < protocols.length (); ++j)
+ {
+ if (protocols[j].protocol_type == TAO_TAG_IIOP_PROFILE)
+ {
+ properties =
+ RTCORBA::ProtocolProperties::_narrow (
+ protocols[j].transport_protocol_properties.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (ACE_OS::strcmp (protocol_type, "iiop") == 0)
+ break;
+ }
+ }
+ }
+
+ if (ACE_OS::strcmp (protocol_type, "iiop") == 0)
+ {
+
+ RTCORBA::TCPProtocolProperties_var tcp_properties =
+ RTCORBA::TCPProtocolProperties::_narrow (properties.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int send_buffer_size =
+ tcp_properties->send_buffer_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ int recv_buffer_size =
+ tcp_properties->recv_buffer_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ int no_delay = tcp_properties->no_delay (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ int enable_network_priority =
+ tcp_properties->enable_network_priority (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_IIOP_Connection_Handler *iiop_handler =
+ ACE_dynamic_cast (TAO_IIOP_Connection_Handler *,
+ connection_handler);
+
+ iiop_handler->update_protocol_properties (send_buffer_size,
+ recv_buffer_size,
+ no_delay,
+ enable_network_priority);
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ if (TAO_debug_level > 4)
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO_RT_Protocols_Hooks::get_effective_client_protocol_properties");
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+int
+TAO_RT_Protocols_Hooks::update_server_protocol_properties (CORBA::Policy *policy,
+ /* int &send_buffer_size,
+ int &recv_buffer_size,
+ int &no_delay,
+ int &enable_network_priority,
+ */
+ TAO_Connection_Handler *connection_handler,
+ const char *protocol_type)
+{
+
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_RT_Protocols_Hooks::get_effective_server_protocol_properties\n"));
+
+ ACE_TRY_NEW_ENV
+ {
+ RTCORBA::ProtocolProperties_var properties =
+ RTCORBA::ProtocolProperties::_nil ();
+
+
+
+ RTCORBA::ServerProtocolPolicy_var server_protocols_policy;
+ TAO_ServerProtocolPolicy *server_protocols = 0;
+
+ if (!CORBA::is_nil (policy))
+ {
+ server_protocols_policy =
+ RTCORBA::ServerProtocolPolicy::_narrow (policy
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ server_protocols =
+ ACE_dynamic_cast (TAO_ServerProtocolPolicy *,
+ server_protocols_policy.in ());
+
+ if (server_protocols != 0)
+ {
+ //TAO_ServerProtocolPolicy
+ RTCORBA::ProtocolList & protocols =
+ server_protocols->protocols_rep ();
+
+ for (CORBA::ULong j = 0; j < protocols.length (); ++j)
+ {
+ if (protocols[j].protocol_type == TAO_TAG_IIOP_PROFILE)
+ {
+ properties =
+ RTCORBA::ProtocolProperties::_narrow (
+ protocols[j].transport_protocol_properties.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (ACE_OS::strcmp (protocol_type, "iiop") == 0)
+ break;
+ }
+ }
+ }
+
+ if (ACE_OS::strcmp (protocol_type, "iiop") == 0)
+ {
+ RTCORBA::TCPProtocolProperties_var tcp_properties =
+ RTCORBA::TCPProtocolProperties::_narrow (properties.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ int send_buffer_size =
+ tcp_properties->send_buffer_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ int recv_buffer_size =
+ tcp_properties->recv_buffer_size (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ int no_delay = tcp_properties->no_delay (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ int enable_network_priority =
+ tcp_properties->enable_network_priority (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ TAO_IIOP_Connection_Handler *iiop_handler =
+ ACE_dynamic_cast (TAO_IIOP_Connection_Handler *,
+ connection_handler);
+
+ iiop_handler->update_protocol_properties (send_buffer_size,
+ recv_buffer_size,
+ no_delay,
+ enable_network_priority);
+ }
+ }
+ }
+ ACE_CATCHANY
+ {
+ if (TAO_debug_level > 4)
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "TAO_RT_Protocols_Hooks::get_effective_client_protocol_properties");
+
+ return -1;
+ }
+ ACE_ENDTRY;
+
+ return 0;
+}
+
+CORBA::Long
+TAO_RT_Protocols_Hooks::get_dscp_codepoint (void)
+{
+ if (TAO_debug_level)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO_RT_Protocols_Hooks::get_dscp_codepoint\n"));
+
+ ACE_TRY_NEW_ENV
+ {
+
+ // Make several invocation, changing the priority of this thread
+ // for each.
+ CORBA::Object_var object =
+ this->orb_core_->object_ref_table ().resolve_initial_references ("RTCurrent" ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RTCORBA::Current_var current =
+ RTCORBA::Current::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ RTCORBA::NetworkPriorityMapping *pm =
+ this->network_mapping_manager_->mapping ();
+
+ CORBA::Long codepoint = 0;
+
+ CORBA::Short priority =
+ current->the_priority (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ if (pm->to_network (priority, codepoint) == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Cannot convert corba priority %d to network priority\n",
+ priority),
+ -1);
+ return codepoint;
+
+ }
+ ACE_CATCHANY
+ {
+ ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ "Caught exception:");
+ return -1;
+ }
+ ACE_ENDTRY;
+}
+
void
TAO_RT_Protocols_Hooks::rt_service_context (TAO_Stub *stub,
TAO_Service_Context &service_context,
@@ -202,7 +472,8 @@ TAO_RT_Protocols_Hooks::get_selector_hook (
}
void
-TAO_RT_Protocols_Hooks::get_selector_bands_policy_hook (CORBA::Policy *bands_policy,
+TAO_RT_Protocols_Hooks::get_selector_bands_policy_hook (
+ CORBA::Policy *bands_policy,
CORBA::Short &min_priority,
CORBA::Short &max_priority,
CORBA::Short &p,
diff --git a/TAO/tao/RTCORBA/RT_Protocols_Hooks.h b/TAO/tao/RTCORBA/RT_Protocols_Hooks.h
index ffcdd065c30..4cca4f89f15 100644
--- a/TAO/tao/RTCORBA/RT_Protocols_Hooks.h
+++ b/TAO/tao/RTCORBA/RT_Protocols_Hooks.h
@@ -17,6 +17,7 @@
#include "tao/Protocols_Hooks.h"
#include "Priority_Mapping_Manager.h"
+#include "Network_Priority_Mapping_Manager.h"
#include "ace/Service_Config.h"
@@ -46,17 +47,18 @@ public:
* \param tcp_properties returns the Protocol List set
*/
- virtual int call_client_protocols_hook (
- int &send_buffer_size,
- int &recv_buffer_size,
- int &no_delay,
- const char *protocol_type);
-
+ virtual int call_client_protocols_hook (int &send_buffer_size,
+ int &recv_buffer_size,
+ int &no_delay,
+ int &enable_network_priority,
+ const char *protocol_type);
+
/// Define the Client_Protocols_TCP_Hook signature
typedef int (*Client_Protocols_Hook) (TAO_ORB_Core *,
int &send_buffer_size,
int &recv_buffer_size,
int &no_delay,
+ int &enable_network_priority,
const char *);
static void set_client_protocols_hook (Client_Protocols_Hook hook);
@@ -74,6 +76,7 @@ public:
virtual int call_server_protocols_hook (int &send_buffer_size,
int &recv_buffer_size,
int &no_delay,
+ int &enable_network_priority,
const char *protocol_type);
/// Define the Server_Protocols_Hook signature
@@ -81,6 +84,7 @@ public:
int &,
int &,
int &,
+ int &,
const char *);
static void set_server_protocols_hook (Server_Protocols_Hook hook);
@@ -89,16 +93,44 @@ public:
/// The hook to be set for the ServerProtocolPolicy.
static Server_Protocols_Hook server_protocols_hook_;
+/*
+ virtual int get_effective_client_protocol_properties (TAO_Stub *stub,
+ int &send_buffer_size,
+ int &recv_buffer_size,
+ int &no_delay,
+ int &enable_network_priority,
+ const char *protocol_type);
+
+ virtual int get_effective_server_protocol_properties (TAO_Adpater *poa,
+ int &send_buffer_size,
+ int &recv_buffer_size,
+ int &no_delay,
+ int &enable_network_priority,
+ const char *protocol_type);
+
+ */
+
+ virtual int update_client_protocol_properties (TAO_Stub *stub,
+ TAO_Connection_Handler * connection_handler,
+ const char *protocol_type);
+
+
+ virtual int update_server_protocol_properties (CORBA::Policy *server_policy,
+ TAO_Connection_Handler * connection_handler,
+ const char *protocol_type);
+
+ virtual CORBA::Long get_dscp_codepoint (void);
+
virtual void rt_service_context (TAO_Stub *stub,
TAO_Service_Context &service_context,
CORBA::Boolean restart
ACE_ENV_ARG_DECL);
-
+
virtual void add_rt_service_context_hook (TAO_Service_Context &service_context,
CORBA::Policy *model_policy,
CORBA::Short &client_priority
ACE_ENV_ARG_DECL);
-
+
virtual void get_selector_hook (CORBA::Policy *model_policy,
CORBA::Boolean
&is_client_propagated,
@@ -147,6 +179,7 @@ protected:
// Save a reference to the priority mapping manager.
TAO_Priority_Mapping_Manager_var mapping_manager_;
+ TAO_Network_Priority_Mapping_Manager_var network_mapping_manager_;
};
#if defined (__ACE_INLINE__)
@@ -158,3 +191,15 @@ ACE_FACTORY_DECLARE (TAO_RTCORBA, TAO_RT_Protocols_Hooks)
#include "ace/post.h"
#endif /* TAO_RT_PROTOCOLS_HOOKS_H */
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TAO/tao/RTPortableServer/RT_POA.h b/TAO/tao/RTPortableServer/RT_POA.h
index b39a0f553bf..7638c55aec9 100644
--- a/TAO/tao/RTPortableServer/RT_POA.h
+++ b/TAO/tao/RTPortableServer/RT_POA.h
@@ -270,6 +270,8 @@ public:
void *thread_pool (void) const;
+ CORBA::Policy *server_protocol (void);
+
protected:
/// Template method for creating new POA's of this type.
diff --git a/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp b/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp
index 3e1893cc2b0..7da947c71e6 100644
--- a/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp
+++ b/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp
@@ -5,6 +5,9 @@
#include "tao/RTCORBA/Thread_Pool.h"
#include "tao/ORB_Core.h"
#include "tao/TAO_Server_Request.h"
+#include "tao/Transport.h"
+#include "tao/IIOP_Transport.h"
+#include "tao/IIOP_Connection_Handler.h"
#include "tao/Service_Context.h"
#include "tao/debug.h"
@@ -17,11 +20,13 @@ TAO_RT_Servant_Dispatcher::~TAO_RT_Servant_Dispatcher (void)
void
TAO_RT_Servant_Dispatcher::pre_invoke_remote_request (TAO_POA &poa,
CORBA::Short servant_priority,
- TAO_Service_Context &request_service_context,
- TAO_Service_Context &reply_service_context,
+ TAO_ServerRequest &req,
TAO_Object_Adapter::Servant_Upcall::Pre_Invoke_State &pre_invoke_state
ACE_ENV_ARG_DECL)
{
+ TAO_Service_Context &request_service_context = req.request_service_context ();
+ TAO_Service_Context &reply_service_context = req.reply_service_context ();
+
TAO_Thread_Pool *thread_pool =
(TAO_Thread_Pool *) poa.thread_pool ();
@@ -57,11 +62,49 @@ TAO_RT_Servant_Dispatcher::pre_invoke_remote_request (TAO_POA &poa,
return;
}
+
+
// Remember current thread's priority.
TAO_Protocols_Hooks *tph =
poa.orb_core ().get_protocols_hooks (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK;
-
+
+
+ if (req.transport ()->tag () == TAO_TAG_IIOP_PROFILE)
+ {
+ /*
+ int send_buffer_size;
+ int recv_buffer_size;
+ int no_delay;
+ int enable_network_priority;
+ */
+ const char protocol [] = "iiop";
+ const char *protocol_type = protocol;
+
+ TAO_RT_POA *rt_poa = ACE_dynamic_cast (TAO_RT_POA *,
+ &poa);
+
+ TAO_IIOP_Transport *iiop_transport = ACE_dynamic_cast (TAO_IIOP_Transport *,
+ req.transport ());
+
+ CORBA::Policy* policy = rt_poa->server_protocol ();
+
+ int result =
+ tph->update_server_protocol_properties (policy,
+ iiop_transport-> connection_handler (),
+ protocol_type);
+ if (result != 0)
+ ACE_ERROR((LM_ERROR,
+ "Error in getting the effective protocol properties\n"));
+
+ /*
+ iiop_transport ()->connection_handler ()->update_protocol_properties (send_buffer_size,
+ recv_buffer_size,
+ no_delay,
+ enable_network_priority);
+ */
+ }
+
if (tph->get_thread_CORBA_and_native_priority (pre_invoke_state.original_CORBA_priority_,
pre_invoke_state.original_native_priority_
ACE_ENV_ARG_PARAMETER)
diff --git a/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.h b/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.h
index 8f600e77152..780fed149c3 100644
--- a/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.h
+++ b/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.h
@@ -42,9 +42,8 @@ public:
/// Pre_invoke remote request.
void pre_invoke_remote_request (TAO_POA &poa,
CORBA::Short servant_priority,
- TAO_Service_Context &request_service_context,
- TAO_Service_Context &reply_service_context,
- TAO_Object_Adapter::Servant_Upcall::Pre_Invoke_State &pre_invoke_state
+ TAO_ServerRequest &req,
+ TAO_Object_Adapter::Servant_Upcall::Pre_Invoke_State &pre_invoke_state
ACE_ENV_ARG_DECL);
/// Pre_invoke collocated request.
diff --git a/TAO/tao/Strategies/UIOP_Acceptor.cpp b/TAO/tao/Strategies/UIOP_Acceptor.cpp
index c0ffb93c02f..3cb769777e0 100644
--- a/TAO/tao/Strategies/UIOP_Acceptor.cpp
+++ b/TAO/tao/Strategies/UIOP_Acceptor.cpp
@@ -550,6 +550,7 @@ TAO_UIOP_Acceptor::init_uiop_properties (void)
int send_buffer_size = this->orb_core_->orb_params ()->sock_sndbuf_size ();
int recv_buffer_size = this->orb_core_->orb_params ()->sock_rcvbuf_size ();
int no_delay = 0;
+ int enable_network_priority = 0;
TAO_Protocols_Hooks *tph = this->orb_core_->get_protocols_hooks (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (-1);
@@ -563,6 +564,7 @@ TAO_UIOP_Acceptor::init_uiop_properties (void)
tph->call_server_protocols_hook (send_buffer_size,
recv_buffer_size,
no_delay,
+ enable_network_priority,
protocol_type);
if(hook_result == -1)
diff --git a/TAO/tao/Strategies/UIOP_Connector.cpp b/TAO/tao/Strategies/UIOP_Connector.cpp
index 0122f69ae8a..b591352caca 100644
--- a/TAO/tao/Strategies/UIOP_Connector.cpp
+++ b/TAO/tao/Strategies/UIOP_Connector.cpp
@@ -341,6 +341,7 @@ TAO_UIOP_Connector::init_uiop_properties (void)
int send_buffer_size = this->orb_core ()->orb_params ()->sock_sndbuf_size ();
int recv_buffer_size = this->orb_core ()->orb_params ()->sock_rcvbuf_size ();
int no_delay = 0;
+ int enable_network_priority = 0;
TAO_Protocols_Hooks *tph = this->orb_core ()->get_protocols_hooks (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (-1);
@@ -353,6 +354,7 @@ TAO_UIOP_Connector::init_uiop_properties (void)
tph->call_client_protocols_hook (send_buffer_size,
recv_buffer_size,
no_delay,
+ enable_network_priority,
protocol_type);
if(hook_result == -1)