Originally posted by Will Lee:
a. L can pass its reference for B as a return value of a method call from R
b. R can pass its reference for B as a parameter in a method call to L
Local interface can only stay locally, it can not be passed outside of JVM. Therefore,
A. L's reference for B is actually a reference to EJBLocalObject of B (stub), in order to pass to R as return value, it probably need to go to another JVM where R is sitting at. So A is wrong
B. R's reference for B is actually a reference to EJBObject of B (stub), since it's remote interface type, it can go anywhere, w/in or outside of JVM. When it is passed as parameter to L, it just goes to another JVM which is perfectly OK, therefore B is correct
I just can't get the reason of C: why local client can not call remote client's methods? Remote client doesn't have anything to do w/ remote interface type, even it is in another location, L should be able to RMI it. Why "can NOT"?