7 Replies Latest reply on Oct 27, 2006 9:57 AM by alesj

    JBMICROCONT-23, support for lifecycle annotations

    alesj

      http://jira.jboss.com/jira/browse/JBMICROCONT-23


      Waiting for annotation overrides before the annotation style is supported.


      Are we there yet - with annotation overrides?

        • 1. Re: JBMICROCONT-23, support for lifecycle annotations
          alesj

          Where to put these annotations?

          @CreateLifeCycle
          @StartLifeCycle
          @StopLifeCycle
          @DestroyLifeCycle
          


          We should probably have a MC user/developers classes (as these) as a seperate jar.

          • 2. Re: JBMICROCONT-23, support for lifecycle annotations
            starksm64

            This should go into the org.jboss.beans.metadata.spi package as its part of the spi. We really need to refactor the mc project into finer grained jars with spi jars broken. Things like the vfs classes should be separated out as well in the container project. We need to mavenize the project as well so that would be a good time to do this.

            • 3. Re: JBMICROCONT-23, support for lifecycle annotations
              alesj

              How to add lifecycle method's parameters support through annotations?
              I can probably write something for @Inject annotation on the method's parameter.

              Should my annotation lookup go over BeanInfo -> MethodInfo, or MetaDataContext.
              Or it doesn't matter - since this should be the same after DescribeAction?

              • 4. Re: JBMICROCONT-23, support for lifecycle annotations
                starksm64

                I'm not sure as I have not coded too much in this layer. Just wing it and when Adrian get's back toward the end of the week he can synch up.

                • 5. Re: JBMICROCONT-23, support for lifecycle annotations
                  alesj

                  >> Just wing it
                  Wing it?

                  I added annotation lifecycle support.
                  But I have problems since my annotations don't get picked up by container module.

                   Set<MethodInfo> methods = beanInfo.getMethods();
                   if (methods != null)
                   {
                   for (MethodInfo mi : methods)
                   {
                   if (mi.isAnnotationPresent(getUninstallAnnotation()))
                   {
                   return mi.getName();
                   }
                   }
                   }
                  

                  Results in no lifecycle annotation found.

                  How is with actual lifecycle annotation class usage in annotation lookup - or should I use a straight String?
                   public String getInstallAnnotation()
                   {
                   return CreateLifecycle.class.getName();
                   }
                  


                  Lifecycle annotations have C in cycle in lower case - as all other lifecycle classes - not as in JIRA issue.

                  And what's the status of JBossXB, since I get a lot of ClassCastExc while testing - saying my metadata is of illegal class.

                  • 6. Re: JBMICROCONT-23, support for lifecycle annotations
                    starksm64

                    Wing it = just try it: http://www.urbandictionary.com/define.php?term=wing+it

                    Check the code in along with the testcase you are working on so I can see. The only xml problem I'm seeing is for the legacy 1.0 schema. The 2.0 schema is working ok. If you have a case that is not post it in the jbossxb forum.

                    • 7. Re: JBMICROCONT-23, support for lifecycle annotations
                      alesj

                       

                      "alesj" wrote:

                      I added annotation lifecycle support.
                      But I have problems since my annotations don't get picked up by container module.


                      Uf. My bad.
                      Totally forgot about @Retention and @Target.