Tao-related notes

Source: Internet
Author: User

1. Create orb, POA, and poa_manager objects

 
CORBA: orb_var orb = init_orb_with_naming_service (argc, argv );
 
CORBA: object_var poa_object = orb-> resolve_initial_references ("rootpoa"); portableserver: poa_var POA = portableserver: Poa: _ narrow (poa_object.in (); portableserver :: poamanager_var poa_manager = PoA-> the_poamanager (); poa_manager-> activate (); tao_orb_manager orb_manager (orb. in (), POA. in (), poa_manager.in ());

If everything uses the default value, you can directly use the tao_orb_manager class to help create it.

2. Create an object and register the service

 
CORBA: object_var callback = orb-> callback (¡± nameservice callback ±); cosnaming: namingcontext_var naming_context = cosnaming: namingcontext: _ narrow (callback (); cosnaming:: Name (1 );

/// Create an object

Slib_channelfactory_ I channelfactory_ I (PoA. In (), poa_manager.in ());

/// Use the default POA for activation

: Slib: channelfactory_var channelfactory = channelfactory_ I. _ this ();

Name. Length (1 );

Name [0]. ID = CORBA: string_dup ("myfactory ");

STD: cout try {

Naming_context-> BIND (name, channelfactory. In ());

} Catch (cosnaming: namingcontext: alreadybound & Ex ){

Naming_context-> rebind (name, channelfactory. In ());

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.