Java Reference
In-Depth Information
Example 22.3 is a listing of our home interface. It looks like an empty
shell, but it is all that we need. The rest is handled by J2EE.
Example 22.3 Sample (remote) home interface
package com.jadol.budgetpro;
import javax.ejb.*;
import java.rmi.*;
/**
* Remote Home Interface
*/
public interface
MoneyHome
extends EJBHome
{
public Money
create()
throws CreateException, RemoteException
;
} // interface MoneyHome
22.2.4
With these three pieces—the session bean, the remote interface, and the home
interface—we can see the structure of the key pieces of an EJB. Let's review
what we have:
Summarizing the Pieces
Application object
Extends/implements
Talked about as
remote interface
Money
EJBObject
home interface
MoneyHome
EJBHome
the implementation
MoneyBean
SessionBean
EJBLocalHome and EJBLocalObject
22.2.5
When the session or entity bean is going to be referenced by application code
that resides on the same host as the bean, there are variations on the home and
remote interfaces that allow for more efficient execution. When you know that
the beans are local to this host, you should use a local interface (Example 22.4)
Search WWH ::




Custom Search