Home > Articles > Programming > General Programming/Other Languages

This chapter is from the book

This chapter is from the book

Object URLs

CORBA defines a number of uniform resource locator (URL) formats that can be used to specify the location of a CORBA object. The allowed URL formats are summarized in Table 5.

Table 5 Object URL Formats

Format

Description

IOR:

A stringified IOR. The prefix IOR: is followed by a string of hexadecimal numbers.

corbaloc:rir:

Specifies an object reference that is implicitly resolved using resolve_initial_references().

corbaloc:iiop: or corbaloc::

Specifies the location of a CORBA object in a form that is appropriate for the IIOP protocol.

corbaname:rir:

Specifies a name that is resolved relative to the initial naming context.

corbaname:iiop: or corbaname::

Specifies a name that is resolved relative to the given naming context.

file://

Indicates a file that may contain a URL or a stringified IOR of a CORBA object.

ftp://

Indicates a file retrieved using FTP that may contain a URL or a stringified IOR for a CORBA object.

http://

An HTTP URL that can be used to retrieve a URL or a stringified IOR for a CORBA object.


The first five URL formats—IOR:, corbaloc:rir:, corbaloc:iiop:, corbaname:rir:, and corbaname:iiop:—must be supported by a CORBA 3 ORB. However, support for the URL formats file://, ftp://, and http:// is currently optional.

Converting an Object URL to an Object Reference

Any of the previous object URLs can be passed as an argument to the function CORBA::ORB::string_to_object(). You are not restricted to passing the format IOR:..., as was the case with versions of CORBA prior to CORBA 3. The way to convert an object URL to an object reference is:

//C++
// Given:
//   'orbV'      -- a reference to a CORBA::ORB instance
//   'objectURLString' -- an arbitrary object URL string
CORBA::Object_var objV;
objV = orbV->string_to_object(objectURLString);
...

//Java
// Given:
//   'orb'       -- a reference to a org.omg.CORBA.ORB instance
//   'objectURLString' -- an arbitrary object URL string
org.omg.CORBA.Object obj;
obj = orb.string_to_object(objectURLString);
...

The object reference has to be narrowed to the correct type after it is returned by string_to_object().

The ORB may need to carry out a number of steps internally to resolve the object URL passed to string_to_object(). This can include making one or more remote invocations.

URL Escape Mechanism for Strings

An escape mechanism is needed to encode data in a URL. There are two reasons the escape mechanism is needed:

  • Object URLs frequently need to include binary data. The binary data must be mapped to printable characters before it can be included in a URL.

  • Certain nonalphanumeric characters can become garbled when transmitted across the Internet.

For these reasons, an escape mechanism is defined by the Internet Engineering Task Force (IETF) RFC 2396 specifically for URLs. The escape mechanism ensures that arbitrary strings and binary data can be sent across the Internet without being corrupted. The URL escape mechanism is defined as follows:

  • ASCII-encoded alphanumeric characters remain unchanged.

  • The following printable ASCII characters remain unchanged:

  • ;, /, :, ?, @, &, =, +, $, ,, -, _, ., !, ~, *, ', (, ).

  • All other characters are escaped. The escaped characters are represented as a % (percent sign) followed by a two-digit hexadecimal number.

corbaloc:rir: Object URL

The corbaloc:rir: URL has the following general form:

corbaloc:rir:[/ObjectId]

The protocol identifier rir stands for resolve initial references. It indicates that URLs of this form are resolved by making an implicit call to the method resolve_initial_references(). The optional part ObjectId is used to select one of the initial reference types, listed in Table 4. For example, ObjectId might be NameService or RootPOA. If ObjectId is omitted, it is assumed to be NameService by default.

Some examples of corbaloc:rir: URLs are given in Table 6.

Table 6 Examples of corbaloc:rir: Object URLs

Object URL

Description

corbaloc:rir:/TradingService

Resolves to an object reference of type CosTrading::Lookup

corbaloc:rir:/NameService

Resolves to an object reference of type CosNaming::NamingContext

corbaloc:rir:

Resolves to an object reference of type CosNaming::NamingContext


For example, the following invocation of the string_to_object() method

//C++
// Given orbV initialized to an instance of CORBA::ORB
CORBA::Object_var objV = orbV->string_to_object("corbaloc:rir:");

//Java
// Given orb initialized to an instance of org.omg.CORBA.ORB
org.omg.CORBA.Object obj = orb.string_to_object("corbaloc:rir:");

is equivalent to an invocation of the resolve_initial_references() method:

//C++
// Given orbV initialized to an instance of CORBA::ORB
CORBA::Object_var objV = orbV->resolve_initial_references("NameService");

//Java
// Given orb initialized to an instance of org.omg.CORBA.ORB
org.omg.CORBA.Object obj = orb.resolve_initial_references("NameService");

The corbaloc:rir: URL can be used in any context where a stringified object reference is expected.

corbaloc:iiop: Object URL

The corbaloc:iiop: URL is used to specify the location of a CORBA object in a relatively readable form. It has the following general form:

corbaloc:[iiop]:[version@]host[:port][/URL_escaped_object_key]

The protocol identifier iiop is optional. A blank protocol identifier is taken to be iiop by default. The version refers to the IIOP version supported by the object. Currently, it can be 1.0, 1.1, or 1.2. The default is 1.0. The host and port of the server process can be specified. If port is omitted, it is set to 2089 by default. URL_escaped_object_key is derived from the object_key that is part of an IOR. The octets of the original object_key are converted to characters using the URL escape mechanism described previously.

Some examples of corbaloc:iiop: URLs are shown in Table 7.

Table 7 Examples of corbaloc:iiop: Object URLs

