Step #2: Specify the Enterprise JavaBeansTM Remote Interface
The remote interface is the clients' view of the EJB, and the task of the EJB developer is to declare this interface using JavaTM RMI syntax. It is the responsibility of the Enterprise JavaBeans' container tools provider to generate the implementation (that is, the code) of this interface. There are programmatic limitations on what can be specified in this interface; for a full list please refer to the EJB specification (section #16), but importantly, all of the objects used and the parameters, return values and exceptions must be valid types in the "Java to IDL mapping specification." For our simple /** * Demo -- this is the "remote" interface of * our enterprise JavaBean, it * defines only one simple method called * demoSelect(). As this is meant to be * the simplest of examples demoSelect() * never goes to a database, it just * returns a string * * Note: The implementation of this interface is * provided by the container tools * but the demoSelect() method and any * other methods in this interface * will need to have equivalent * implementations in the DemoBean.java * which is supplied by the bean writer * ..i.e., you! */ package ejb.demo; import java.rmi.RemoteException;
public interface Demo extends EJBObject, Remote { // NB this simple example does not even do a
}
|
![]() |
![]() |