summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/DevGuideExamples/EventServices/RTEC_Federated/EchoEventSupplierMain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/DevGuideExamples/EventServices/RTEC_Federated/EchoEventSupplierMain.cpp')
-rw-r--r--TAO/orbsvcs/DevGuideExamples/EventServices/RTEC_Federated/EchoEventSupplierMain.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/TAO/orbsvcs/DevGuideExamples/EventServices/RTEC_Federated/EchoEventSupplierMain.cpp b/TAO/orbsvcs/DevGuideExamples/EventServices/RTEC_Federated/EchoEventSupplierMain.cpp
index 81e1e10e755..6d693ad7f46 100644
--- a/TAO/orbsvcs/DevGuideExamples/EventServices/RTEC_Federated/EchoEventSupplierMain.cpp
+++ b/TAO/orbsvcs/DevGuideExamples/EventServices/RTEC_Federated/EchoEventSupplierMain.cpp
@@ -80,9 +80,10 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
// Create a local event channel and register it with the RootPOA.
TAO_EC_Event_Channel_Attributes attributes (poa.in (), poa.in ());
- TAO_EC_Event_Channel ec_impl (attributes);
- ec_impl.activate ();
- PortableServer::ObjectId_var oid = poa->activate_object(&ec_impl);
+ PortableServer::Servant_var<TAO_EC_Event_Channel> ec_impl =
+ new TAO_EC_Event_Channel(attributes);
+ ec_impl->activate ();
+ PortableServer::ObjectId_var oid = poa->activate_object(ec_impl.in());
CORBA::Object_var ec_obj = poa->id_to_reference(oid.in());
RtecEventChannelAdmin::EventChannel_var ec =
RtecEventChannelAdmin::EventChannel::_narrow(ec_obj.in());
@@ -101,10 +102,11 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
admin->obtain_push_consumer();
// Instantiate an EchoEventSupplier_i servant.
- EchoEventSupplier_i servant(orb.in());
+ PortableServer::Servant_var<EchoEventSupplier_i> servant =
+ new EchoEventSupplier_i(orb.in());
// Register it with the RootPOA.
- oid = poa->activate_object(&servant);
+ oid = poa->activate_object(servant.in());
CORBA::Object_var supplier_obj = poa->id_to_reference(oid.in());
RtecEventComm::PushSupplier_var supplier =
RtecEventComm::PushSupplier::_narrow(supplier_obj.in());
@@ -133,7 +135,8 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
// Initialize data fields in event.
event[0].data.any_value <<= eventData;
- TAO_EC_Gateway_IIOP gateway;
+ PortableServer::Servant_var<TAO_EC_Gateway_IIOP> gateway =
+ new TAO_EC_Gateway_IIOP;
int gateway_initialized = 0;
std::cout << "Supplier starting sending of events.\n";
@@ -167,10 +170,10 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[])
// There is a good remote event channel so initialize the
// gateway.
if (ok) {
- gateway.init(remote_ec.in(), ec.in());
+ gateway->init(remote_ec.in(), ec.in());
PortableServer::ObjectId_var gateway_oid =
- poa->activate_object(&gateway);
+ poa->activate_object(gateway.in());
CORBA::Object_var gateway_obj =
poa->id_to_reference(gateway_oid.in());
RtecEventChannelAdmin::Observer_var obs =