Chapter 13 Creating CORBA-Compatible Java Clients


Using other CORBA ORB implementations

Jaguar's IIOP implementation allows you to use any CORBA-compliant client ORB to invoke Jaguar components. You can also use the Jaguar client ORB to execute components that are hosted by another vendor's server ORB.

Connecting to Jaguar with a third-party client ORB

In some cases, you may wish to use another vendor's ORB in your client applications. For example, you may have an existing installation of the ORB on client workstations.

Clients that use another ORB can use the same code as for the Jaguar ORB, except for the following differences:

When executing methods, you may wish to use the Jaguar conversion classes to create and interpret the predefined Jaguar datatypes (see "Binary, fixed-point, date/time, and ResultSet types"). These conversion classes, in packages com.sybase.CORBA.jdbc102 and com.sybase.CORBA.jdbc11, are documented in the Jaguar CTS API Reference. The classes are compatible with any Java ORB.

Generating compatible stubs

You should generate stubs for your third-party ORB using the IDL-to-Java or IDL-to-C++ compiler provided by the vendor. Stubs created by Jaguar Manager are not guaranteed to work with another ORB.

Each component's IDL interfaces are specified in the Component Properties window, under the General tab. See "Configuring component properties" for more information. All interfaces are defined in IDL modules that are stored as plain text files in the Jaguar Repository subdirectory. For example, if the component implements the Module1::I1 and Module2::I2 interfaces, you will need to copy the files Module1.idl and Module2.idl into a working directory for generating stubs for your third-party ORB software. You must also copy any files that are included by these modules, including those listed in "Predefined Jaguar IDL files".

As an alternative to copying files, you can open modules in the Jaguar IDL editor and use File | Save As to save them to your working directory. See "Creating and editing IDL modules" for more information.

Predefined Jaguar IDL files lists the names of the predefined Jaguar IDL modules that are needed by all client applications.

Predefined Jaguar IDL files

Filename

Description

SessionManager.idl

Defines interfaces for session-based creation of Jaguar component instances.

BCD.idl

Defines the CORBA datatypes for Jaguar's binary and fixed-point numeric datatypes.

MJD.idl

Defines the CORBA datatypes for Jaguar's date and time datatypes.

TabularResults.idl

Defines the CORBA datatypes that represent result sets returned by a method invocation.

WARNING!

When creating stubs for another ORB, do not overwrite the Jaguar Java stubs in the Jaguar html/classes subdirectory. Use different package names when creating stubs for third-party ORBs or create the 3rd-party ORB stubs under a different code base.

Instantiating components using a third-party ORB

Jaguar's naming service cannot be used with other client ORBs, so you must use the Jaguar SessionManager::Manager interface to instantiate components from another ORB, as described in "Instantiating proxy instances". Set the org.omg.CORBA.ORBClass property to the name of the class provided by your ORB vendor.

Also, you must use standard format IORs, not the URL format, as described in "Standard format IORs".

To simplify applet deployment, you can use one of the following techniques to avoid coding IORs into deployed HTML or Java class files:

Connecting to third-party ORBs using the Jaguar client ORB

You can use the Jaguar client-side ORB to execute components hosted by another vendor's server-side ORB, as long as the server-side ORB accepts IIOP connections and the required interfaces are defined in standard CORBA IDL.

Steps Implement your client as follows:

  1. Import all the required IDL modules into Jaguar Manager, as described in "Importing existing IDL modules".

  2. Generate stubs for each imported module using Jaguar Manager, as described in "To generate Java stubs in Jaguar Manager:". You must generate stubs for each module individually.

  3. Implement code to connect to the third-party server and instantiate components, following the vendor' s documentation.


 


Copyright © 2000 Sybase, Inc. All rights reserved.