summaryrefslogtreecommitdiff
path: root/ACE/TAO/orbsvcs/DevGuideExamples/EventServices/OMG_TypedEC/Consumer_i.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/TAO/orbsvcs/DevGuideExamples/EventServices/OMG_TypedEC/Consumer_i.cpp')
-rw-r--r--ACE/TAO/orbsvcs/DevGuideExamples/EventServices/OMG_TypedEC/Consumer_i.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/ACE/TAO/orbsvcs/DevGuideExamples/EventServices/OMG_TypedEC/Consumer_i.cpp b/ACE/TAO/orbsvcs/DevGuideExamples/EventServices/OMG_TypedEC/Consumer_i.cpp
new file mode 100644
index 00000000000..4d6ea9515a0
--- /dev/null
+++ b/ACE/TAO/orbsvcs/DevGuideExamples/EventServices/OMG_TypedEC/Consumer_i.cpp
@@ -0,0 +1,38 @@
+// $Id$
+
+// Implements a PushConsumer.
+
+#include "Consumer_i.h"
+#include "tao/PortableServer/PS_CurrentC.h"
+#include <iostream>
+
+Consumer_i::Consumer_i(CORBA::ORB_ptr orb,
+ CORBA::Object_ptr obj)
+ : orb_(CORBA::ORB::_duplicate(orb))
+ , object_(CORBA::Object::_duplicate(obj))
+{
+}
+
+
+CORBA::Object_ptr
+Consumer_i::get_typed_consumer ()
+{
+ return CORBA::Object::_duplicate(object_.in());
+}
+
+// Override the push() operation.
+void Consumer_i::push(const CORBA::Any &)
+{
+ throw CORBA::NO_IMPLEMENT ();
+}
+
+// Override the disconnect_push_consumer() operation.
+void Consumer_i::disconnect_push_consumer()
+{
+ // Deactivate this object.
+ CORBA::Object_var obj = orb_->resolve_initial_references("POACurrent");
+ PortableServer::Current_var current = PortableServer::Current::_narrow(obj.in());
+ PortableServer::POA_var poa = current->get_POA();
+ PortableServer::ObjectId_var objectId = current->get_object_id();
+ poa->deactivate_object(objectId.in());
+}