1 Reply Latest reply on Sep 1, 2008 1:01 PM by wolfc

    Ordering multiple life cycle callback methods

    aloubyansky

      The issue affects app clients, web and ejb. Right now, the ordering (if implemented) is done in each container. So, I was thinking why not add a helper method in the metadata project and re-use the algorithm in each container?

      E.g. a method could be added to org.jboss.metadata.javaee.spec.LifecycleCallbacksMetaData

      public List<Method> getOrderedCallbacks(Class<?> defaultClass)

      or whatever return type makes more sense.

        • 1. Re: Ordering multiple life cycle callback methods
          wolfc

          Take a look at org.jboss.ejb3.interceptors.registry.InterceptorRegistry.initialize and org.jboss.ejb3.interceptors.aop.LifecycleCallbacks.createLifecycleCallbackInterceptors.

          The first creates the sorted list of lifecycle callback interceptor classes, while the second creates the association with the appropriate (EJB3) interceptor instances, the bean instance and returns an array of AOP interceptors.

          I'm all in favour of refactoring this onto a generic JSR-250 component, but the functions above must be able to interface on top of it.