Java Reference
In-Depth Information
Table 19.1
IDL files list.
File Name
Description
Cor19Example.java A Java interface corresponding to
the IDL interface, defines constants
that were defined within the IDL
interface.
Cor19ExampleHelper.java Static support methods. The most
important method here is the
narrow() method used to perform
object casting in CORBA.
Cor19ExampleHolder.java Holder class for Cor19Example .
Cor19ExampleOperations.java A Java interface that defines the
methods corresponding to the IDL
operations.
Cor19ExamplePOA.java Abstract class, must be extended by
the implementation class. Serves
as the server-side skeleton class.
Cor19UserException.java Java Exception class corresponding
to the user exception defined in
the IDL.
Cor19UserExceptionHelper.java Helper for Cor19UserException .
Cor19UserExceptionHolder.java Holder for Cor19UserException .
CustomData.java Final Java class corresponding to the
user-defined struct in the IDL.
CustomDataHelper.java Helper for CustomData .
CustomDataHolder.java Holder for CustomData .
SERVER - CONSTANT.java Java interface defining the value of
SERVER - CONSTANT .
- Cor19ExampleStub.java Stub class needed by clients.
All of these generated classes are important, but the most commonly seen
usage is probably the narrow() method in the Helper classes. All CORBA
objects are derived from the org.omg.CORBA.Object class. To cast a generic
object into a specific type, the narrow() method must be used. Conceptually,
narrowing is nearly identical to the normal Java cast operation, but a Java cast
does not work. Each CORBA Object type has an associated Helper class with a
narrow() method in order to do the casting. The Helper classes also provide
other services that we do not discuss here.
19.4 Creating the server implementation
Similarly to what we did for RMI, we build an implementation file in the
javatech.cor19.server.impl package. We can name the implementation
Search WWH ::




Custom Search