当前位置: 首页>>代码示例>>C++>>正文


C++ portableserver::Servant类代码示例

本文整理汇总了C++中portableserver::Servant的典型用法代码示例。如果您正苦于以下问题:C++ Servant类的具体用法?C++ Servant怎么用?C++ Servant使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Servant类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

void 
ServantLocator::postinvoke (const PortableServer::ObjectId& oid,
							PortableServer::POA_ptr adapter,
							const char* operation,
							PortableServer::ServantLocator::Cookie the_cookie,
							PortableServer::Servant the_servant )
throw (CORBA::SystemException)
{
	//
	// call services registered for postinvoke
	//
	if(home_servant_->service_name_ == "")
	{
		std::vector <Qedo::ComponentInstance_var> ::iterator iter;
		Components::CCMService_ptr service;

		for (iter = home_servant_->container_->services_postinvoke_.begin();
			 iter != home_servant_->container_->services_postinvoke_.end(); iter++)
		{
			service = dynamic_cast<Components::CCMService_ptr>((*iter)->executor_locator_.in());
			service->postinvoke((*iter)->ccm_object_executor_->uuid_.c_str(), operation);
		}
	}

	the_servant->_remove_ref();
}
开发者ID:BackupTheBerlios,项目名称:qedo-svn,代码行数:26,代码来源:ServantLocator.cpp

示例2: postinvoke

void GCServantLocator::postinvoke(const PortableServer::ObjectId& oid,
                                  PortableServer::POA_ptr adapter,
                                  const char* operation,
                                  PortableServer::ServantLocator::Cookie the_cookie,
                                  PortableServer::Servant the_servant)
{
    the_servant->_remove_ref();
}
开发者ID:RedhawkSDR,项目名称:framework-core,代码行数:8,代码来源:CorbaGC.cpp

示例3:

Implicit_Deactivator::Implicit_Deactivator (PortableServer::Servant servant)
{
  this->poa_ =
    servant->_default_POA ();

  this->id_ =
    this->poa_->servant_to_id (servant);
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:8,代码来源:Implicit_Deactivator.cpp

示例4:

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 ());
}
开发者ID:asdlei00,项目名称:ACE,代码行数:9,代码来源:Shutdown.cpp

示例5:

void
Servant_Activator::etherealize (const PortableServer::ObjectId &,
                                PortableServer::POA_ptr,
                                PortableServer::Servant servant,
                                CORBA::Boolean,
                                CORBA::Boolean)
{
  servant->_remove_ref ();
}
开发者ID:chenbk85,项目名称:ACE-Middleware,代码行数:9,代码来源:Nested_Non_Servant_Upcalls.cpp

示例6: idstr

int
TAO_System_Id_With_Multiple_Id_Strategy::bind_using_system_id (
  PortableServer::Servant servant,
  CORBA::Short priority,
  TAO_Active_Object_Map_Entry *&entry)
{
  ACE_NEW_RETURN (entry,
                  TAO_Active_Object_Map_Entry,
                  -1);
  int result =
    this->active_object_map_->user_id_map_->bind_create_key (entry,
                                                             entry->user_id_);
  if (result == 0)
    {
      entry->servant_ = servant;
      entry->priority_ = priority;

      result = this->active_object_map_->id_hint_strategy_->bind (*entry);

      if (result != 0)
        {
          this->active_object_map_->user_id_map_->unbind (entry->user_id_);
          delete entry;
        }

#if defined (TAO_HAS_MONITOR_POINTS) && (TAO_HAS_MONITOR_POINTS == 1)
      this->active_object_map_->monitor_->receive (
        this->active_object_map_->user_id_map_->current_size ());
#endif /* TAO_HAS_MONITOR_POINTS==1 */
    }
  else
    {
      delete entry;
    }

#if (TAO_HAS_MINIMUM_CORBA == 0)
  if (result == 0 && TAO_debug_level > 7)
    {
      CORBA::String_var idstr (
          PortableServer::ObjectId_to_string (entry->user_id_));
      CORBA::String_var repository_id (
          servant ? servant->_repository_id () : 0);
      ACE_CString hex_idstr;
      hexstring (hex_idstr, idstr.in (), entry->user_id_.length ());

      TAOLIB_DEBUG ((LM_DEBUG,
                  "TAO (%P|%t) - TAO_System_Id_With_Multiple_Id_Strategy::"
                  "bind_using_system_id: type=%C, id=%C\n",
                  repository_id.in (),
                  hex_idstr.c_str()
                  ));
    }
#endif

  return result;
}
开发者ID:milan-mpathix,项目名称:ATCD,代码行数:56,代码来源:Active_Object_Map.cpp

示例7:

void 
ServantLocator::postinvoke (const PortableServer::ObjectId& oid,
							PortableServer::POA_ptr adapter,
							const char* operation,
							PortableServer::ServantLocator::Cookie the_cookie,
							PortableServer::Servant the_servant )
throw (CORBA::SystemException)
{
	the_servant->_remove_ref();
}
开发者ID:BackupTheBerlios,项目名称:qedo-svn,代码行数:10,代码来源:ServantLocator.cpp

示例8: etherealize

void ServantActivatorImpl::etherealize(
		const PortableServer::ObjectId&	oid,
		PortableServer::POA_ptr		poa,
		PortableServer::Servant		servant,
		CORBA::Boolean			cleanup_in_progress,
		CORBA::Boolean			remaining_activations)
{
	printf("------- ServantActivator.etherealize() --------\n");
	servant->_remove_ref();
}
开发者ID:JiphuTzu,项目名称:pococapsule,代码行数:10,代码来源:GreetingImpl.C

