void
  StructuredPushConsumer::disconnect()
  {
    Guard guard(connectedMutex_);
    if (connected_ == 1) {
      MIRO_DBG(MIRO, LL_NOTICE, "Disconnecting StructuredPushConsumer.\n");
      connected_ = -1;
      try {
        proxySupplier_->disconnect_structured_push_supplier();

        // Get reference to Root POA.
        PortableServer::POA_var poa = _default_POA();

        // Deactivate.
        PortableServer::ObjectId_var oid =
          poa->reference_to_id(objref_);

        CORBA::release(objref_);

        // deactivate from the poa.
        poa->deactivate_object(oid.in());
      }
      catch (const CORBA::Exception & e) {
        MIRO_LOG_OSTR(LL_ERROR, "StructuredPushConsumer::disconnect() CORBA exception on: " << std::endl
                      << e << std::endl);
      }
    }
  }
  void
  StructuredPushSupplier::disconnect() 
  {
    DBG(cout << "Disconnecting StructuredPushSupplier." << endl);

    Guard guard(connectedMutex_);
    if (connected_) {
      proxyConsumer_->disconnect_structured_push_consumer();
      supplierAdmin_->destroy();

      // Get reference to Root POA.
      PortableServer::POA_var poa = _default_POA();

      // Deactivate.
      PortableServer::ObjectId_var oid =
	poa->reference_to_id (objref_);

      CORBA::release(objref_);
    
      // deactivate from the poa.
      poa->deactivate_object (oid.in ());

      connected_ = false;
    }
  }
Exemplo n.º 3
0
    /// Activate in the POA
void
TAO_FTEC_ProxyPushSupplier::activate (
       RtecEventChannelAdmin::ProxyPushSupplier_ptr &result)
{

  result =
    RtecEventChannelAdmin::ProxyPushSupplier::_nil();
  try{
    object_id_ = Request_Context_Repository().get_object_id();
    PortableServer::POA_var poa = _default_POA();
    activate_object_with_id(result, poa.in(), this, id());
  }
  catch (const CORBA::Exception&)
  {
    // ignore exceptions
  }
}