6 Replies Latest reply on Jun 15, 2009 6:06 PM by pmuir

    Newer release of extension package

    genman

      Looks like the extensions (in svn webbeans/extensions/trunk) doesn't compile against the latest Web Beans version.


      Is there plans to update this or were these moved to a different repository?

        • 1. Re: Newer release of extension package
          genman

          Specifically the SE package, also the Wicket package where the BeanManager interface changed.

          • 2. Re: Newer release of extension package
            pmuir

            They will be updated, but as you can see, there is a lot of work to do across the whole code base.


            Putting a patch in JIRA will speed it up :-)

            • 3. Re: Newer release of extension package
              genman

              Yeah, was going to give it a shot, but looks like the RI trunk code is messed up at the moment. Well, I'll see what I can do when trunk stabilizes.


              I do have a question, what should one do instead of call the old Manager.getInstanceByType() ? Looks like this is the equivalent:


                     Set<Bean<?>> beans = manager.getBeans(Foo.class);
                      foo = (Foo) manager.getReference(beans.iterator().next(), Foo.class);
              



              Not quite as elegant as the getInstanceByType method... Still, it's an SPI method so I understand why it's not as friendly. But for unit testing, I'm wondering if there is a suggested approach that would work well for getting references to managed Web Beans.

              • 4. Re: Newer release of extension package
                wschwendt

                Elias Ross wrote on Jun 13, 2009 00:55:

                I do have a question, what should one do instead of call the old Manager.getInstanceByType() ?


                Thanks for raising this issue. I have exactly the same question.


                The Javadocs for org.jboss.webbeans.BeanManagerImpl currently state only that getInstanceByType() is deprecated (SVN Rev. 2828), but I haven't found any explanation what we should call now instead. What is the recommended way to replace old calls of Manager.getInstanceByType()?.

                • 5. Re: Newer release of extension package
                  cpopetz

                  Wolfgang Schwendt wrote on Jun 13, 2009 21:14:



                  Elias Ross wrote on Jun 13, 2009 00:55:

                  I do have a question, what should one do instead of call the old Manager.getInstanceByType() ?


                  Thanks for raising this issue. I have exactly the same question.

                  The Javadocs for org.jboss.webbeans.BeanManagerImpl currently state only that getInstanceByType() is deprecated (SVN Rev. 2828), but I haven't found any explanation what we should call now instead. What is the recommended way to replace old calls of Manager.getInstanceByType()?.


                  manager.getReference(
                      manager.getBeans(beanType,bindings).iterator().next(),beanType);
                  


                  (Assuming you know you only have one bean of the given type, that is.)

                  • 6. Re: Newer release of extension package
                    pmuir

                    Elias Ross wrote on Jun 13, 2009 00:55:


                    But for unit testing, I'm wondering if there is a suggested approach that would work well for getting references to managed Web Beans.



                    For now, I would do as suggested in this thread. Eventually we will expose something similar to SeamTest that provides a convenience method like getInstanceByType() - the only reason we aren't exposing the existing test support classes is that we need to check over their API :-)