October 2003
Beginner
734 pages
16h 56m
English
package headfirst;
import javax.ejb.*;
import java.rmi.RemoteException;
public interface Customer extends EJBObject {
public String getLastName() throws RemoteException;
public void setLastName(String lastName) throws RemoteException;
public String getFirstName() throws RemoteException;
public void setFirstName(String firstName) throws RemoteException;
}Rules for the Remote component interface
Import javax.ejb.* and java.rmi.RemoteException
Extend javax.ejb.EJBObject
Declare one or more business methods, that throw a RemoteException
Arguments and return types must be RMI-IIOP compatible (Serializable, primitive, Remote, or arrays or collections of any of those)
You can have overloaded methods
Each method must declare a RemoteException
You can declare your own application exceptions, but they must NOT be runtime exceptions (in other words, they must be compiler-checked exceptions—subclasses of Exception but not subclasses of RuntimeException)
Methods can have arbitrary names, as long as they don’t begin with “ejb”.
Read now
Unlock full access