Chapter 14. Java IDL (CORBA)


The Java IDL API provides an interface between Java programs and distributed objects built using the Common Object Request Broker Architecture (CORBA). CORBA is a standard defined by the Object Management Group (OMG). It describes architecture, interfaces, and protocols that distributed objects can use to interact with each other. Part of the CORBA standard is the Interface Definition Language (IDL), which is an implementation-independent language for describing the interfaces of remote-capable objects. Standard mappings are defined by the OMG for converting IDL interfaces into C++ classes, C code, and Java classes, among others (a complete list is provided later in the chapter). These generated classes use the underlying CORBA framework to communicate with remote clients and give you the basis for implementing and exporting your own distributed objects. Java IDL is Sun's implementation of the standard IDL-to-Java mapping and is provided by Sun's JDK in the org.omg.CORBA package, the org.omg.CosNaming package, and other org.omg.* packages.

Like RMI, Java IDL gives you a way to access remote objects over the network. It also provides the tools you need to make your objects accessible to other CORBA clients. If you export a Java class using Java IDL, it's possible to create an instance of that class and publish it through a naming/directory service. A remote client can find this object, call methods on it, and receive data from it, just as if it were running on the client's local machine. Unlike RMI, however, objects that are exported using CORBA can be accessed by clients implemented in any language with an IDL binding (not just Java).

The CORBA standard is extensive, to say the least. In addition to the basic remote object architecture and the syntax of IDL, it also includes specifications for several distributed object services , like an object naming service, a security policy service, and persistent object services. It would be foolhardy to attempt to cover all these topics completely in one chapter, so we won't. Instead, we'll just cover the basic features of the CORBA architecture and the IDL syntax. A full reference for IDL syntax is provided in Appendix G. We'll also look at the Naming Service, which is key to almost every CORBA application, because it provides a standard way to find remote CORBA objects on the network. After that, we'll take a look at the Java IDL API and the idlj compiler and how they work together to give you an interface from your Java code to CORBA objects and services. They also provide the tools you need to create your own CORBA objects, implemented in Java.

The rest of this chapter is broken down roughly into three parts. In the first part, we'll look at an overview of the CORBA architecture and how it allows you to create, export, access, and manage remote objects. In the second part, we'll explore the details of creating your own CORBA objects. Finally, we'll look at how clients can remotely access your CORBA objects.



Java Enterprise in a Nutshell
Java Enterprise in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596101422
EAN: 2147483647
Year: 2004
Pages: 269

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net