Ejemplo n.º 1
0
int
TAO_EC_Gateway_IIOP::shutdown (void)
{
  ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, -1);

  ec_control_->shutdown();

  this->close_i ();

  if (this->supplier_is_active_)
    {
      PortableServer::POA_var poa =
        this->supplier_._default_POA ();
      PortableServer::ObjectId_var id =
        poa->servant_to_id (&this->supplier_);
      poa->deactivate_object (id.in ());
      this->supplier_is_active_ = false;
    }

  if (this->consumer_is_active_)
    {
      PortableServer::POA_var poa =
        this->consumer_._default_POA ();
      PortableServer::ObjectId_var id =
        poa->servant_to_id (&this->consumer_);
      poa->deactivate_object (id.in ());
      this->consumer_is_active_ = false;
    }

  this->cleanup_consumer_ec_i ();
  this->cleanup_supplier_ec_i ();

  return 0;
}
Ejemplo n.º 2
0
TAO_Trader<TRADER_LOCK_TYPE, MAP_LOCK_TYPE>::~TAO_Trader (void)
{
  // Remove Trading Components from POA


  for (int i = LOOKUP_IF; i <= LINK_IF; i++)
    {
      if (this->ifs_[i] != 0)
        {
          try
            {
              PortableServer::POA_var poa =
                this->ifs_[i]->_default_POA ();

              PortableServer::ObjectId_var id =
                poa->servant_to_id (this->ifs_[i]);

              poa->deactivate_object (id.in ());
            }
          catch (const CORBA::Exception&)
            {
              // Don't let exceptions propagate out of this call since
              // it's the destructor!
            }
        }
    }
}
Ejemplo n.º 3
0
// Shutdown.
void
AccountManager_i::close (Bank::Account_ptr account)
{
  try
    {
      CORBA::String_var name = account->name ();

      ACE_DEBUG((LM_DEBUG,
                 ACE_TEXT ("[SERVER] Process/Thread Id : (%P/%t) Closing Account for %C\n"),
                 name.in ()));

      Account_i_var account;
      if (hash_map_.unbind (name.in (), account) == -1)
        {
          if (TAO_debug_level > 0)
            ACE_DEBUG((LM_DEBUG,
                       ACE_TEXT ("Unable to close account\n")));
        }

      if (!account.is_nil ())
        {
          PortableServer::POA_var poa = account->_default_POA ();

          PortableServer::ObjectId_var id = poa->servant_to_id (account.in ());

          poa->deactivate_object (id.in ());
        }
    }
  catch (const CORBA::Exception& ex)
    {
      ex._tao_print_exception ("Unable to close Account\n");
    }
}
Ejemplo n.º 4
0
void
Session_Control::session_finished (CORBA::Boolean success)
{
  ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->mutex_);
  if (this->session_count_ == 0)
    {
      ACE_ERROR ((LM_ERROR,
                  "ERROR: (%P|%t) Session_Control::session_finished, "
                  "unexpected callback\n"));
    }
  if (success == 0)
    this->success_ = 0;

  this->session_count_--;
  ACE_DEBUG ((LM_DEBUG,
              "(%P|%t) Session_Control::session_finished, "
              "%d sessions to go\n",
              this->session_count_));
  if (session_count_ == 0)
    {
      PortableServer::POA_var poa =
        this->_default_POA ();
      PortableServer::ObjectId_var oid =
        poa->servant_to_id (this);
      poa->deactivate_object (oid.in ());
    }

}
Ejemplo n.º 5
0
	AccessCorbaDef_Impl::~AccessCorbaDef_Impl()
	{
		//deactivateServant();
		try
		{

			// Get the default POA
			PortableServer::POA_var poa = this->_default_POA();

			// Get the object ID
			PortableServer::ObjectId_var id = poa->servant_to_id(this);

			// Deactivate the object
			poa->deactivate_object( id.in() );

			
			/////////////////////////////
			m_orbVar->shutdown( CORBA::Boolean(true) );
			// Clean up the orb entirely
			m_orbVar->destroy();
			m_orbVar = CORBA::ORB::_nil();
			///////////////////////////
		}
		catch ( const PortableServer::POA::ObjectNotActive& )
		{
			// The servant has already been implicitly de-activated
			// Or never activated
		}
		catch ( ... )
		{
			printf("xxx\n");
		}
	}
