File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Local Interfaces and SFSBs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Local Interfaces and SFSBs" Watch "Local Interfaces and SFSBs" New topic

Local Interfaces and SFSBs

dieman nambawan

Joined: Jul 11, 2005
Posts: 12
Hello everyone,

A question on inter-session bean communication.

In my architecture the stateful bean is only accessesd by other (stateless) beans. That means that in principle I need only a local business interface for that bean. At the same time, a stub of that SFSB is kept on the(generally remote) controller object. My question: how does it work in this case? Can I remotely store (and re-use) a reference to a local-access stateful bean? I know that local interface is to be combined with the local home interface.

Is it the case where I need 2 pair of interfaces(remote/home and local/localhome)?

Thanks in advance for all replies
[ August 22, 2005: Message edited by: dieman nambawan ]
Hitry Mitry
Ranch Hand

Joined: Jun 16, 2005
Posts: 32
I have the same difficulty. Can I use local interfaces for the shopping cart Stateful Session Bean?

Please respond.
Marie Pierre Courbevoie
Ranch Hand

Joined: Aug 01, 2005
Posts: 32
If you want your SFSB ShoppingCartEJB implements local interfaces, you should use a SFSB as Main Controller(it caches references to the ShoppingCartEJB) with remote interfaces and all other EJB have local interfaces, similar to the Petstore strategy, a Handle to this MainControllerEJB is stored in the presentation tier HttpSession or other stuff.
Using A SFSB as EJB controller (only one entry point to the Business tier) for conversational use cases isn't an overhead, it only dispatches requests to specialized SLSB and manages ShoppingCartEJB. May be, performances are better than using many remote SLSB facades.(see Core J2EE patterns)

Marie Pierre
[ August 22, 2005: Message edited by: Marie Pierre Courbevoie ]
I agree. Here's the link:
subject: Local Interfaces and SFSBs
It's not a secret anymore!