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


C++ ORBInitInfo_ptr::register_policy_factory方法代码示例

本文整理汇总了C++中portableinterceptor::ORBInitInfo_ptr::register_policy_factory方法的典型用法代码示例。如果您正苦于以下问题:C++ ORBInitInfo_ptr::register_policy_factory方法的具体用法?C++ ORBInitInfo_ptr::register_policy_factory怎么用?C++ ORBInitInfo_ptr::register_policy_factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在portableinterceptor::ORBInitInfo_ptr的用法示例。


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

示例1:

void
TAO_FT_ServerORBInitializer::register_policy_factories (
    PortableInterceptor::ORBInitInfo_ptr info)
{
    // Register the FTCORBA policy factories.

    PortableInterceptor::PolicyFactory_ptr temp_factory =
        PortableInterceptor::PolicyFactory::_nil ();
    PortableInterceptor::PolicyFactory_var policy_factory;

    // This policy factory is used for all FTCORBA related policies.

    ACE_NEW_THROW_EX (temp_factory,
                      TAO_FT_ServerPolicyFactory,
                      CORBA::NO_MEMORY (
                          CORBA::SystemException::_tao_minor_code (
                              TAO::VMCID,
                              ENOMEM),
                          CORBA::COMPLETED_NO));

    policy_factory = temp_factory;

    // Bind the same policy factory to all FTCORBA related policy
    // types since a single policy factory is used to create each of
    // the different types of FTCORBA policies.


    CORBA::PolicyType type = FT::HEARTBEAT_ENABLED_POLICY;
    info->register_policy_factory (type,
                                   policy_factory.in ());
}
开发者ID:asdlei00,项目名称:ACE,代码行数:31,代码来源:FT_ServerORBInitializer.cpp

示例2: sizeof

void
TAO_RT_ORBInitializer::register_policy_factories (
  PortableInterceptor::ORBInitInfo_ptr info)
{
  // The RTCorba policy factory is stateless and reentrant, so share a
  // single instance between all ORBs.
  if (CORBA::is_nil (this->policy_factory_.in ()))
    {
      PortableInterceptor::PolicyFactory_ptr policy_factory;
      ACE_NEW_THROW_EX (policy_factory,
                        TAO_RT_PolicyFactory,
                          CORBA::NO_MEMORY (
                            CORBA::SystemException::_tao_minor_code (
                              TAO::VMCID,
                              ENOMEM),
                            CORBA::COMPLETED_NO));

      this->policy_factory_ = policy_factory;
    }

  // Bind the same policy factory to all RTCORBA related policy
  // types since a single policy factory is used to create each of
  // the different types of RTCORBA policies.
  static CORBA::PolicyType const type[] = {
    RTCORBA::PRIORITY_MODEL_POLICY_TYPE,
    RTCORBA::THREADPOOL_POLICY_TYPE,
    RTCORBA::SERVER_PROTOCOL_POLICY_TYPE,
    RTCORBA::CLIENT_PROTOCOL_POLICY_TYPE,
    RTCORBA::PRIVATE_CONNECTION_POLICY_TYPE,
    RTCORBA::PRIORITY_BANDED_CONNECTION_POLICY_TYPE
  };

  const CORBA::PolicyType *end =
    type + sizeof (type) / sizeof (type[0]);

  for (CORBA::PolicyType const * i = type;
       i != end;
       ++i)
    {
      try
        {
          info->register_policy_factory (*i, this->policy_factory_.in ());
        }
      catch (const ::CORBA::BAD_INV_ORDER& ex)
        {
          if (ex.minor () == (CORBA::OMGVMCID | 16))
            {
              // The factory is already there, it happens because the
              // magic initializer in PortableServer.cpp registers
              // with the ORB multiple times.  This is an indication
              // that we should do no more work in this
              // ORBInitializer.
              return;
            }
          throw;
        }
    }
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:58,代码来源:RT_ORBInitializer.cpp

示例3:

void
TAO::Security::ORBInitializer::register_policy_factories (
  PortableInterceptor::ORBInitInfo_ptr info)
{
  // Register the security policy factories.

  if (CORBA::is_nil (this->policy_factory_.in ()))
    {
      PortableInterceptor::PolicyFactory_ptr policy_factory;
      ACE_NEW_THROW_EX (policy_factory,
                        TAO::Security::PolicyFactory,
                          CORBA::NO_MEMORY (
                            CORBA::SystemException::_tao_minor_code (
                              TAO::VMCID,
                              ENOMEM),
                            CORBA::COMPLETED_NO));

      this->policy_factory_ = policy_factory;
    }

  // Bind the same policy factory to all security related policy
  // types since a single policy factory is used to create each of
  // the different types of security policies.

  CORBA::PolicyType type;

  type = ::Security::SecQOPPolicy;
  info->register_policy_factory (type, this->policy_factory_.in ());

  type = ::Security::SecMechanismsPolicy;
  info->register_policy_factory (type, this->policy_factory_.in ());

  type = ::Security::SecInvocationCredentialsPolicy;
  info->register_policy_factory (type, this->policy_factory_.in ());

  type = ::Security::SecFeaturePolicy;   // Deprecated
  info->register_policy_factory (type, this->policy_factory_.in ());

  type = ::Security::SecDelegationDirectivePolicy;
  info->register_policy_factory (type, this->policy_factory_.in ());

  type = ::Security::SecEstablishTrustPolicy;
  info->register_policy_factory (type, this->policy_factory_.in ());

  type = SecurityLevel3::ContextEstablishmentPolicyType;
  info->register_policy_factory (type, this->policy_factory_.in ());

  type = SecurityLevel3::ObjectCredentialsPolicyType;
  info->register_policy_factory (type, this->policy_factory_.in ());

  // ----------------------------------------------------------------
}
开发者ID:asdlei00,项目名称:ACE,代码行数:52,代码来源:Security_ORBInitializer.cpp


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