Java Reference
In-Depth Information
Client
Object
implementation
Object
implementation
Client
IDL
skeleton
IDL
stub
IDL
skeleton
IDL
stub
Request
Request
ORB
ORB
IIOP
Request
Fig. 6.2 Remote invocation when client and server are using different ORBs
Indeed, some of the pages on the old Sun site referred to the IDL model and the Java
ORB as being separate entities. Mostly, however, Java IDL is referred to as the ORB
itself, with this taken to include the IDL-to-Java mapping.
IDL supports a class hierarchy, at the root of which is class Object . This is not
the same as the Java language's Object class and is identifi ed as org.omg.CORBA.
Object (a subclass of java.lang.Object ) in Java. Some CORBA operations (such as
name lookup) return an object of class org.omg.CORBA.Object , which must then be
'narrowed' explicitly (effectively, typecast into a more specifi c class). This is
achieved by using a 'helper' class that is generated by the idlj compiler (along with
stubs, skeletons and other fi les).
An IDL specifi cation is contained within a fi le with the suffi x .idl. The surround-
ing structure within this fi le is normally a module (though it may be an interface ),
which corresponds to a package in Java (and will cause a Java package statement
to be generated when the IDL is compiled). The module declaration commences
with the keyword module , followed by the name of the specifi c module (beginning
with a capital letter, even though the Java convention is for a package name to begin
with a lower-case letter). The body of the module declaration is enclosed by curly
brackets and, like C++ (but unlike Java), is terminated with a semi-colon. For a
module called Sales , then, the top level structure would look like this:
module Sales
{
...................;
...................;
...................;
};
Search WWH ::




Custom Search