ejb@glassfish.java.net

Re: Local or Remote interface ?

From: Cheng Fang <Cheng.Fang_at_Sun.COM>
Date: Tue, 26 Sep 2006 09:27:04 -0400

What you said is basically correct. Using local interface has some
restrictions on app deployment options. For ejb-ejb local invocation,
both ends must be in the same ejb-jar. For web-ejb local invocation,
both ends must be in the same EAR. That's one of the reasons why remote
invocations are still needed under certain circumstances for ejb-ejb and
web-ejb calls. You should be able to use these options in any J2EE- or
JavaEE-compliant appservers.

Swing apps are not managed by JavaEE containers, and so it must access
ejb throught remote interfaces.

Cheng




Antonio Goncalves wrote:

> Hi,
>
> I have a full JEE application with EJBs talking to EJBs, JSF Managed
> Bean talking to EJBs and a Swing application talking to EJBs. I've
> been only using Remote interface and everything works fine.
>
> I want to improve my modeling so I thought let's create a Local
> interface for EJB to EJB calls. Brillant. And after I thought would
> Local interface work with JSF Managed Bean. And yes it does. So now I
> think that the only use of the Remote interface is with my Swing
> application... is that right ? If I was using an external web
> container I would have to use Remote interface but is it because of
> the way Glassfish bundles everything that I can use Local interface
> between JSF and EJBs ?
>
> To resume, what should be the way to use Local & Remote interface ?
>
> EJB to EJB : Local
> JSF to EJB : Local
> Swing to EJB : Remote
>
>
>
> Thanks,
>
> Antonio