Generate stub, skeleton, and implementation files

Use EAServer Manager to generates stubs and skeletons for the component. EAServer Manager will also create a sample implementation template for the class that implements the component methods.

NoteInternally, EAServer’s IDL-to-Java compiler is invoked by EAServer Manager to generate Java stubs and skeletons. The direct compiler interface is not intended for customer use.

What the skeleton does The skeleton class interprets component invocation requests and calls the corresponding method in your component with the parameter values supplied by the client. When a client sends an invocation request, the skeleton reads the parameter data and calls the Java method. When the method returns, the skeleton sends output parameter values, return values, and exception status to the client.

You must generate a new skeleton class if:

Using the sample implementation EAServer Manager creates a sample source for the implementation class that is specified in the Component Properties window. The generated template file name is:

componentImpl.java.new

where component is the name of the component. The .new extension avoids conflicts with existing source files.

The sample implementation provides a starting point for your own implementation, as it contains all the required method definitions to match the IDL interfaces that the component implements. Each method has the same name as the IDL operation it implements, and uses return and parameter datatypes that are mapped according to the type mappings that you have chosen (see “Choose implementation datatypes”).

In the Java component, component interface methods must be public and cannot be declared static. If the IDL definition of the method has a non-empty raises clause, the Java method must throw equivalent Java exceptions for the IDL exceptions listed in the raises clause.

All methods in the implementation throw the exception org.omg.CORBA.NO_IMPLEMENT. Replace this code with your own method implementation.

If you’ve added methods to an existing component, you can copy the additional method signatures from the .new file to your original source file.

Stubs may be required to compile the component If the component’s definition uses user-defined types for parameters, return values, or exceptions, Java stubs are required for these types. These stubs are generated when you generate stubs for your component, as described in “Generating Java stubs”.

Compiled Java stubs for user-defined IDL types must be available when you compile your component’s implementation file.

StepsGenerating skeletons

  1. Select the component or, if you want to generate skeletons for all components in a package, select the package.

  2. Select File | Generate Stub/Skeleton. The Generate Stubs & Skeletons Wizard displays. Follow the instructions on each page to generate skeletons. See the online help for descriptions of any input fields that you do not understand.

EAServer Manager generates the skeleton source file into the same Java package as the component’s implementation class. Skeletons are named as _sk_Package_Comp.java, where Package represents the EAServer package name and Comp represents the component name.

You must compile the Java class that implements the component before you compile the skeleton class. If the class file is available when you generate skeletons, you can select the Compile Skeletons option in the wizard to compile from EAServer Manager.

When you compile the skeleton class, make sure that the CLASSPATH setting contains the code base directory, as well as the following JAR files in the EAServer installation directory: