summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2002-07-23 18:28:30 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2002-07-23 18:28:30 +0000
commit6c4ee4cd3b287976640c04b69f341aacd2a737be (patch)
tree8def09383fed285faf71bd1e5357ad1161c6ffa2
parent9fc7fa3560cb8fbb2e64c1641b435a6650dc7496 (diff)
downloadATCD-6c4ee4cd3b287976640c04b69f341aacd2a737be.tar.gz
ChangeLogTag:Tue Jul 23 11:23:28 2002 Ossama Othman <ossama@uci.edu>
-rw-r--r--TAO/ChangeLog29
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Monitor.cpp94
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Monitor.h91
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert_Handler.cpp49
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert_Handler.h75
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ORBInitializer.cpp86
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ORBInitializer.h76
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.cpp98
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.h116
-rw-r--r--TAO/orbsvcs/orbsvcs/LoadBalancing/LB_conf.h2
10 files changed, 714 insertions, 2 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index a07d756ecdf..94d9ab20ec3 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,32 @@
+Tue Jul 23 11:23:28 2002 Ossama Othman <ossama@uci.edu>
+
+ * orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Monitor.cpp:
+ * orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Monitor.h:
+
+ CPU load monitor implementation. Currently a placeholder.
+
+ * orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert_Handler.cpp:
+ * orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert_Handler.h:
+
+ AMI reply handler used when the LoadManager issues load alerts
+ asynchronously.
+
+ * orbsvcs/orbsvcs/LoadBalancing/LB_ORBInitializer.cpp:
+ * orbsvcs/orbsvcs/LoadBalancing/LB_ORBInitializer.h:
+
+ ORBInitializer that creates and registers a LoadManager instance
+ with the ORB.
+
+ * orbsvcs/orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.cpp:
+ * orbsvcs/orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.h:
+
+ Utility interceptor that servers may use to add load shedding
+ capabilities.
+
+ * orbsvcs/orbsvcs/LoadBalancing/LB_conf.h:
+
+ No need to include "orbsvcs/CosLoadBalancingC.h".
+
Mon Jul 22 21:42:20 2002 Jeff Parsons <parsons@cs.wustl.edu>
* TAO_IDL/fe/idl.ll:
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Monitor.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Monitor.cpp
new file mode 100644
index 00000000000..d5a1b5a8173
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Monitor.cpp
@@ -0,0 +1,94 @@
+#include "LB_CPU_Monitor.h"
+
+
+ACE_RCSID (LoadBalancing,
+ LB_CPU_Monitor,
+ "$Id$")
+
+TAO_LB_CPU_Monitor::TAO_LB_CPU_Monitor (const char * location_id,
+ const char * location_kind)
+ : location_ (1)
+{
+ this->location_.length (1);
+
+ if (location_id == 0)
+ {
+ char host[MAXHOSTNAMELEN + 1];
+ if (ACE_OS::hostname (host, sizeof (host)) != 0)
+ {
+ // Couldn't determine hostname. Use the current time
+ // instead.
+ CORBA::ULong t = ACE_static_cast (CORBA::ULong, ACE_OS::time ());
+
+ // A 64 byte buffer is more than enough to contain the
+ // string representation of a 32 bit unsigned integer.
+ char buf[64] = { '\0' };
+ ACE_OS::sprintf (buf, "%u", t);
+
+ this->location_[0].id = CORBA::string_dup (buf);
+ this->location_[0].kind = CORBA::string_dup ("Creation Time");
+ }
+ else
+ {
+ this->location_[0].id = CORBA::string_dup (host);
+ this->location_[0].kind = CORBA::string_dup ("Hostname");
+ }
+ }
+ else
+ {
+ this->location_[0].id = CORBA::string_dup (location_id);
+ this->location_[0].kind =
+ (location_kind == 0
+ ? CORBA::string_dup ("User Specified")
+ : CORBA::string_dup (location_kind));
+ }
+}
+
+CosLoadBalancing::Location *
+TAO_LB_CPU_Monitor::the_location (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CosLoadBalancing::Location * location;
+ ACE_NEW_THROW_EX (location,
+ CosLoadBalancing::Location (this->location_),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ return location;
+}
+
+CosLoadBalancing::LoadList *
+TAO_LB_CPU_Monitor::loads (ACE_ENV_SINGLE_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ CORBA::Float load = 0;
+
+#ifdef WINDOWS
+ load = ::GetLoadAvg ();
+#else
+ ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (), 0);
+#endif
+
+ CosLoadBalancing::LoadList * tmp;
+ ACE_NEW_THROW_EX (tmp,
+ CosLoadBalancing::LoadList (1),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK_RETURN (0);
+
+ CosLoadBalancing::LoadList_var load_list = tmp;
+
+ load_list->length (1);
+
+ load_list[0].id = CosLoadBalancing::CPU;
+ load_list[0].value = load;
+
+ return load_list._retn ();
+}
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Monitor.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Monitor.h
new file mode 100644
index 00000000000..def5a5fa6a1
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Monitor.h
@@ -0,0 +1,91 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_CPU_Monitor.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_LB_CPU_MONITOR_H
+#define TAO_LB_CPU_MONITOR_H
+
+#include "ace/pre.h"
+
+#include "LoadBalancing_export.h"
+
+# if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+# endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "orbsvcs/CosLoadBalancingS.h"
+
+
+/**
+ * @class TAO_LB_CPU_Monitor
+ *
+ * @brief LoadMonitor implementation that monitors the overall CPU
+ * load on a given host.
+ *
+ * Loads returned from this load monitor are the average number of
+ * processes in the "run" queue over a ***FIXME*** seconds averaged
+ * over the number of processors. For example, a load of 2 on a dual
+ * CPU host is returned as an average load of 1 by this CPU load
+ * monitor, a load of 5 on a quad CPU host will be reported as a load
+ * of 1.25 (i.e. 5/4), and so on and so forth.
+ */
+class TAO_LoadBalancing_Export TAO_LB_CPU_Monitor
+ : public virtual POA_CosLoadBalancing::LoadMonitor
+{
+public:
+
+ /// Constructor
+ /**
+ * If no location is supplied the hostname or IP address is used by
+ * default.
+ */
+ TAO_LB_CPU_Monitor (const char * location_id = 0,
+ const char * location_kind = 0);
+
+ /**
+ * @name CosLoadBalancing::LoadMonitor Methods
+ *
+ * Methods required by the CosLoadBalancing::LoadMonitor interface.
+ */
+ //@{
+
+ /// Return the location at which the LoadMonitor resides.
+ /**
+ * The returned "Location" is a sequence of length 1.
+ */
+ virtual CosLoadBalancing::Location * the_location (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ /// Return the average CPU load at the location which this
+ /// LoadMonitor resides.
+ /**
+ * @return A "Load" sequence of length 1 that contains a LoadId
+ * equal to CosLoadBalancing::CPU, and the average CPU
+ * load.
+ */
+ virtual CosLoadBalancing::LoadList * loads (
+ ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ //@}
+
+private:
+
+ /// The name of the location at which this LoadMonitor resides.
+ CosLoadBalancing::Location location_;
+
+};
+
+#include "ace/post.h"
+
+#endif /* TAO_LB_CPU_MONITOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert_Handler.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert_Handler.cpp
new file mode 100644
index 00000000000..749f96a61d0
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert_Handler.cpp
@@ -0,0 +1,49 @@
+#include "LB_LoadAlert_Handler.h"
+
+#include "tao/debug.h"
+
+
+ACE_RCSID (LoadBalancing,
+ LB_LoadAlert_Handler,
+ "$Id$")
+
+
+TAO_LB_LoadAlert_Handler::~TAO_LB_LoadAlert_Handler (void)
+{
+}
+
+void
+TAO_LB_LoadAlert_Handler::enable_alert (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_LB_LoadAlert_Handler::enable_alert_excep (
+ CosLoadBalancing::AMI_LoadAlertExceptionHolder *
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Exception caught when invoking ")
+ ACE_TEXT ("LoadAlert::enable_alert()\n")));
+}
+
+void
+TAO_LB_LoadAlert_Handler::disable_alert (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_LB_LoadAlert_Handler::disable_alert_excep (
+ CosLoadBalancing::AMI_LoadAlertExceptionHolder *
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Exception caught when invoking ")
+ ACE_TEXT ("LoadAlert::disable_alert()\n")));
+}
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert_Handler.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert_Handler.h
new file mode 100644
index 00000000000..0768f411ac2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_LoadAlert_Handler.h
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+
+// ============================================================================
+/**
+ * @file LB_LoadAlert_Handler.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+// ============================================================================
+
+#ifndef TAO_LB_LOAD_ALERT_REPLY_HANDLER_H
+#define TAO_LB_LOAD_ALERT_REPLY_HANDLER_H
+
+#include "orbsvcs/CosLoadBalancingS.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+// This is to remove "inherits via dominance" warnings from MSVC.
+// MSVC is being a little too paranoid.
+#if defined(_MSC_VER)
+#if (_MSC_VER >= 1200)
+#pragma warning(push)
+#endif /* _MSC_VER >= 1200 */
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+/**
+ * @class TAO_LB_LoadAlert_Handler
+ *
+ * @brief The AMI reply handler for replies from all LoadAlert
+ * objects.
+ *
+ * This class handles all asynchronously received replies from all
+ * registered LoadAlert objects. It only exists to receive
+ * asynchronously sent exceptions.
+ */
+class TAO_LB_LoadAlert_Handler
+ : public virtual POA_CosLoadBalancing::AMI_LoadAlertHandler,
+ public virtual PortableServer::RefCountServantBase
+{
+public:
+
+ virtual void enable_alert (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void enable_alert_excep (
+ CosLoadBalancing::AMI_LoadAlertExceptionHolder *
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void disable_alert (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void disable_alert_excep (
+ CosLoadBalancing::AMI_LoadAlertExceptionHolder *
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+protected:
+
+ /// Protected destructor to enforce propery memory management
+ /// through reference counting.
+ ~TAO_LB_LoadAlert_Handler (void);
+
+};
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_LB_LOAD_ALERT_REPLY_HANDLER_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ORBInitializer.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ORBInitializer.cpp
new file mode 100644
index 00000000000..143a8c1bb72
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ORBInitializer.cpp
@@ -0,0 +1,86 @@
+// -*- C++ -*-
+
+#include "LB_ORBInitializer.h"
+#include "LB_LoadManager.h"
+
+#include "tao/ORBInitInfo.h"
+#include "tao/ORB_Core.h"
+#include "tao/debug.h"
+
+
+ACE_RCSID (LoadBalancing,
+ LB_ORBInitializer,
+ "$Id$")
+
+
+void
+TAO_LB_ORBInitializer::pre_init (
+ PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ TAO_LB_LoadManager * lm_servant = 0;
+ ACE_NEW_THROW_EX (lm_servant,
+ TAO_LB_LoadManager,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+ PortableServer::ServantBase_var safe_lm_servant = lm_servant;
+
+ CORBA::Object_var obj;
+
+ // The RootPOA better be available at this point in time!
+ ACE_TRY
+ {
+ obj = info->resolve_initial_references ("RootPOA"
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+ }
+ ACE_CATCH (CORBA::ORB::InvalidName, ex)
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ "TAO_LB_ORBInitializer::pre_init() - "
+ "Unable to resolve RootPOA reference.\n"));
+
+ ACE_THROW (CORBA::INTERNAL ());
+ }
+ ACE_ENDTRY;
+ ACE_CHECK;
+
+ PortableServer::POA_var root_poa =
+ PortableServer::POA::_narrow (obj.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ TAO_ORBInitInfo_var tao_info =
+ TAO_ORBInitInfo::_narrow (info
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ lm_servant->init (tao_info->orb_core ()->reactor (),
+ root_poa.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ CosLoadBalancing::LoadManager_var load_manager =
+ lm_servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ info->register_initial_reference ("LoadManager",
+ load_manager.in ()
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+
+void
+TAO_LB_ORBInitializer::post_init (
+ PortableInterceptor::ORBInitInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ORBInitializer.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ORBInitializer.h
new file mode 100644
index 00000000000..471421f1e67
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ORBInitializer.h
@@ -0,0 +1,76 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_ORBInitializer.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+
+#ifndef TAO_LB_ORB_INITIALIZER_H
+#define TAO_LB_ORB_INITIALIZER_H
+
+#include "ace/pre.h"
+
+#include "LoadBalancing_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+#include "tao/PortableInterceptorC.h"
+
+// This is to remove "inherits via dominance" warnings from MSVC.
+// MSVC is being a little too paranoid.
+#if defined(_MSC_VER)
+#if (_MSC_VER >= 1200)
+#pragma warning(push)
+#endif /* _MSC_VER >= 1200 */
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+
+/**
+ * @class TAO_LB_ORBInitializer
+ *
+ * @brief ORBInitializer for the CosLoadBalancing service.
+ *
+ * This class simply registers the LoadManager object with the ORB
+ * resolve_initial_references() mechanism.
+ */
+class TAO_LoadBalancing_Export TAO_LB_ORBInitializer
+ : public virtual PortableInterceptor::ORBInitializer,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ /**
+ * @name PortableInterceptor::ORBInitializer Methods
+ *
+ * Methods required by the PortableInterceptor::ORBInitializer
+ * interface.
+ */
+ //@{
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+ //@}
+
+};
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include "ace/post.h"
+
+#endif /* TAO_LB_ORB_INITIALIZER_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.cpp
new file mode 100644
index 00000000000..4e2577836a2
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.cpp
@@ -0,0 +1,98 @@
+#include "LB_ServerRequestInterceptor.h"
+#include "LB_LoadAlert.h"
+
+#include "tao/debug.h"
+
+
+ACE_RCSID (LoadBalancing,
+ LB_ServerRequestInterceptor,
+ "$Id$")
+
+
+TAO_LB_ServerRequestInterceptor::TAO_LB_ServerRequestInterceptor (
+ TAO_LB_LoadAlert & load_alert)
+ : load_alert_ (load_alert)
+{
+}
+
+TAO_LB_ServerRequestInterceptor::~TAO_LB_ServerRequestInterceptor (void)
+{
+}
+
+char *
+TAO_LB_ServerRequestInterceptor::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return CORBA::string_dup ("TAO_LB_ServerRequestInterceptor");
+}
+
+void
+TAO_LB_ServerRequestInterceptor::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_LB_ServerRequestInterceptor::receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ if (this->load_alert_.alerted ())
+ {
+ CORBA::Object_var forward = this->load_alert_.forward ();
+
+ ACE_THROW (PortableInterceptor::ForwardRequest (forward.in (), 0));
+ }
+}
+
+void
+TAO_LB_ServerRequestInterceptor::receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+TAO_LB_ServerRequestInterceptor::send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+}
+
+void
+TAO_LB_ServerRequestInterceptor::send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+}
+
+void
+TAO_LB_ServerRequestInterceptor::send_other (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest))
+{
+ if (TAO_debug_level > 0)
+ {
+ // A location forward occurs when the LoadManager informs the
+ // LoadAlert object that its member is overloaded, for example.
+
+ const PortableInterceptor::ReplyStatus status =
+ ri->reply_status (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_CHECK;
+
+ if (status == PortableInterceptor::LOCATION_FORWARD
+ || status == PortableInterceptor::LOCATION_FORWARD_PERMANENT)
+ ACE_DEBUG ((LM_INFO,
+ ACE_TEXT ("TAO_LB_ServerRequestInterceptor -- ")
+ ACE_TEXT ("LOCATION FORWARDED\n")));
+ }
+}
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.h
new file mode 100644
index 00000000000..a9c18bb091f
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_ServerRequestInterceptor.h
@@ -0,0 +1,116 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file LB_ServerRequestInterceptor.h
+ *
+ * $Id$
+ *
+ * @author Ossama Othman <ossama@uci.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_LB_SERVER_REQUEST_INTERCEPTOR_H
+#define TAO_LB_SERVER_REQUEST_INTERCEPTOR_H
+
+#include "ace/config-all.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PortableInterceptorC.h"
+#include "tao/LocalObject.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_LB_LoadAlert;
+
+/**
+ * @class TAO_LB_ServerRequestInterceptor
+ *
+ * @brief ServerRequestInterceptor that interacts with the TAO-shipped
+ * LoadAlert implementation.
+ *
+ * This ServerRequestInterceptor is responsible for redirecting
+ * requests back to the LoadManager.
+ */
+class TAO_LB_ServerRequestInterceptor
+ : public virtual PortableInterceptor::ServerRequestInterceptor,
+ public virtual TAO_Local_RefCounted_Object
+{
+public:
+
+ /// Constructor.
+ TAO_LB_ServerRequestInterceptor (TAO_LB_LoadAlert & load_alert);
+
+ /**
+ * @name Methods Required by the ServerRequestInterceptor
+ * Interface
+ *
+ * These are the canonical methods required for all
+ * ServerRequestInterceptors.
+ */
+ //@{
+ virtual char * name (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void receive_request_service_contexts (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void receive_request (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void send_reply (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void send_exception (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+
+ virtual void send_other (
+ PortableInterceptor::ServerRequestInfo_ptr ri
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException,
+ PortableInterceptor::ForwardRequest));
+ //@}
+
+protected:
+
+ /// Destructor.
+ /**
+ * Protected destructor to enforce correct memory management via
+ * reference counting.
+ */
+ ~TAO_LB_ServerRequestInterceptor (void);
+
+private:
+
+ TAO_LB_LoadAlert & load_alert_;
+
+};
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#endif /* TAO_LB_SERVER_REQUEST_INTERCEPTOR_H */
diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_conf.h b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_conf.h
index 8386057144d..4bacab885b8 100644
--- a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_conf.h
+++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_conf.h
@@ -22,8 +22,6 @@
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#include "orbsvcs/CosLoadBalancingC.h"
-
#ifndef TAO_LB_PULL_HANDLER_INTERVAL
/// The interval in seconds the load balancer queries registered load