1 2 Previous Next 24 Replies Latest reply on Feb 25, 2008 12:21 PM by anil.saldhana Go to original post
      • 15. Re: ServiceMetaData has the most recent dependencies/attribu
        starksm64

         

        "adrian@jboss.org" wrote:

        The "depends optional attribute" only exists in the xml, it doesn't exist
        in the ServiceMetaData model, so it's not the same as the examples I listed
        for the POJO stuff.

        Its equivalent to creating an attribute with a ServiceDependencyValueMetaData as its value.
         ServiceAttributeMetaData attr = new ServiceAttributeMetaData();
         attr.setName("TransactionManagerFactory");
         ServiceDependencyValueMetaData dependencyValue = new ServiceDependencyValueMetaData();
         dependencyValue.setDependency(getTransactionManagerServiceName());
         dependencyValue.setProxyType("attribute");
         attr.setValue(dependencyValue);
        



        • 16. Re: ServiceMetaData has the most recent dependencies/attribu

           

          "scott.stark@jboss.org" wrote:

          Its equivalent to creating an attribute with a ServiceDependencyValueMetaData as its value.


          Yes, but my point is we don't modify (normalise) the metadata after the user creates it
          in the ServiceMetaData. The user has to know that a depends optional attribute
          is really two different pieces of metadata programmatically.

          Anyway, this is an issue brought up by Ales that is unrelated to the actual topic. ;-)

          • 17. Re: ServiceMetaData has the most recent dependencies/attribu
            alesj

             

            "adrian@jboss.org" wrote:
            Anyway, this is an issue brought up by Ales that is unrelated to the actual topic. ;-)

            Eh, I always like to bother people when they want to change metadata, related or unrelated. :-)

            • 18. Re: ServiceMetaData has the most recent dependencies/attribu
              anil.saldhana

               

              "alesj" wrote:
              "adrian@jboss.org" wrote:
              Anyway, this is an issue brought up by Ales that is unrelated to the actual topic. ;-)

              Eh, I always like to bother people when they want to change metadata, related or unrelated. :-)


              The apostle from Slovania makes a point. ;)

              • 19. Re: ServiceMetaData has the most recent dependencies/attribu
                alesj

                 

                "anil.saldhana@jboss.com" wrote:

                The apostle from Slovania makes a point. ;)

                Read my location more precisely and do a copy/paste, since your geography sucks. ;-)

                • 20. Re: ServiceMetaData has the most recent dependencies/attribu
                  dimitris

                   

                  "alesj" wrote:
                  "anil.saldhana@jboss.com" wrote:

                  The apostle from Slovania makes a point. ;)

                  Read my location more precisely and do a copy/paste, since your geography sucks. ;-)

                  "Solvenia" maybe ;-)

                  • 21. Re: ServiceMetaData has the most recent dependencies/attribu
                    anil.saldhana

                    I have

                    public class EarJaccPolicy extends JaccPolicy<JBossAppMetaData>
                    {
                     public EarJaccPolicy(String id)
                     {
                     super(id);
                     }
                    
                    
                     public EarJaccPolicy(String id, JBossAppMetaData metaData, Boolean standaloneDeployment)
                     {
                     super(id, metaData, standaloneDeployment);
                     }
                    }
                    


                    When there is an ear with ejb3 deployment, the ServiceCreator (internally the MBeanServer) is choking with:
                    Caused by: java.lang.NoSuchMethodException: org.jboss.deployment.security.EarJaccPolicy.<init>(java.lang.String, org.jboss.metadata.ear.jboss.JBoss50AppMetaData, java.lan
                    g.Boolean)
                     at java.lang.Class.getConstructor0(Class.java:2647)
                     at java.lang.Class.getConstructor(Class.java:1629)
                     at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:1241)
                     at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:286)
                     at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:344)
                     at org.jboss.system.ServiceCreator.installPlainMBean(ServiceCreator.java:197)
                     at org.jboss.system.ServiceCreator.install(ServiceCreator.java:115)
                     ... 84 more
                    


                    The ServiceConstructorMetaData is as follows:
                    ServiceConstructorMetaData serviceConstructor = new ServiceConstructorMetaData();
                     serviceConstructor.setSignature(new String[] { String.class.getName(),
                     metaData.getClass().getName(),Boolean.class.getName()});
                     serviceConstructor.setParameters(new Object[] {contextId,deployment, Boolean.TRUE});
                     createJaccPolicyBean(serviceConstructor, unit);
                    
                    where metadata is JBossAppMetaData instance. (I Think this is where I need to ensure that JBossAppMetaData is passed)
                    


                    A fix is to add a ctr with JBoss50AppMetaData to EarJaccPolicy. But it seems too much to add ctrs with JBoss60AppMetaData, JBoss70AppMetaData..... It probably is simple reflection semantics.

                    I think the fix is in the ServiceConstructorMetaData......

                    UPDATE:
                    I just change the ctr signature in ServiceConstructorMetaData to use JBossAppMetaData. That should fix the issue.

                    • 22. Re: ServiceMetaData has the most recent dependencies/attribu
                      starksm64

                      The problem is the use of metaData.getClass().getName() as this returns the implementation class. You need to use JBossAppMetaData.class.getName() since that is the signature. Its the metaData instance that has to be an implementation of this. The ctor parameters also look incorrect that it should be metaData rather than deployment:

                      ServiceConstructorMetaData serviceConstructor = new ServiceConstructorMetaData();
                       serviceConstructor.setSignature(new String[] { String.class.getName(),
                       JBossAppMetaData.class.getName(),Boolean.class.getName()});
                       serviceConstructor.setParameters(new Object[] {contextId, metaData, Boolean.TRUE});
                       createJaccPolicyBean(serviceConstructor, unit);
                      



                      • 23. Re: ServiceMetaData has the most recent dependencies/attribu
                        anil.saldhana

                         

                        "scott.stark@jboss.org" wrote:
                        The problem is the use of metaData.getClass().getName() as this returns the implementation class. You need to use JBossAppMetaData.class.getName() since that is the signature. Its the metaData instance that has to be an implementation of this. The ctor parameters also look incorrect that it should be metaData rather than deployment:

                        ServiceConstructorMetaData serviceConstructor = new ServiceConstructorMetaData();
                         serviceConstructor.setSignature(new String[] { String.class.getName(),
                         JBossAppMetaData.class.getName(),Boolean.class.getName()});
                         serviceConstructor.setParameters(new Object[] {contextId, metaData, Boolean.TRUE});
                         createJaccPolicyBean(serviceConstructor, unit);
                        



                        That is the change I am doing now. Rather than the use of metaData.getClass().getName(), I am doing getMetaDataClassType() which is an overridden method in the sub-deployers (EarSecurityDeployer will pass JBossAppMetaData as the meta data class type).

                        • 24. Re: ServiceMetaData has the most recent dependencies/attribu
                          anil.saldhana

                          Since I have checked in the split security deployers based on metadata last week, I request for a review of them. If you have any feedback, complaints please raise them - so that I can complete them for CR1.

                          UPDATE: Folks in Slovenia feel the above is a demand rather than a request. I am requesting a voluntary review of my code.

                          1 2 Previous Next