Remote Interface

  • lists the business methods provided by the enterprise Bean to the client
  • defined by EJB developer

The container vendor provides the tools necessary to generate the code (EJBObject) which mediates access to the actual bean class and client-side stubs to communicate with the container.

The user-defined remote interface extends the EJBObject interface:

public interface EJBObject extends java.rmi.Remote {
  public EJBHome getEJBHome() throws java.rmi.RemoteException;
  public Object getPrimaryKey() throws java.rmi.RemoteException;
  public void remove() throws java.rmi.RemoteException, java.rmi.RemoveException;
  public Handle getHandle() throws java.rmi.RemoteException;
  boolean isIdentical (EJBObject p0) throws java.rmi.RemoteException;
}

Note: The real EJB Bean itself is contained within an EJB container and should never be directly accessed by anyone but the container. The EJB Bean class does not even implement the remote interface. This type incompatibility prevents direct accesses from clients or other beans.

First Previous Next

Slide: 18