Ejemplo n.º 6
0
void
Test_Supplier::disconnect (void)
{
  if (CORBA::is_nil (this->consumer_proxy_.in ()))
    return;

  try
    {
      this->consumer_proxy_->disconnect_push_consumer ();
    }
  catch (const CORBA::Exception&)
    {
      // The consumer may be gone already, so we
      // will ignore this exception
    }

  this->consumer_proxy_ =
    RtecEventChannelAdmin::ProxyPushConsumer::_nil ();

  // Deactivate the servant
  PortableServer::POA_var poa =
    this->supplier_._default_POA ();
  PortableServer::ObjectId_var id =
    poa->servant_to_id (&this->supplier_);
  poa->deactivate_object (id.in ());
}
void PortSupplier_impl::deactivatePort (PortBase* servant)
{
    LOG_TRACE(PortSupplier_impl, "Deactivating port '" << servant->getName() << "'");
    PortableServer::POA_var poa = servant->_default_POA();
    PortableServer::ObjectId_var oid = poa->servant_to_id(servant);
    poa->deactivate_object(oid);
}
Ejemplo n.º 8
0
OnlineViewerServer::~OnlineViewerServer()
{
    delete impl;

    PortableServer::POA_var poa = _default_POA();
    PortableServer::ObjectId_var id = poa->servant_to_id(this);
    poa->deactivate_object(id);
}
OpenHRPOnlineViewerItemImpl::~OpenHRPOnlineViewerItemImpl()
{
    PortableServer::POA_var poa = _default_POA();
    PortableServer::ObjectId_var id = poa->servant_to_id(this);
    poa->deactivate_object(id);

    worldItemConnections.disconnect();
}
Ejemplo n.º 10
0
void
deactivate_servant (PortableServer::Servant servant)
{
  PortableServer::POA_var poa =
    servant->_default_POA ();
  PortableServer::ObjectId_var id =
    poa->servant_to_id (servant);
  poa->deactivate_object (id.in ());
}
Ejemplo n.º 11
0
void
TAO_Notify_ThreadPool_Supplier::deactivate (void)
{
  PortableServer::POA_var poa (this->_default_POA ());

  PortableServer::ObjectId_var id (poa->servant_to_id (this));

  poa->deactivate_object (id.in());
}
Ejemplo n.º 12
0
void
TAO_Notify_Tests_Peer_T<Peer_Traits>::deactivate (void)
{
  PortableServer::POA_var poa = this->_default_POA ();

  PortableServer::ObjectId_var id =
    poa->servant_to_id (this);

  poa->deactivate_object (id.in ());
}
Ejemplo n.º 13
0
void
Session::destroy (void)
{
  // Make sure local resources are released

  PortableServer::POA_var poa =
    this->_default_POA ();
  PortableServer::ObjectId_var oid =
    poa->servant_to_id (this);
  poa->deactivate_object (oid.in ());
}
Ejemplo n.º 14
0
void
Object_Group_i::destroy (void)
{
  // Deregister with POA.
  PortableServer::POA_var poa =
    this->_default_POA ();

  PortableServer::ObjectId_var id =
    poa->servant_to_id (this);

  poa->deactivate_object (id.in ());
}
Ejemplo n.º 15
0
void
TAO_Offer_Id_Iterator::destroy (void)
{
  // Remove self from POA

  PortableServer::POA_var poa =
    this->_default_POA ();

  PortableServer::ObjectId_var id =
    poa->servant_to_id (this);

  poa->deactivate_object (id.in ());
}
Ejemplo n.º 16
0
void
Consumer::disconnect_push_consumer (void)
{
  // Deactivate this object.

  PortableServer::POA_var poa =
    this->_default_POA ();

  PortableServer::ObjectId_var id =
    poa->servant_to_id (this);

  poa->deactivate_object (id.in ());
}
Ejemplo n.º 17
0
void
Push_Iterator_Handler::deactivate (void)
{
  // Get the POA used when activating the Reply Handler object.
  PortableServer::POA_var poa = this->_default_POA ();

  // Get the object ID associated with this servant.
  PortableServer::ObjectId_var oid =
    poa->servant_to_id (this);

  // Now deactivate the AMI_CallbackHandler object.
  poa->deactivate_object (oid.in ());
}
void
TAO_CosEC_ProxyPushConsumer_i::disconnect_push_consumer (void)
{
    this->proxypushconsumer_->disconnect_push_consumer ();

    // Deactivate the ProxyPushConsumer
    PortableServer::POA_var poa =
        this->_default_POA ();

    PortableServer::ObjectId_var id =
        poa->servant_to_id (this);

    poa->deactivate_object (id.in ());
}
Ejemplo n.º 19
0
void
test_i::unknown_exception_during_deactivation (void)
{
  ACE_DEBUG ((LM_DEBUG,
              "test_i::unknown_exception_during_deactivation() called\n"));

  PortableServer::POA_var poa =
    this->_default_POA ();

  PortableServer::ObjectId_var id =
    poa->servant_to_id (this);

  poa->deactivate_object (id.in ());
}
void IngexPlayerListenerImpl::destroy()
{
  // Get the POA used when activating the object.
  PortableServer::POA_var poa = this->_default_POA();

  // Get the object ID associated with this servant.
  PortableServer::ObjectId_var oid = poa->servant_to_id (this);

  // Now deactivate the object.
  poa->deactivate_object(oid.in());

  // Decrease the reference count on ourselves.
  this->_remove_ref();
}
Ejemplo n.º 21
0
void
EC_Supplier::shutdown (void)
{
  if (!this->is_active_)
    return;

  // Deactivate the servant
  PortableServer::POA_var poa =
    this->_default_POA ();
  PortableServer::ObjectId_var id =
    poa->servant_to_id (this);
  poa->deactivate_object (id.in ());
  this->is_active_ = 0;
  this->myself_ = RtecEventComm::PushSupplier::_nil ();
}
Ejemplo n.º 22
0
void
File_impl::close ()
throw (CORBA::SystemException, CF::FileException)
{
    TRACE_ENTER(File_impl)
    boost::mutex::scoped_lock lock(interfaceAccess);

    int fsOpSuccessAttempts = 0;
    bool fsOpSuccess = false;
    while (!fsOpSuccess) {
        try {
            f.close();
            fsOpSuccess = true;
        } catch ( const fs::filesystem_error& ex ) {
            LOG_WARN(File_impl, "Error in filesystem: "<<ex.what()<<". Attempting again")
            fsOpSuccessAttempts++;
            if (fsOpSuccessAttempts == 10)
                { break; }
            usleep(10000);
        } catch ( ... ) {
            LOG_WARN(File_impl, "Caught an unhandled file system exception. Attempting again")
            fsOpSuccessAttempts++;
            if (fsOpSuccessAttempts == 10)
                { break; }
            usleep(10000);
        }
    }
    
    CF::File_var fileObj = _this();
    std::string fileIOR = ossie::corba::objectToString(fileObj);
    ptrFs->decrementFileIORCount(fullFileName, fileIOR);

    // clean up reference and clean up memory
    try {
        PortableServer::POA_var poa = ossie::corba::RootPOA()->find_POA("Files", 0);
        PortableServer::ObjectId_var oid = poa->servant_to_id(this);
        poa->deactivate_object(oid);
    } catch ( ... ) {

    }

    if (!fsOpSuccess) {
        LOG_ERROR(File_impl, "Error closing file, " << fName);
        throw (CF::File::IOException (CF::CF_EIO, "[File_impl::close] Error closing file"));
    }

    TRACE_EXIT(File_impl)
}
Ejemplo n.º 23
0
void
Callback_Handler::deactivate (void)
{
  // Close the file that was sent to the client.
  (void) this->file_io_.close ();

  // Get the POA used when activating the Reply Handler object.
  PortableServer::POA_var poa = this->_default_POA ();

  // Get the object ID associated with this servant.
  PortableServer::ObjectId_var oid =
    poa->servant_to_id (this);

  // Now deactivate the AMI_CallbackHandler object.
  poa->deactivate_object (oid.in ());
}
Ejemplo n.º 24
0
void
TAO_CosEC_PushConsumerWrapper::disconnect_push_consumer (void)
{
  // Deactivate the supplier proxy.
  this->consumer_->disconnect_push_consumer ();

  PortableServer::POA_var poa =
    this->_default_POA ();

  PortableServer::ObjectId_var id =
    poa->servant_to_id (this);

  poa->deactivate_object (id.in ());

  // @@ If we keep a list remember to remove this object from the
  // list.
}
Ejemplo n.º 25
0
void
Content_Iterator_i::destroy (void)
{

  (void) this->file_io_.close ();

  // Get the POA used when activating the Content_Iterator object.
  PortableServer::POA_var poa = this->_default_POA ();

  // Get the object ID associated with this servant.
  PortableServer::ObjectId_var oid = poa->servant_to_id (this);

  // Now deactivate the iterator object.
  poa->deactivate_object (oid.in ());

  // Decrease the reference count on our selves.
  this->_remove_ref ();
}
Ejemplo n.º 26
0
void
Test_Consumer::disconnect (void)
{
  if (CORBA::is_nil (this->supplier_proxy_.in ()))
    return;

  this->supplier_proxy_->disconnect_push_supplier ();

  this->supplier_proxy_ =
    RtecEventChannelAdmin::ProxyPushSupplier::_nil ();

  // Deactivate the servant
  PortableServer::POA_var poa =
    this->_default_POA ();
  PortableServer::ObjectId_var id =
    poa->servant_to_id (this);
  poa->deactivate_object (id.in ());
}
Ejemplo n.º 27
0
void
Supplier::disconnect (void)
{
  // Disconnect from the EC
  try
    {
      this->proxy_->disconnect_push_consumer ();
    }
  catch (const CORBA::Exception&)
    {
    }

  PortableServer::POA_var poa =
    this->_default_POA ();
  PortableServer::ObjectId_var id =
    poa->servant_to_id (this);
  poa->deactivate_object (id.in ());
}
Ejemplo n.º 28
0
void
TAO_CEC_ProxyPullSupplier::deactivate (void)
{
  try
    {
      PortableServer::POA_var poa =
        this->_default_POA ();
      PortableServer::ObjectId_var id =
        poa->servant_to_id (this);
      poa->deactivate_object (id.in ());
    }
  catch (const CORBA::Exception&)
    {
      // Exceptions here should not be propagated.  They usually
      // indicate that an object is being disconnected twice, or some
      // race condition, but not a fault that the user needs to know
      // about.
    }
}
Ejemplo n.º 29
0
void
EC_Driver::deactivate_ec (void)
{
#if !defined(EC_DISABLE_REMOTE_EC)
  if (this->use_remote_ec_ == 1)
    return;
#endif

  {
    // Deactivate the EC
    PortableServer::POA_var poa =
      this->ec_impl_->_default_POA ();
    PortableServer::ObjectId_var id =
      poa->servant_to_id (this->ec_impl_);
    poa->deactivate_object (id.in ());
  }

  if (this->verbose ())
    ACE_DEBUG ((LM_DEBUG, "EC_Driver (%P|%t) EC deactivated\n"));

}
Ejemplo n.º 30
0
/* static */
int
TAO_AV_Core::deactivate_servant (PortableServer::Servant servant)
{
  // Because of reference counting, the POA will automatically delete
  // the servant when all pending requests on this servant are
  // complete.

  try
    {
      PortableServer::POA_var poa = servant->_default_POA ();

      PortableServer::ObjectId_var id = poa->servant_to_id (servant);

      poa->deactivate_object (id.in ());
    }
  catch (const CORBA::Exception& ex)
    {
      ex._tao_print_exception ("deactivate_servant");
      return -1;
    }
  return 0;
}