Local Interfaces in EJB2.0

Discussions

EJB programming & troubleshooting: Local Interfaces in EJB2.0

  1. Local Interfaces in EJB2.0 (2 messages)

    Hi ,

    I have been reading up on local interfaces in Ed Roman's book but i am not exactly clear on some points:

    1.how exactly do local interfaces work.

    2.When it is said that they work in a single process,what exactly does it mean.

    3.General Info/links on the same.

    Thanks in advance,
    seeking enlightenment,

    Ameya

    Threaded Messages (2)

  2. Local Interfaces in EJB2.0[ Go to top ]

    1. They work pretty much like remote interfaces, except:
    - No RMI call is involved. The container uses normal Java method calls.
    - Arguments are not duplicated (e.g, serialized/deserialized) - they are passed by reference just like normal Java arguments.
    Because no RMI calls are involved, you also don't have to deal with those pesky RemoteExceptions.

    2. When RMI calls are used, the process that makes the call sends the request to some port, where it is picked up by another process. That process proceeds to handle the request, and when it completes it sends the result to the original process. At that point the original process regains control and continues to run. When using local interfaces, all this doesn't happen. There is only one process, because the invocations are normal Java calls.
    Note that the info above is not normative: RMI calls are not required to switch processes, and local calls are not required to stay in the same process (AFAIK). But in practice, that's what usually happens.

    I don't know any good resources other than the spec, which is the ultimate resource if you know how to use it. Unfortunately it does take some getting used to. But I think it is worth the trouble.

    Gal
  3. Local Interfaces in EJB2.0[ Go to top ]

    Thank you very much for your reply Gal.Your reply gave me some valuable insight.
    According to you then,the local interface is a kind of regulatory body,if u will, as far as remote communication is concerned.In that case is there an EJBObject for this one also and does it have the same capabilities?

    I am sorry if i sound clueless but im just trying to get some perspective abt this.

    Thanks again
    Ameya