aspose file tools*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes How to get Stateful bean from SessionFacade 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 "How to get Stateful bean from SessionFacade" Watch "How to get Stateful bean from SessionFacade" New topic
Author

How to get Stateful bean from SessionFacade

Vitaliy Kim
Greenhorn

Joined: May 14, 2007
Posts: 3
Hi all,

If anyone could help me with this sequence:

Controller -> SessionFacade -> SFSB by Dependency injection or after SessionFacade I need to use ServiceLocator and then SFSB ... ?

sivan jai
Ranch Hand

Joined: Feb 24, 2010
Posts: 115
you can use DI to inject the SFSB.
Dmitri Ericsson
Ranch Hand

Joined: Feb 16, 2010
Posts: 109
It is not right to use from Stateless Bean Stateful Bean, in this case state saving does not make sense


SCEA 5, SCJP 6 My SCEA Experience
Vitaliy Kim
Greenhorn

Joined: May 14, 2007
Posts: 3
Dmitri Ericsson wrote:It is not right to use from Stateless Bean Stateful Bean, in this case state saving does not make sense


Ok, SessionFacade can be Stateful or Stateless, as I understand it's possible to use Stateful -> stateful, but not Stateless -> stateful by DI.

So here is another question, how can I get a link to SessionFacade (SFSB) from my Controller? Controller is not EJB bean... Is it only way through ServiceLocator?
Vitaliy Kim
Greenhorn

Joined: May 14, 2007
Posts: 3
Thanks for your answers guys!
sivan jai
Ranch Hand

Joined: Feb 24, 2010
Posts: 115
you can have DI in servlets.
EDIT: reading your problem again I'm confused - SFSB is tied to a client so I don't think it is ok to inject it into a servlet. I think my answer is I dont know
I have been using Java for 8 years and I have used SFSB only once so I think I better stay away from this question :-)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get Stateful bean from SessionFacade