Chapter 8 Creating Enterprise JavaBeans Clients
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.
Before 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 codebase or Java
package.
Generating EJB stubs
%JAGUAR%\html\classes
Generation strategy | Specifies |
---|---|
Full | Generates Java types for every IDL interface and type referenced by the component. |
Incremental | Compares IDL and Java timestamps to determine
whether a new version of the Java type must be generated. See "IDL and Java timestamping" for more information.
Choosing this option can save generation time if you have not changed many IDL interfaces, and have previously generated EJB stubs for the component, package, or module. |
Optimistic | Similar to Incremental, except that the check for changed classes in each module ends if the first comparison indicates no change. |
EAServer uses IDL timestamps and a database of generation times for generated Java files. IDL timestamps are stored in the IDL file, as a doc comment in the form:
<!-- crc number -->
Where number is an integer CRC code. Java generation times are stored in the file Repository/deployclasstable.db in your EAServer installation.
In some cases, you may need to clear the Java timestamp database. For example, you may have installed new versions of EAServer IDL files with a patch release. To clear the timestamp database:
For each IDL module, Java equivalents for all interfaces, types, and exceptions that are defined in the module are generated to a single Java package. The default Java package name is specified by the module's name or the configured Java package mappings described in "Specifying Java package mappings for IDL modules".
For each IDL interface that is assigned to a component, Jaguar 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, Jaguar Manager creates the source files listed in the following table:
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. |
Jaguar 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 Jaguar 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:
Copyright © 2002 Sybase, Inc. All rights reserved. |
![]() |