Chapter 13: Developing CORBA/Java Clients


Procedure for creating CORBA/Java clients

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

  1. Generate stub classes.

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

  2. Implement code to instantiate proxy objects.

    Your program must obtain proxy objects for the EAServer component and narrow them to the stub interface that you intend to use. See “Instantiating proxy instances”.

  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 IDL operation 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.

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