summaryrefslogtreecommitdiff
path: root/orbsvcs/ImplRepo_Service/Forwarder.h
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-08-13 15:47:20 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2010-08-13 15:47:20 +0000
commitd86939f8e188671a6226b24e0957d984050c0ed6 (patch)
treee58de7d2e0d317204ee79bd0578e51c93bf58ea8 /orbsvcs/ImplRepo_Service/Forwarder.h
parente55d9214407ea472e418f9852cb58dddab0c83f5 (diff)
downloadATCD-d86939f8e188671a6226b24e0957d984050c0ed6.tar.gz
Diffstat (limited to 'orbsvcs/ImplRepo_Service/Forwarder.h')
-rw-r--r--orbsvcs/ImplRepo_Service/Forwarder.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/orbsvcs/ImplRepo_Service/Forwarder.h b/orbsvcs/ImplRepo_Service/Forwarder.h
new file mode 100644
index 00000000000..776735491bd
--- /dev/null
+++ b/orbsvcs/ImplRepo_Service/Forwarder.h
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+//=============================================================================
+/**
+ * @file Forwarder.h
+ *
+ * $Id$
+ *
+ * @brief This class implements ImR's forwarding ServantLocator
+ *
+ * @author Darrell Brunsch <brunsch@cs.wustl.edu>
+ * @author Priyanka Gontla <pgontla@doc.ece.uci.edu>
+ */
+//=============================================================================
+
+#ifndef IMR_FORWARDER_H
+#define IMR_FORWARDER_H
+
+#include "tao/PortableServer/PortableServer.h"
+#include "tao/PortableServer/ServantLocatorC.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/LocalObject.h"
+
+
+class ImR_Locator_i;
+
+/**
+ * @class ImR_Forwarder:
+ *
+ * @brief Implementation Repository Forwarder
+ *
+ * This class provides a ServantLocator implementation that
+ * is used to handle arbitrary calls and forward them to the
+ * correct place.
+ */
+class ImR_Forwarder
+ : public PortableServer::ServantLocator,
+ public CORBA::LocalObject
+{
+public:
+ ImR_Forwarder (ImR_Locator_i& imr_impl);
+
+ /// Called before the invocation begins.
+ virtual PortableServer::Servant preinvoke (
+ const PortableServer::ObjectId &oid,
+ PortableServer::POA_ptr poa,
+ const char * operation,
+ PortableServer::ServantLocator::Cookie &cookie);
+
+ virtual void postinvoke (
+ const PortableServer::ObjectId & oid,
+ PortableServer::POA_ptr adapter,
+ const char * operation,
+ PortableServer::ServantLocator::Cookie the_cookie,
+ PortableServer::Servant the_servant);
+
+ void init(CORBA::ORB_ptr orb);
+
+private:
+ /// Where we find out where to forward to.
+ ImR_Locator_i& locator_;
+
+ /// POA reference.
+ PortableServer::Current_var poa_current_var_;
+
+ /// Variable to save the ORB reference passed to the constr.
+ CORBA::ORB_ptr orb_;
+};
+
+#endif /* IMR_FORWARDER_H */