According to page 157 in HF
EJB can a bean have both a local and a remote view. Yes, It may be very unlikely that a real design require it, but if i want to try it just to know that it works and how to do it, or just for fun, how do I do it? Using the famous Advice bean example of course : )
I have already played with the naive ways to do it without success. I just created a EJBLocalHome and a EJBLocalObject interface together (in a parallell package) with the remote counterparts and deployed that in RI. I could also see that RI allows to define a bean with both local and remote interfaces, there is two drop downs for each of them. But the verifier did not
test succesfully for the local interfaces, for one thing probably because the implementation methods in the bean class declares throw of RemoteException which the local interfaces does not (and not allows). And it did not work when I tried to execute a local client to it either, of course. But also, I guess I have to register the locla and remote home using different names in JNDI, to let the client have a chance to tell if it want the local or remote view, right? And I found some way it may be done in RI but am not sure I am right.
Instead of have to do trial and error to maybe get this to work, how should I do it? Please! : ) Is it correct that it should be possible to share the bean class and have two local and two remote interfaces and get it to work with both a local client and a remote client for that bean?