University of Cincinnati logo and link  
The Remote Interface
 
  UC ingot Remember the remote interface in RMI?  We have the same thing in EJB.  Specifically, we use interface javax.ejb.EJBObject, which extends the same javax.rmi.Remote interface we used in RMI.  
 
  • Just like RMI, our server implementation implements the remote interface.  That way the client knows what methods to call, the stub knows what to implement, and the EJBObject knows what to make available.
    • Not all implementation methods should be in this interface.  Only the ones you want to make public.
    • The methods must still throw RemoteException, as they did with RMI remote interfaces.
    • Again, like RMI, remote methods can only pass primitives, serializable objects, or RMI Remote objects.
  • EJBObject does provide us with a few methods as well:
    • getEJBHome
    • getPrimaryKey
    • remove
    • getHandle
    • isIdentical
      • The good news is, we do not have to implement any of these.  The EJB Container does that for us.
 The Home Object