示例9:

    CORBA::Object_ptr
    ServantRetentionStrategyRetain::servant_to_reference (
      PortableServer::Servant servant)
    {
      // Note: The allocation of an Object Id value and installation in
      // the Active Object Map caused by implicit activation may actually
      // be deferred until an attempt is made to externalize the
      // reference. The real requirement here is that a reference is
      // produced that will behave appropriately (that is, yield a
      // consistent Object Id value when asked politely).
      CORBA::Short priority = this->poa_->server_priority ();

      PortableServer::ObjectId_var system_id =
        this->servant_to_system_id_i (servant, priority);

      PortableServer::ObjectId user_id;

      // This operation requires the RETAIN, therefore don't worry about
      // the NON_RETAIN case.
      if (this->active_object_map_->
          find_user_id_using_system_id (system_id.in (), user_id) != 0)
        {
          throw ::CORBA::OBJ_ADAPTER ();
        }

      // Remember params for potentially invoking <key_to_object> later.
      this->poa_->key_to_object_params_.set (
        system_id,
        servant->_interface_repository_id (),
        servant,
        1,
        priority,
        true);

      // Ask the ORT to create the object.
      // @@NOTE:There is a possible deadlock lurking here. We held the
      // lock, and we are possibly trying to make a call into the
      // application code. Think what would happen if the app calls us
      // back. We need to get to this at some point.
      return this->poa_->invoke_key_to_object_helper_i (
              servant->_interface_repository_id (), user_id);
    }
开发者ID:OspreyHub,项目名称:ATCD,代码行数:42,代码来源:ServantRetentionStrategyRetain.cpp

示例10: postinvoke

void ServantLocatorImpl::postinvoke(
		const PortableServer::ObjectId&	oid,
		PortableServer::POA_ptr		poa,
		const char*			operation,
		PortableServer::ServantLocator::Cookie cookie,
		PortableServer::Servant		servant)
{
	printf("------- ServantLocator.postinvoke(.., op='%s', .. ) "
			"--------\n", operation);
	servant->_remove_ref();
}
开发者ID:JiphuTzu,项目名称:pococapsule,代码行数:11,代码来源:GreetingImpl.C

示例11: preinvoke

PortableServer::Servant GCServantLocator::preinvoke(const PortableServer::ObjectId& oid,
                                                    PortableServer::POA_ptr adapter,
                                                    const char* operation,
                                                    PortableServer::ServantLocator::Cookie& the_cookie)
{
    boost::mutex::scoped_lock lock(activeMapMutex_);
    ServantMap::iterator iter = activeMap_.find(oid);
    if (iter == activeMap_.end()) {
        throw CORBA::OBJECT_NOT_EXIST();
    }
    PortableServer::Servant servant = iter->second.servant;
    if (iter->second.destroy == std::string(operation)) {
        LOG_TRACE(GCServantLocator, "untracking " << (void*)servant);
        activeMap_.erase(iter);
    } else {
        servant->_add_ref();
        iter->second.last_access = boost::get_system_time();
    }
    return servant;
}
开发者ID:RedhawkSDR,项目名称:framework-core,代码行数:20,代码来源:CorbaGC.cpp

示例12: register_servant

void GCServantLocator::register_servant(const PortableServer::ObjectId& oid,
                                        PortableServer::Servant servant,
                                        boost::posix_time::time_duration ttl,
                                        const std::string& destroy)
{
    boost::mutex::scoped_lock lock(activeMapMutex_);
    if (activeMap_.count(oid) > 0) {
        throw PortableServer::POA::ObjectAlreadyActive();
    }
    LOG_TRACE(GCServantLocator, "tracking " << (void*)servant);
    ServantEntry& entry = activeMap_[oid];
    entry.servant = servant;
    servant->_add_ref();
    entry.ttl = ttl;
    entry.last_access = boost::get_system_time();
    entry.destroy = destroy;
}
开发者ID:RedhawkSDR,项目名称:framework-core,代码行数:17,代码来源:CorbaGC.cpp

示例13:

void
Servant_Activator::etherealize (const PortableServer::ObjectId &id,
                                PortableServer::POA_ptr ,
                                PortableServer::Servant servant,
                                CORBA::Boolean,
                                CORBA::Boolean)
{
  CORBA::String_var object_name =
    PortableServer::ObjectId_to_string (id);

  ACE_DEBUG ((LM_DEBUG,
              "Etherealize called with id = \"%C\"\n",
              object_name.in ()));

  if (ACE_OS::strcmp (object_name.in (),
                      "without reference counting") == 0)
    delete servant;
  else
    {
      servant->_remove_ref ();
    }
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:22,代码来源:Etherealization.cpp

示例14: catch

/* 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;
}
开发者ID:asdlei00,项目名称:ACE,代码行数:23,代码来源:AV_Core.cpp

示例15: OBJECT_NOT_EXIST

void 
TimeServantLocator::postinvoke (const PortableServer::ObjectId & oid, 
                                PortableServer::POA_ptr poa,
                                const char *operation,
                                void *cookie,
                                PortableServer::Servant servant)
  throw (CORBA::SystemException)
{
  // Check to see if the object ID is valid (CORBA)
  CORBA::String_var oidString;
  try 
    {
      oidString = PortableServer::ObjectId_to_string (oid);
    }
  catch (const CORBA::BAD_PARAM&)
    {
      throw CORBA::OBJECT_NOT_EXIST ();
    }

  debug ("TimeServantLocator::%s(%s)", __FUNCTION__, oidString.in());

  // Decrement servant reference count
  servant->_remove_ref ();
}
开发者ID:justinkamerman,项目名称:CBoss,代码行数:24,代码来源:TimeServantLocator.cpp


注:本文中的portableserver::Servant类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。