7 Replies Latest reply on Feb 6, 2007 12:56 PM by alesj

    FYI: Latest ClassInfo changes.

      PackageInfo

      I've added support for retrieving package info for a class.
      This is mainly so you can get at the annotations.

      This doesn't work for javassist which doesn't provide package annotations.

      Enum Constants

      You can now retrieve the underlying real enum constant.
      Also, you can retrieve the annotations against the constants.

      BeanInfo property accessors

      I've fixed this new code to delegate to the PropertyInfo
      such that the PropertyInfo impl can decide how to get/set the property.

        • 1. Re: FYI: Latest ClassInfo changes.
          alesj

           

          "adrian@jboss.org" wrote:

          BeanInfo property accessors

          I've fixed this new code to delegate to the PropertyInfo
          such that the PropertyInfo impl can decide how to get/set the property.


          I've rewritten AttributeDispatchContext for AbstractKernelControllerContext to use this.

          What about with method / operation invocation (InvokeDispatchContext)?
          Will we be moving this to BeanInfo notion as well? Or is it already there?

          • 2. Re: FYI: Latest ClassInfo changes.
            alesj

             

            "alesj" wrote:

            What about with method / operation invocation (InvokeDispatchContext)?
            Will we be moving this to BeanInfo notion as well? Or is it already there?


            :-(
            Blind me. I don't know what I was looking at.
            Of course it's all there.

            So I've changed the invoke on AbstractKernelControllerContext.

            Should I change get/set invocation in Actions as well?
            Or slowly move all our pojo code to BeanInfo / PropertyInfo notion?

            • 3. Re: FYI: Latest ClassInfo changes.

               

              "alesj" wrote:

              Should I change get/set invocation in Actions as well?
              Or slowly move all our pojo code to BeanInfo / PropertyInfo notion?


              The BeanInfo stuff (deliberately) doesn't understand the Property
              abstraction from the BeanMetaData so you still need an abstraction
              over the top of it to covert the property metadata to an Object.
              This is what is currently in the KernelConfigurator.

              Also in some places (like instantiation) there is the option to use
              a constructor or a factory. Only the constructor is supported by the BeanInfo.

              • 4. Re: FYI: Latest ClassInfo changes.
                alesj

                 

                "adrian@jboss.org" wrote:

                Only the constructor is supported by the BeanInfo.


                I had to loosen this - added 'boolean strict' to Config.getMethodJoinpoint - in order to support Scott's factory construction in JavaBean2.
                See AbstractBeanInfo.invoke.

                • 5. Re: FYI: Latest ClassInfo changes.

                  That doesn't look very good.

                  You don't want to invoke a static method on a bean by mistake.
                  I'd rather see it search for a static method only if the "bean" parameter is null.
                  But then these methods should really be throwing an exception if you pass a null bean.

                  If you really want to invoke a static method, you should be using
                  beanInfo.getClassInfo() since you are no longer in the bean abstraction.

                  • 6. Re: FYI: Latest ClassInfo changes.

                    I don't see a problem with having a seperate invokeStatic() that does the plumbing for you
                    to make things easy.

                    • 7. Re: FYI: Latest ClassInfo changes.
                      alesj

                      Ok, I'll add the static notion to BeanInfo.
                      Should I remove the loose modifier strictness in Config method lookup?