Chapter 10 Jaguar EJB Interoperability
To invoke a non-EJB component from an EJB client, you must first create a home interface for the component, then generate EJB stubs for the component's interfaces. Then you can instantiate proxies for the non-EJB component using the standard EJB client design pattern.
Non-EJB components can implement several remote interfaces. To instantiate proxies for any remote interface from EJB clients, you must use a corresponding home interface. Use Jaguar Manager to create a home interface for each IDL interface that the component implements. The home interface must have a single create method that takes no parameters and returns the remote interface.
Even with a home interface defined, Jaguar creates component instances using the standard method for the component's lifecycle model. A non-EJB component does not need to implement any additional methods to support the home interface.
To create the home interface
module::component_interfaceHomewhere module is the IDL module where the remote interface is defined, and component_interface is the base (non-nested) name of the remote interface. For example, MyPackage::MyComponentHome.
Use Jaguar Manager to generate EJB stubs for the component, specifying a different package or code base for the EJB stubs than used by the existing CORBA stubs.
CORBA and EJB stubs share class names but do not share the same implementation. Therefore, each type must be in a different Java package or use a different code base.
"Generating EJB stubs" describes how to generate the stub files.
After defining a home interface and generating EJB stubs, you can instantiate a home interface for the component using the standard EJB technique, as described in Chapter 9, "Creating Enterprise JavaBean Clients".
The component's home interface name matches the value of the com.sybase.jaguar.component.bind.naming property. For non-EJB components, you must view the value of this property using the All Properties tab in the Component Properties dialog box. If the property is not set, the default is initial-context/package/component, where initial-context is the server's initial naming context, package is the Jaguar Manager package where the component is installed, and component is the component name as displayed in Jaguar Manager.
The methods in the Java remote interface follow the standard CORBA IDL-to-Java datatype mappings. To allow increased interoperability between EJB clients and non-EJB components, Jaguar allows use of out and inout parameters in the remote interface. In the Java remote interface, these are represented by the same holder classes as used in CORBA stubs. See "Holder classes" for more information on using holder classes.
Copyright © 2000 Sybase, Inc. All rights reserved. |