2 Replies Latest reply on Oct 5, 2007 11:42 AM by alesj

    MainDeployerImpl process managed deployment

    alesj

      Just something I noticed when looking how to get a hold of runtime component's name in true OO fashion. :-)

      Is this done on purpose - that we are skipping process on 2nd level context.
      Since we do do getChildren on top contexts, and then immediately getChildren on those child contexts:

       public ManagedDeployment getManagedDeployment(String name) throws DeploymentException
       {
       DeploymentContext context = getDeploymentContext(name);
       if (context == null)
       throw new IllegalArgumentException("Context not found: " + name);
      
       Map<String, ManagedObject> rootMOs = getManagedObjects(context);
       ManagedDeployment root = mgtDeploymentCreator.build(context.getDeploymentUnit(), rootMOs, null);
       for (DeploymentContext childContext : context.getChildren())
       {
       processManagedDeployment(childContext, root);
       }
       return root;
       }
      
       protected void processManagedDeployment(DeploymentContext context, ManagedDeployment parent)
       throws DeploymentException
       {
       for (DeploymentContext childContext : context.getChildren())
       {
       DeploymentUnit childUnit = childContext.getDeploymentUnit();
       Map<String, ManagedObject> childMOs = getManagedObjects(childContext);
       ManagedDeployment childMD = mgtDeploymentCreator.build(childUnit, childMOs, parent);
       processManagedDeployment(childContext, childMD);
       }
       }
      


      There is no lookup on processManagedDeployment context param.

        • 1. Re: MainDeployerImpl process managed deployment

          Looks like a bug to me.

          There's no tests for anything but the root ManagedObjects in deployers-impl

          • 2. Re: MainDeployerImpl process managed deployment
            alesj

             

            "adrian@jboss.org" wrote:
            Looks like a bug to me.

            I guess this is what we want:
             protected void processManagedDeployment(DeploymentContext context, ManagedDeployment parent)
             throws DeploymentException
             {
             DeploymentUnit unit = context.getDeploymentUnit();
             Map<String, ManagedObject> MOs = getManagedObjects(context);
             ManagedDeployment md = mgtDeploymentCreator.build(unit, MOs, parent);
             for (DeploymentContext childContext : context.getChildren())
             {
             processManagedDeployment(childContext, md);
             }
             }
            


            I'll add some tests for deeper-than-root ManagedObjects.