2 Replies Latest reply on Sep 7, 2010 1:33 PM by o.bergner

    JBoss 6.0.0-SNAPSHOT: CDI decorator not being applied to SLSB

    o.bergner
      I have a business interface

      @DomainStateChanging
      public interface ItemDao extends GenericJpaDao<Item, Long> {...}

      annotated with a qualifier annotation

      @Qualifier
      @Target( { TYPE, METHOD, PARAMETER, FIELD })
      @Retention(RUNTIME)
      public @interface DomainStateChanging {}

      and implemented by an SLSB

      @DomainStateChanging
      @Stateless
      @Local(ItemDao.class)
      public class JpaItemDao extends AbstractJpaDao<Item, Long> implements ItemDao {...}

      Now, I would like to apply the decorator

      @Decorator
      public abstract class StateChangeEventPropagatingItemDaoDecorator implements
              ItemDao {

          @Inject
          @Delegate
          @DomainStateChanging
          private ItemDao delegate;

          ...
      }

      to this SLSB. All these classes reside in the same deployment unit, wrapped up in an ear. In this deployment unit's beans.xml, I enabled my decorator through

      <decorators>
      <class>com.acme.orderplacement.jee.item.persistence.internal.StateChangeEventPropagatingItemDaoDecorator</class>
      </decorators>

      However, my decorator is not applied to my SLSB, as verified by log output and extensive debugging. What am I doing wrong? I'm using one of the latest JBoss AS 6 snapshot builds that includes Weld 1.1.0 Beta1.

      Olaf