[jboss-user] [JBoss Seam] - Re: @PersistenceContext in a SFSB created by a factory

pete.muir@jboss.org do-not-reply at jboss.com
Tue Aug 7 08:59:31 EDT 2007


"Newlukai" wrote : So I have to change the @Factory method to
  | upDownload = Component.getInstance("upDownload");
  | ? But, the component "upDownload" isn't yet instantiated, so Seam would look up for "upDownload" and since the @Name is missing on UpDownloadDatabase it would just find the @Factory in UpDownloadFactory. I'm sure I've accidentally ignored something but for me it looks like this would be a recursive call, isn't it?

Yes. Your desgin has flaws.

If all you want to do is switch out the implementation from components.xml then you can just.

<component name="upDownload" class="UpDownloadDatabase" />
  | <!--<component name="upDownload" class="UpDownloadFileSystem" />-->

and miss out the @Name annotations on the class.  You don't need your factory.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4071586#4071586

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4071586



More information about the jboss-user mailing list