package com.cerner.beadledom.resteasy;

import com.cerner.beadledom.core.BeadledomModule;
import com.cerner.beadledom.resteasy.exceptionmapping.FailureExceptionMapper;
import com.google.inject.AbstractModule;
import com.google.inject.Provides;
import javax.servlet.ServletContext;
import org.jboss.resteasy.plugins.guice.ext.RequestScopeModule;

/**
 * The core guice module for Beadledom on Resteasy.
 *
 * <p>This module installs {@link BeadledomModule} for pulling all of the beadledom components
 * together, as well as the Resteasy {@link RequestScopeModule}.
 *
 * <p>To use this module extend {@link ResteasyContextListener} and provide this module and any of
 * your own modules via the {@link ResteasyContextListener#getModules(ServletContext)} method.
 *
 * <p>Provides:
 * <ul>
 *     <li>{@link GzipContentEncodingFilter}</li>
 *     <li>{@link FailureExceptionMapper}</li>
 * </ul>
 *
 * @author John Leacox
 */
public class ResteasyModule extends AbstractModule {
  @Override
  protected void configure() {
    install(new BeadledomModule());
    install(new RequestScopeModule());

    bind(FailureExceptionMapper.class);
  }

  @Provides
  GzipContentEncodingFilter provideGzipContentEncodingFilter() {
    return new GzipContentEncodingFilter();
  }
}

@@ -237,16 +237,47 @@
 ovides;%0A
+import javax.inject.Singleton;%0A
 import j
@@ -368,16 +368,88 @@
 eModule;
+%0Aimport org.jboss.resteasy.plugins.interceptors.GZIPEncodingInterceptor;
 %0A%0A/**%0A *
@@ -1250,16 +1250,29 @@
 rovides%0A
+  @Singleton%0A
   GzipCo
@@ -1375,11 +1375,144 @@
 r();%0A  %7D
+%0A%0A  @Provides%0A  @Singleton%0A  GZIPEncodingInterceptor provideGzipEncodingInterceptor() %7B%0A    return new GZIPEncodingInterceptor();%0A  %7D
 %0A%7D%0A

Add back support for GZIP encoding with the Resteasy 3.1 upgrade (#73)