
Chapter 8 Creating Enterprise JavaBeans Clients
Calling local interface methods
You can use EJB local invocations in servlet, JSP, or EJB
component code to call EJB components hosted on the same server.
Proxies for a local bean can be instantiated with almost the same
code that would be used to instantiate remote proxies. The differences
are:
- You must create a local EJB reference
for the called EJB component, and use the aliased JNDI name defined
in the EJB local reference.
- Parameters that are not primitive types are passed
by reference, not by value. Changes to a parameter in the component
implementation affect the variable passed from the caller.
- You must narrow to the local home interface type,
not the home interface type.
- Local interfaces are available only to EJB components,
Java servlets, and JSPs hosted on the same server as the target
component. You must configure a local EJB reference for the call,
as described in "Adding an EJB local reference" and "Editing an EJB local reference".
- If local interfaces are used, both the caller and
the called component must be loaded by the same custom class loader.
See "For calls to EJB components
with local interfaces" for
more information.
Copyright © 2002 Sybase, Inc. All rights reserved.
|
|