Start of Tutorial > Start of Trail |
Search
Feedback Form |
This tutorial teaches the basic tasks in building a CORBA distributed application using Java IDL. You will build the classic Hello World program as a distributed application, with both applet and application clients. The Hello World program has a single operation that returns a string to be printed. CORBA terminology and the underlying functionality of the application is discussed in The CORBA Architecture. The application diagram is repeated here, along with a review of the steps in the process of communication between the client and server.Communication between the client and server.
- The client (applet or application) invokes the
sayHello
operation of the HelloServer.- The ORB transfers that invocation to the servant object registered for that IDL interface.
- The servant's
sayHello
method runs, returning a JavaString
.- The ORB transfers that
String
back to the client.- The client prints the value of the
String
.Despite its simple design, the Hello World program lets you learn and experiment with all the tasks required to develop almost any CORBA program that uses static invocation.
Before you start working with Java IDL, you need two things: version 1.2 of the JDK software and theidltojava
compiler. The JDK provides the API and ORB needed to enable CORBA-based distributed object interaction. Theidltojava
compiler uses the IDL-to-Java mapping to convert IDL interface definitions to corresponding Java interfaces, classes, and methods, which you can then use to implement your client and server code. Click here to download and install theidltojava
compiler
Note: The JavaTM 2 Platform, Standard Edition, v. 1.3, now includes a new version of the IDL-to-Java compiler,idlj
. Theidlj
compiler replaces theidltojava
compiler that was available as a separate download in previous releases. You can download the JavaTM 2 Platform, Standard Edition, v. 1.3 and visit Java IDL Documentation for more information on Java IDL in the 1.3 release.
This section teaches you
how to write a simple IDL interface definition and
how to translate the IDL interface to Java.
It also describes the purpose of each file generated by
idltojava
compiler.
Learn how to write a simple client application, including how to create an ORB object, how to use the naming service to get an initial object reference, and how to invoke an operation on a CORBA object.
This section has all the information you need to write a simple IDL server, including how to create an ORB object for the server, how to instantiate the servant and connect it to the ORB, how to register the servant with the naming service, and how to make the server wait for invocations on the servant.
After you've written the client and the server, you're ready to compile the code and run the programs.
This section tells you how to make an object reference when there is no naming service.
Start of Tutorial > Start of Trail |
Search
Feedback Form |
Copyright 1995-2001 Sun Microsystems, Inc. All rights reserved.