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


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

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


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

示例1:

void
FOO_IORInterceptor_ORBInitializer::post_init (
    PortableInterceptor::ORBInitInfo_ptr info)
{
  IOP::CodecFactory_var codec_factory =
    info->codec_factory ();

  // Set up a structure that contains information necessary to
  // create a GIOP 1.2 CDR encapsulation Codec.
  IOP::Encoding encoding;
  encoding.format = IOP::ENCODING_CDR_ENCAPS;
  encoding.major_version = 1;
  encoding.minor_version = 2;

  // Obtain the CDR encapsulation Codec.
  IOP::Codec_var codec =
    codec_factory->create_codec (encoding);

  PortableInterceptor::IORInterceptor_ptr foo;
  ACE_NEW_THROW_EX (foo,
                    FOO_IORInterceptor (codec.in ()),
                    CORBA::NO_MEMORY (
                      CORBA::SystemException::_tao_minor_code (
                        TAO::VMCID,
                        ENOMEM),
                      CORBA::COMPLETED_NO));

  PortableInterceptor::IORInterceptor_var ior_interceptor =
    foo;

  info->add_ior_interceptor (ior_interceptor.in ());
}
开发者ID:manut,项目名称:TAO,代码行数:32,代码来源:FOO_IORInterceptor_ORBInitializer.cpp

示例2: ServerRequestInterceptor

void
ServerORBInitializer::post_init (
    PortableInterceptor::ORBInitInfo_ptr info)
{

  CORBA::Object_var obj =
    info->resolve_initial_references ("POACurrent");

  PortableServer::Current_var poa_current =
    PortableServer::Current::_narrow (obj.in ());

  ACE_ASSERT (!CORBA::is_nil (poa_current.in ()));


  CORBA::String_var orb_id = info->orb_id ();

  // Create and register the test's ServerRequestInterceptor

  PortableInterceptor::ServerRequestInterceptor_ptr tmp;
  ACE_NEW_THROW_EX (tmp,
                    ServerRequestInterceptor (orb_id.in (),
                                              poa_current.in ()),
                    CORBA::NO_MEMORY (
                      CORBA::SystemException::_tao_minor_code (
                        TAO::VMCID,
                        ENOMEM),
                      CORBA::COMPLETED_NO));

  PortableInterceptor::ServerRequestInterceptor_var server_interceptor = tmp;

  info->add_server_request_interceptor (server_interceptor.in ());


  // Create and register the test's IORInterceptor

  PortableInterceptor::IORInterceptor_ptr ort_test_interceptor;
  ACE_NEW_THROW_EX (ort_test_interceptor,
                    ORT_test_IORInterceptor,
                    CORBA::NO_MEMORY (
                      CORBA::SystemException::_tao_minor_code (
                        TAO::VMCID,
                        ENOMEM),
                      CORBA::COMPLETED_NO));

  PortableInterceptor::IORInterceptor_var ior_interceptor =
    ort_test_interceptor;

  info->add_ior_interceptor (ior_interceptor.in ());
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:49,代码来源:ServerORBInitializer.cpp

示例3: ServerInterceptor

void
ServerInitializer::post_init (
                              PortableInterceptor::ORBInitInfo_ptr info)
{
  // get reference to the codec_factory
  IOP::CodecFactory_var codec_factory = info->codec_factory();

  // Create and register the request interceptors.
  PortableInterceptor::ServerRequestInterceptor_var si =
    new ServerInterceptor (codec_factory);
  info->add_server_request_interceptor (si.in());

  // add IOR Interceptor
  PortableInterceptor::IORInterceptor_var iori = new ServerIORInterceptor;
  info->add_ior_interceptor (iori.in());
}
开发者ID:DOCGroup,项目名称:ACE_TAO,代码行数:16,代码来源:ServerInitializer.cpp

示例4:

void
TAO_LB_ORBInitializer::post_init (
    PortableInterceptor::ORBInitInfo_ptr info)
{
  CORBA::Object_var obj =
    info->resolve_initial_references ("LoadManager");

  CosLoadBalancing::LoadManager_var lm =
    CosLoadBalancing::LoadManager::_narrow (obj.in ());

  CORBA::String_var orbid = info->orb_id ();

  PortableInterceptor::IORInterceptor_ptr tmp;
  ACE_NEW_THROW_EX (tmp,
                    TAO_LB_IORInterceptor (this->object_groups_,
                                           this->repository_ids_,
                                           this->location_.in (),
                                           lm.in (),
                                           orbid.in (),
                                           this->load_alert_),
                    CORBA::NO_MEMORY (
                      CORBA::SystemException::_tao_minor_code (
                        TAO::VMCID,
                        ENOMEM),
                      CORBA::COMPLETED_NO));

  PortableInterceptor::IORInterceptor_var ior_interceptor = tmp;

  info->add_ior_interceptor (ior_interceptor.in ());

  // ----------------

  PortableInterceptor::ServerRequestInterceptor_ptr sri;
  ACE_NEW_THROW_EX (sri,
                    TAO_LB_ServerRequestInterceptor (this->load_alert_),
                    CORBA::NO_MEMORY (
                      CORBA::SystemException::_tao_minor_code (
                        TAO::VMCID,
                        ENOMEM),
                      CORBA::COMPLETED_NO));

  PortableInterceptor::ServerRequestInterceptor_var sr_interceptor = sri;

  info->add_server_request_interceptor (sr_interceptor.in ());
}
开发者ID:CCJY,项目名称:ATCD,代码行数:45,代码来源:LB_ORBInitializer.cpp


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