Class EverrestGuiceContextListener.DefaultListener

  • All Implemented Interfaces:
    EventListener, javax.servlet.ServletContextListener
    Enclosing class:
    EverrestGuiceContextListener

    public static class EverrestGuiceContextListener.DefaultListener
    extends EverrestGuiceContextListener
    Default EverrestGuiceContextListener implementation. It gets application's FQN from context-param javax.ws.rs.Application and instantiate it. If such parameter is not specified then scan (if scanning is enabled) web application's folders WEB-INF/classes and WEB-INF/lib for classes which contains JAX-RS annotations. Interesting for three annotations Path, Provider and Filter. Scanning of JAX-RS components is managed by contex-param org.everrest.scan.components. This parameter must be true to enable scanning.
    • Constructor Detail

      • DefaultListener

        public DefaultListener()
    • Method Detail

      • getModules

        protected List<com.google.inject.Module> getModules()
        Description copied from class: EverrestGuiceContextListener
        Implementation can provide set of own Module for JAX-RS components.

         protected List<Module> getModules()
         {
            List<Module> modules = new ArrayList<Module>(1);
            modules.add(new Module()
            {
               public void configure(Binder binder)
               {
                  binder.bind(MyResource.class);
                  binder.bind(MyProvider.class);
               }
            });
            return modules;
         }
         
        Specified by:
        getModules in class EverrestGuiceContextListener
        Returns:
        JAX-RS modules