summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp')
-rw-r--r--TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp57
1 files changed, 52 insertions, 5 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp
index feb1b56c29c..c9fc25077b6 100644
--- a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp
+++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp
@@ -3,9 +3,10 @@
ACE_RCSID(RT_Notify, TAO_Notify_StructuredPushConsumer, "$Id$")
+#include "ace/Bound_Ptr.h"
+#include "tao/Stub.h" // For debug messages printing out ORBid.
#include "orbsvcs/Notify/Properties.h"
#include "orbsvcs/Notify/Event.h"
-#include "ace/Bound_Ptr.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -29,10 +30,48 @@ TAO_Notify_StructuredPushConsumer::init (CosNotifyComm::StructuredPushConsumer_p
ACE_THROW (CORBA::BAD_PARAM());
}
- this->push_consumer_ = CosNotifyComm::StructuredPushConsumer::_duplicate (push_consumer);
-
- this->publish_ = CosNotifyComm::NotifyPublish::_duplicate (push_consumer);
-
+ if (!TAO_Notify_PROPERTIES::instance()->separate_dispatching_orb ())
+ {
+ this->push_consumer_ = CosNotifyComm::StructuredPushConsumer::_duplicate (push_consumer);
+ this->publish_ = CosNotifyComm::NotifyPublish::_duplicate (push_consumer);
+ }
+ else
+ {
+ // "Port" consumer's object reference from receiving ORB to dispatching ORB.
+ CORBA::String_var temp =
+ TAO_Notify_PROPERTIES::instance()->orb()->object_to_string(push_consumer);
+
+ CORBA::Object_var obj =
+ TAO_Notify_PROPERTIES::instance()->dispatching_orb()->string_to_object(temp.in());
+
+ ACE_TRY
+ {
+ CosNotifyComm::StructuredPushConsumer_var new_push_consumer =
+ CosNotifyComm::StructuredPushConsumer::_unchecked_narrow(obj.in() ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+
+ this->push_consumer_ = CosNotifyComm::StructuredPushConsumer::_duplicate (new_push_consumer.in());
+ this->publish_ = CosNotifyComm::NotifyPublish::_duplicate (new_push_consumer.in());
+ //--cj verify dispatching ORB
+ if (TAO_debug_level >= 10)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) Structured push init dispatching ORB id is %s.\n",
+ obj->_stubobj()->orb_core()->orbid()));
+ }
+ //--cj end
+ }
+ ACE_CATCH (CORBA::TRANSIENT, ex)
+ {
+ ACE_PRINT_EXCEPTION (ex, "Got a TRANSIENT in NS_StructuredPushConsumer::init");
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) got it for NS_StructuredPushConsumer %@\n", this));
+ }
+ ACE_CATCHANY
+ {
+ // _narrow failed
+ }
+ ACE_ENDTRY;
+ }
}
void
@@ -55,7 +94,15 @@ TAO_Notify_StructuredPushConsumer::push (const CORBA::Any& event ACE_ENV_ARG_DEC
void
TAO_Notify_StructuredPushConsumer::push (const CosNotification::StructuredEvent& event ACE_ENV_ARG_DECL)
{
+ //--cj verify dispatching ORB
+ if (TAO_debug_level >= 10) {
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) Structured push dispatching ORB id is %s.\n",
+ this->push_consumer_->_stubobj()->orb_core()->orbid()));
+ }
+ //--cj end
+
this->push_consumer_->push_structured_event (event ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
}
/// Push a batch of events to this consumer.