2 Replies Latest reply on Feb 2, 2010 10:53 AM by oberinspector

    Problems to trigger ZK Extension with glassfish

    oberinspector

      I started to integrate ZK richlet and Zk specific Scopes with Weld, but did not manage to get my extension class triggered from container lifecycle events as described in portable extension docs. I have a file named javax.enterprise.inject.spi.Extension in META-INF/services (and also in WEB-INF/services) in my webapplication. This file contains a single line with the full qualified name of my extension class net.empego.web.cdi.ZkContextExtension. My webapp has an empty beans.xml file in WEB-INF directory. I tested injection with a servlet and weld seems to work properly.


      I work with Netbeans 6.8 and glassfish v3.


      My extension class for first tests looks like:


      public class ZkContextExtension implements Extension {
      
          public void afterBeanDiscovery(@Observes AfterBeanDiscovery abd, BeanManager bm) {
              Logger log = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
              log.log(Level.INFO, "+++++++++++++++++++++++ afterBeanDiscovery");
      
              abd.addContext(new ZkDesktopContext());
              abd.addContext(new ZkExecutionContext());
          }
      
          void beforeBeanDiscovery(@Observes BeforeBeanDiscovery bbd) {
              Logger log = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
              log.log(Level.INFO, "++++++++++++++++++++++++++ beginning the scanning process");
          }
      
          <T> void processAnnotatedType(@Observes ProcessAnnotatedType<T> pat) {
              Logger log = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
              log.log(Level.INFO, "++++++++++++++++++++++++++++ scanning type: " + pat.getAnnotatedType().getJavaClass().getName());
          }
      }



      For ZK context and Scope code i started a thread in ZK forum: Integrate ZK with EE6 and Weld . ZK provides attribute maps for each scope where my context implementation relies on...


      What is missing to get the extension class invoked?