CORBA 2.6.1 Programmer's Guide for Java
value="jorb/NameService">
<PARAM name="ORBprofile"
value="tcp_server">
<PARAM name="NSDOM_CFG_PROFILE"
value="tcp_server true, host_name localhost, port_number 0">
<PARAM NAME="NSDOM_CFG_TRACE_PROXY"
value"true">
</APPLET>
In this example, the main class file is AppletExample.class. The Naming Service root naming context URL can be found at web-
page/jorb/NameService.
The
ORBprofile parameter shows that the ORB uses TCP/IP as its communication protocol (it does this by using the tcp_server specification),
and the
NSDOM_CFG_PROFILE attributes are:
tcp_server true
host_name localhost
port_number 0
The example also sets the PROXY tracing, whose output will appear on stdout.
Resolving the Initial Naming Service Reference
Another difference between JORB Lite applets and applications is the way they obtain the initial reference to the Naming Service. Both
applications and applets use the following call:
ORB.resolve_initial_references("NameService")
The resolve_initial_references() call obtains the stringified root naming context IOR from the NameService file. The stringified object is then
transformed into a root naming context object reference (which references the location of the Naming Service) by using a call to
org.omg.CORBA.ORB.string_to_object().
For applications,
resolve_initial_references() can find the stringified root naming context IOR by directly referencing the NameService
configuration file. In this file, the IOR is stored in the entity NS@name_service_settings and its associated key, RootNamingContextIORFile. Using
this information, the call can resolve the root naming context object reference.
Because an applet cannot read a file to look up configuration information, JORB Lite applets must use HTML PARAMS to resolve the location of
the Naming Service.
Specifying the Root Naming Context IOR Location
A JORB Lite applet uses one of the two following methods to obtain the stringified root naming context object reference:
When you specify a URL location using the NSDOM_CFG_NS_URL PARAM tag, the ORB refers to the stringified root naming context IOR at
the following URL:
Applet's document base URL/naming-service-root-nc-url
When you do not specify the NSDOM_CFG_NS_URL PARAM tag, the ORB reads the contents of this URL:
Applet's document base URL/NameService
Note:
Both methods refer to the HTTP server that hosts the applet's web page. Therefore, the Naming Service's root
naming context IOR must be in a location relative to the web-page host.
As an example, suppose that the web page that hosts the applet is http://jorb.tandem.com:8080/test/test.html and that you specified the
following URL by using the
NSDOM_CFG_NS_URL PARAM tag:
jorblite/NameService
In this case, the ORB uses the following URL to obtain the stringified IOR:
http://jorb.tandem.com:8080/test/jorblite/NameService
Instead, suppose the same site hosts a JORB Lite applet that does not make use of the NSDOM_CFG_NS_URL tag. In this case, the ORB obtains the
stringified IOR from the following URL:
http://jorb.tandem.com:8080/NameService
Chapter 11. Using the IIOP/SSL API Appendix A. Architectural Walkthrough