Object URL

Description

corbaloc:iiop:1.2@myhost:1234/xyz

A server that supports IIOP 1.2, located on host myhost and listening on port 1234. The object_key is xyz.

corbaloc::myhost:1234/xyz

A server that supports IIOP 1.0, located on host myhost and listening on port 1234. The object_key is xyz.

corbaloc::myhost/xyz

A server that supports IIOP 1.0, located on host myhost and listening on port 2089. The object_key is xyz.


The corbaloc:iiop: URL can be used in place of a stringified IOR in calls to string_to_object(). The URL contains the same sort of location information that is found in an IIOP profile. However, unlike the IOR, the URL cannot encode IOR components, so it is not an exact replacement for the IOR.

Fault-Tolerant corbaloc:iiop: Object URL

It is possible to specify a comma-separated list of addresses in place of a single address in the corbaloc:iiop: URL. For example:

corbaloc::1.2@myhost:1200,:1.2@mybackuphost:1200,iiop:1.2@myotherbackup:1240/xy

Note that the protocol specifier (iiop: or :) is considered to be part of an address. In this case, the ORB has three different servers to choose from, with each of them running on a different host. If the ORB fails to contact the first host, it can try the second or third one.

corbaname:rir: Object URL

The corbaname:rir: URL has the following general form:

corbaname:rir:[/NameService][#URL_escaped_string_name]

This URL is used to specify an object reference by giving a stringified name that is resolved relative to the initial naming context. The protocol identifier rir: indicates that the initial naming context is resolved by invoking resolve_initial_references("NameService"). The ObjectId, specified as /NameService, can be omitted from the URL. The URL_escaped_string_name is a stringified name that has been subjected to the URL escape mechanism.

Some examples of corbaname:rir: URLs are shown in Table 8.

Table 8 Examples of corbaname:rir: Object URLs

Object URL

Description

corbaname:rir:/NameService#Foo/Bar

Resolves the object with the stringified name Foo/Bar relative to the initial naming context.

corbaname:rir:#Foo/name%20with%20spaces

Resolves the object with the stringified name Foo/name with spaces relative to the initial naming context.

corbaname:rir:#Foo%5c%5cwith%20backslash

Resolves the object with the stringified name Foo\\with backslash relative to the initial naming context. Note that \\ is an escaped backslash that represents a single backslash.

corbaname:rir:

Resolves to the initial naming context.


A sample URL of the form corbaname:rir:#Foo/Bar and the following invocation of the string_to_object() method

//C++
// Given orbV initialized to an instance of CORBA::ORB
CORBA::Object_var objV = orbV->string_to_object("corbaname:rir:#Foo/Bar");

//Java
// Given orb initialized to an instance of org.omg.CORBA.ORB
org.omg.CORBA.Object obj = orb.string_to_object("corbaname:rir:#Foo/Bar");

yields a result similar to the following code fragment:

//C++
// Given orbV initialized to an instance of CORBA::ORB
CORBA::Object_var objV = orbV->resolve_initial_references("NameService");
CosNaming::NamingContextExt_var rootCtxV
  = CosNaming::NamingContextExt::_narrow(objV.in() );
if (CORBA::is_nil(rootCtxV.in()) ) {
  cerr << "Error: Failed to narrow to type NamingContextExt" << endl;
  exit(1);
}
objV = rootCtxV->resolve_str("Foo/Bar");

//Java
// Given orb initialized to an instance of org.omg.CORBA.ORB
org.omg.CosNaming.NamingContextExt rootCtx = null;
org.omg.CORBA.Object obj = orb.resolve_initial_references("NameService");
rootCtx = org.omg.CosNaming.NamingContextExtHelper.narrow(obj);
obj = rootCtx.resolve_str("Foo/Bar");

For simplicity, the error handling is not shown in the above example. The object reference obtained needs to be narrowed to the appropriate type before it can be used.

corbaname:iiop: Object URL

The corbaname:iiop: URL has the following general form:

corbaname:[iiop]:[version@]host[:port][/URL_escaped_object_key]
[#URL_escaped_string_name]

This URL format is closely related to the corbaloc:iiop: object URL. The address portion of the URL

[iiop]:[version@]host[:port][/URL_escaped_object_key]

is identical to the address used in a corbaloc:iiop: URL. In the context of a corbaname:iiop: URL, the address is taken to specify the location of a CosNaming::NamingContext object. The URL_escaped_string_name is a stringified name that has been subjected to the URL escape mechanism. The stringified name is resolved relative to the specified naming context to yield the object reference to which the URL refers.

Some examples of corbaname:iiop: URLs are shown in Table 9.

Table 9 Examples of corbaname:iiop: Object URLs

Object URL

Description

corbaname::1.2@myhost:1234/xyz#Foo/Bar

An object reference given by the stringified name Foo/Bar, resolved relative to the naming context given by :1.2@myhost:1234/xyz

corbaname::myhost/xyz#Foo/Bar

An object reference given by the stringified name Foo/Bar, resolved relative to the naming context given by :myhost/xyz


Fault-Tolerant corbaname:iiop: Object URL

In a manner similar to the corbaloc:iiop: URL, it is possible to specify a comma-separated list of addresses in place of a single address in the corbaname:iiop: URL. For example:

corbaname::1.2@myhost:1200,:1.2@mybackuphost:1200,iiop:1.2@myotherbackup:1240
/xyzxyzxyz#Foo/Bar

If the ORB fails to contact the first host, it can try the second or third one. This is particularly valuable in the case of the naming service. If clients locate all application services using the naming service, it is potentially a single point of failure. Using multiple addresses in a URL provides a simple way of redirecting clients to a backup naming host.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020