main()
method for the application.
IE.Iona.Orbix2
package. It also requires access to the classes produced in the compilation of IDL definitions which the application references. The IE.Iona.Orbix2
package is usually installed in the OrbixWeb classes
directory.The details of making class location information available to the Java interpreter are dependent on the Java development environment in use. However, it is generally necessary to indicate the location of the
IE.Iona.Orbix2
package, the Java API classes, the IDL compiler output classes, and the application-specific classes. For example, if using the java
interpreter from Sun Microsystems' JDK, the location of each should be added to the CLASSPATH
environment variable (or specified in the -classpath
switch).Similarly, the details of running the application through the interpreter may differ between development environments. Again if using the JDK
java
interpreter, this can be done by passing the name of the class which contains the application main()
method to the interpreter command, as follows:
java <class name>
<APPLET>
tag) and then load this file into an applet viewer or a Java-enabled web browser. The runtime requirements for the applet depend on whether it is loaded directly from a HTML file or downloaded from a web server.
CLASSPATH
environment variable appropriately before running the viewer or browser and loading the applet. This variable should usually include the location of the following: the classes of the IE.Iona.Orbix2
package, the Java API classes, the IDL compiler output classes, and the other applet-specific classes. When using a Java-enabled browser, the location of the Java API classes is generally not required.When loading an OrbixWeb client applet from a file, it is also possible to specify a
CODEBASE
attribute on the HTML <APPLET>
tag to specify the location of the required class files, as described in section 10.2.2.
10.2.2 Loading a Client Applet from a Web Server
If an OrbixWeb applet is loaded into a browser from a Web server, then it is not possible to specify access paths for the required Java classes at runtime. In this case, it is necessary to provide access (for example, via links) to all the classes the applet requires in a single directory. Then, rather than setting an environment variable, the CODEBASE
attribute of the HTML flag <APPLET>
could be used to indicate the location of the applet bytecode. For example:
<APPLET codebase=<applet class directory> code=<applet class file>Note that when using a Java-enabled Web browser to view an applet, it is not necessary to provide access to the Java API classes, as these will already be available.
Applets are not given access to the file system of the host on which they execute: they can neither save files to the system nor read files from it. Any OrbixWeb client which is implemented as a Java applet must therefore obey this restriction.
In order to prevent the violation of system integrity, Web browsers often limit the network connectivity of applets which are downloaded from a Web server. Such applets can only communicate with the host from which they were downloaded.
This limitation has obvious implications for OrbixWeb client applets which are downloaded from Web servers. In particular, such clients can only communicate directly with OrbixWeb servers located on the host from which the clients themselves were downloaded. If this restriction applies to an OrbixWeb client applet, attempts by that client to bind to a server on an inaccessible host will raise a system exception of type
IE.Iona.Orbix2.CORBA.COMM_FAILURE
.It is important to note that the exact details of applet security are dependent on the browser implementation and may exceed the restrictions described here. OrbixWeb developers should therefore consult their browser documentation for further information.
jdb
debugger). When debugging OrbixWeb clients, it is especially important to be aware of Java exceptions thrown during OrbixWeb method invocations. OrbixWeb provides a set of system exceptions which indicate various categories of execution errors and these represent vital information for locating the source of invocation failures in a distributed application. These exceptions can be handled in client code by using Java
try
and catch
statements. Similarly, they can be handled like standard Java exceptions when using a Java debugger.More details on OrbixWeb integration with Java exceptions can be found in Chapter 12, "Exception Handling".
10.4 Possible Platform Dependencies in OrbixWeb Clients
In general, OrbixWeb clients are only dependent on the availability of a Java interpreter on the target execution platform. However, client programmers should be aware of two issues in client programming which may affect the platform-independence of an OrbixWeb system.