Generating EJB stubs

Stub classes act as proxies for an instance of the EAServer component. You can generate EJB stubs for components that are implemented in any of EAServer’s supported component models. One stub interface is generated for each IDL interface that the component implements.

NoteBefore generating stubs If you are generating stubs for a component that is not an EJB component, make sure the component has a home interface defined. See “Invoking non-EJB components from EJB clients” for more information.

If you are generating stubs for multiple client models, stubs for each model must be generated to a different code base or Java package.

StepsGenerating EJB stubs

  1. Highlight a component, package, or module as follows:

    • Highlight a component to generate stubs for all interfaces and types required by a component,

    • Highlight a package to generate all stubs needed by components in the package, or

    • Highlight a module in the IDL folder to generate stubs for IDL interfaces and types defined within that module.

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

For each IDL interface that is assigned to a component, EAServer Manager generates a Java interface with the same name as the IDL interface, a stub class that implements that interface, a helper class, and a holder class. For example, for an IDL interface named Calculator::Calc, EAServer Manager creates the source files listed in the following table:

Table 8-1: Java stub source files for example interface calc

File Name

Purpose

Calc.java

Defines an interface with methods equivalent to the component’s methods.

Calc_Stub.java

Class that implements the interface.

CalcHolder.java

Used when interface references are passed as an inout or output parameter.

EAServer Manager creates stubs for each interface and datatype defined in a module. If your component references a module that contains multiple interfaces, you will find that additional stub files are generated besides the stubs for the interfaces that are directly implemented by your component.

If you did not elect to compile the stubs in EAServer Manager, compile the stub classes. Make sure that the CLASSPATH setting contains the code base directory and the following JAR files in the EAServer installation directory: