1, the development of EJB
First, talk about the development steps of EJB.
Development of 1.1 Sessionbean
The first step is to write the remote interface (remoted interface), inherit the Ejbobject interface, write the public method that needs to be invoked (these methods will be implemented in Sessionbean), and note that you want to declare throws
Java.rmi.RemoteException.
For example:
package
jsper.ejb;
import java.rmi.*;
import javax.ejb.*;
public
interface MyEJB extends EJBObject
{
public String
sayHello() throws java.rmi.RemoteException;
}
Second step,
Write the Home interface (factory that generates ejbobject references) to generate at least one create method, note that you want to declare throws Java.rmi.RemoteException and Javax.ejb.CreateException.
Like what:
package
jsper.ejb;
import java.rmi.*;
import
javax.ejb.*;
public interface MyEJBHome extends
EJBHome
{
MyEJB create() throws
java.rmi.RemoteException, javax.ejb.CreateException;
}