1 2 Previous Next 15 Replies Latest reply on Sep 16, 2009 4:23 AM by swd847 Go to original post
      • 15. Re: Component Inheritance
        swd847

        As far as I know this is what is going to happen:


        Request comes in for a widget object.
        Factory method called, factory method create an application scoped widget
        Outjection performed, outjection created a conversation scoped widget


        After the conversation end you will be stuck with the conversation scoped widget. (This is what I think is going to happen, outjection and @Factory perform similar tasks so you are not really meant to use both together).


        Also you have thread safety issues with the outjection in your current design, the WidgetFactory can be accessed by multiple  threads and the wrong value will get outjected.


        I think you should remove the @Out, and use


         @Factory(value="widget",scope=CONVERSATION)
        



        Also use Component.getInstance() instead of what you are currently (incorrectly) doing with valueExpressions (if you were going to use value expressions properly you need to call getValue on the resulting expression).

        1 2 Previous Next