



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




1
William Pugh 2
3
7
Server VM Bean Bean EJBObject EJBObject Home Com pon ent Int erfa EJBObject ce stub EJBObject stub Home stub Com pon ent Inte rfac e Ho me Inte rfac e Interception happens here happens here^ Interception 12
19
import javax.ejb.*; import java.rmi.RemoteException; public interface Advice extends EJBObject { public String getMessage() throws RemoteException; } 21
import javax.ejb.*; import java.rmi.RemoteException; public interface AdviceHome extends EJBHome { public Advice create() throws CreateException, RemoteException; } 22
public class AdviceBean implements SessionBean { private String[] adviceStrings = {"test", "test1", "test2", "test3"}; public String getMessage() { System.out.println("in get advice"); int random = (int) (Math.random() * adviceStrings.length); return adviceStrings[random]; } public void ejbCreate() { System.out.println("in ejb create"); } 23
EJBHome getEJBHome() Handle getHandle() Object getPrimaryKey() boolean isIdentical(EJBObject obj) void remove()
25
EJBMetaData getEJBMetaData() HomeHandle getHomeHandle() void remove(Handle handle) void remove(Object primaryKey) 26
garbage method ready passivated create method in home invoked bean removed or times out bean inactive call to bean timeout exception thrown business method nowhere
37