1 2 Previous Next 20 Replies Latest reply on Aug 6, 2008 9:28 AM by alesj Go to original post
      • 15. Re: Pushing correct aspect manager for a deployment

         

        "kabir.khan@jboss.com" wrote:
        .
        Another problem is that for scoped deployments I am changing the beans name to something unique and adding an alias annotation containing the bean name. This breaks with the new code in BeanMetaDataDeployer. I will post more on this once I have some more information about what exactly is going on...


        Why?

        You'll break all sorts of assumptions related to deployment components
        the metadata scopes, and reporting incomplete deployments if you do that wrong.

        It seems to me that you need to take a step backwards to the original problem
        and explain what you are really trying to solve, rather than try to figure out
        what has broken because you are hacking at things you shouldn't. :-)

        • 16. Re: Pushing correct aspect manager for a deployment
          kabirkhan

           

          "adrian@jboss.org" wrote:
          "kabir.khan@jboss.com" wrote:
          .
          Another problem is that for scoped deployments I am changing the beans name to something unique and adding an alias annotation containing the bean name. This breaks with the new code in BeanMetaDataDeployer. I will post more on this once I have some more information about what exactly is going on...


          Why?

          You'll break all sorts of assumptions related to deployment components
          the metadata scopes, and reporting incomplete deployments if you do that wrong.

          It seems to me that you need to take a step backwards to the original problem
          and explain what you are really trying to solve, rather than try to figure out
          what has broken because you are hacking at things you shouldn't. :-)


          I spoke to Ales about this, it is (was) solving the problem mentioned here:
          http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4154037#4154037
          Basically in a scoped deployment I deploy the aop beans with a new unique name, and use an annotation to create the alias, and an annotation to deploy the bean into a scoped controller.



          • 17. Re: Pushing correct aspect manager for a deployment
            kabirkhan

             

            "kabir.khan@jboss.com" wrote:

            I spoke to Ales about this, it is (was) solving the problem mentioned here:
            http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4154037#4154037
            Basically in a scoped deployment I deploy the aop beans with a new unique name, and use an annotation to create the alias, and an annotation to deploy the bean into a scoped controller.

            Let's continue this part of the discussion on that thread

            • 18. Re: Pushing correct aspect manager for a deployment

               

              "kabir.khan@jboss.com" wrote:

              I spoke to Ales about this, it is (was) solving the problem mentioned here:
              http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4154037#4154037
              Basically in a scoped deployment I deploy the aop beans with a new unique name,
              and use an annotation to create the alias, and an annotation to deploy the bean into a scoped controller.


              So the issue is that you want to have aspects with the same name
              but in different "scopes".

              So you are using the ScopedController.

              There's no need to change the Bean's name if you are using a scoped controller.

              But the ScopedController is not integrated with the MDR.

              There is no way to have two MDR scopes with
              INSTANCE/BeanName
              which is the default instance scope identifier created by the DefaultScopeBuilder

              context here is a component deployment context so the name is the bean name.
               public ScopeKey getMutableComponentScope(DeploymentContext context)
               {
               if (context == null)
               throw new IllegalArgumentException("Null context");
              
               return new ScopeKey(CommonLevels.INSTANCE, context.getName());
               }
              



              • 19. Re: Pushing correct aspect manager for a deployment

                You are certainly trail blazing. :-)
                I didn't even think Ales had finished the ScoppedController?

                It doesn't have much coverage with nothing related to metadata

                $ cd ~/microcontainer/dependency/src/tests/org/jboss/test/dependency/controller/
                $ find . -iname *Scope* | grep -v svn | grep TestCase
                
                cd ~/microcontainer/kernel/src/tests/org/jboss/test/kernel/
                $ find . -iname *Scope* | grep -v svn | grep TestCase
                ./annotations/test/search/ScopeKeySearchTestCase.java
                ./dependency/test/ScopedDuplicateAliasAnnotationTestCase.java
                ./dependency/test/ScopedDuplicateAliasXMLTestCase.java
                ./dependency/test/ScopedDuplicateAliasTestCase.java
                ./deployment/xml/test/ScopeTestCase.java
                ./deployment/xml/test/ScopeJaxbTestCase.java
                


                There's nothing related to ScopedControllers in the deployment framework.

                • 20. Re: Pushing correct aspect manager for a deployment
                  alesj

                   

                  "adrian@jboss.org" wrote:

                  I didn't even think Ales had finished the ScoppedController?

                  It slowly getting better. :-)

                  The current scope usage can look like this (pretty much what Kabir is using):

                  Since we only have explicit access to root Controller,
                  all beans we pass to it must have unique name,
                  so when we do uninstall we get the right bean.

                  But alias can be duplicated name, but of course in different scope.
                  If you add alias to scoped bean via @Alias,
                  you then don't need to care about any previous beans with the same name,
                  since alias is applied after PreInstallAction,
                  which pushes the bean to the right scoped controller,
                  hence alias is applied on scoped controller.

                  With @Search you can also specify you injection scope,
                  e.g. only check current controller, not looking into parent.


                  1 2 Previous Next