Chapter 13 Creating CORBA-Compatible Java Clients


Procedure for creating CORBA-compatible Java clients

A Java client establishes a session with the Jaguar server, instantiates stub (or proxy) instances for Jaguar components, and executes component methods by calling like-named methods on the stub instance.

Steps The development procedure is as follows:

  1. Generate stub classes.

    These classes act as a proxy object for a component instance that is executing on the Jaguar server; there is one stub for each IDL interface that the component implements. "Generating Java stubs" describes how to generate stubs with Jaguar Manager.

  2. Implement code to instantiate proxy objects.

    Your program must obtain proxy objects for the Jaguar component and narrow them to the stub interface that you intend to use. Jaguar supports three techniques for proxy instantiation, using different interfaces for resolving component names to server objects. "Instantiating proxy instances" describes each technique in detail.

  3. Implement code that invokes the component methods.

    You execute the component's methods by calling like-named methods on the stub class and passing the necessary input data. Each stub method has a return value and parameter list that is mapped from the corresponding Jaguar Manager method definition. "Executing component methods" describes return type and parameter type mappings in detail.

  4. If desired, you can serialize the component instance reference as an IOR string, then deserialize the reference later.

    See "Serializing component instance references" for details.

  5. Clean up client-side resources.

    When proxy objects are no longer required, set the references to null to expedite cleanup by the Java garbage collection mechanism. See "Cleaning up client resources" for details.


Each of these steps requires appropriate exception handling. "Handling exceptions" summarizes CORBA exceptions.

 


Copyright © 2000 Sybase, Inc. All rights reserved.