How do I make my EJB to behave locally when it gets a call from a in-process and to behave remotely when it gets a remote call.. How do i give it a dual functionality...
Is it the correct way that my EJBHome class extends both EJBHome and EJBHomeLocal to provide the dual nature..
It will be really great if someone and brief me....
Although you can certainly design your EJB to expose both local and remote interfaces (accessible through the local and remote home objects, respectively), it is not something which is transparent to the caller-- your client must know whether it can access your EJB locally or remotely, and must retrieve a reference to it through the appropriate EJB Home (the local home or the remote home).
If you truly need the type of transarency you imply in your message (if you can't ensure that callers will be in the same JVM, for example) you'll probably have to use a remote EJB; most containers will detect and optimize calls made in-process.
Hope this helps,
Thank u Tim.. Yeah, I'm almost clear...