// Path: core/src/main/java/com/ning/jetty/core/modules/ServerModule.java
// public class ServerModule extends ServletModule
// {
//     protected Multibinder<HealthCheck> healthChecksBinder;
// 
//     @Override
//     public void configureServlets()
//     {
//         installJackson();
//         installJMX();
//         installStats();
//     }
// 
//     protected void installJackson()
//     {
//         final ObjectMapper mapper = getJacksonProvider().get();
// 
//         bind(ObjectMapper.class).toInstance(mapper);
//         bind(JacksonJsonProvider.class)
//                 .toInstance(new JacksonJsonProvider(mapper, new Annotations[]{Annotations.JACKSON, Annotations.JAXB}));
//     }
// 
//     /**
//      * Override this method to provide your own Jackson provider.
//      *
//      * @return ObjectMapper provider for Jackson
//      */
//     protected Provider<ObjectMapper> getJacksonProvider()
//     {
//         return new Provider<ObjectMapper>()
//         {
//             @Override
//             public ObjectMapper get()
//             {
//                 final ObjectMapper mapper = new ObjectMapper();
//                 mapper.registerModule(new JodaModule());
//                 mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
//                 return mapper;
//             }
//         };
//     }
// 
//     protected void installJMX()
//     {
//         final MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
//         binder().bind(MBeanServer.class).toInstance(mBeanServer);
// 
//         install(new MBeanModule());
//     }
// 
//     protected void installStats()
//     {
//         // Codahale's metrics
//         install(new InstrumentationModule());
// 
//         // Healthchecks
//         healthChecksBinder = Multibinder.newSetBinder(binder(), HealthCheck.class);
//         install(new AdminServletModule("/1.0/healthcheck", "/1.0/metrics", "/1.0/ping", "/1.0/threads"));
// 
//         // Metrics/Jersey integration
//         install(new TimedResourceModule());
//     }
// }


import java.util.Map;
import com.ning.jetty.core.modules.ServerModule;
import com.google.common.collect.Maps;
import com.google.inject.Module;
import com.yammer.metrics.core.HealthCheck;
import org.skife.config.ConfigSource;
import org.skife.config.SimplePropertyConfigSource;
import javax.servlet.Filter;
import javax.servlet.http.HttpServlet;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

    public ServerModuleBuilder addServlet(final String urlPattern, final Class<? extends HttpServlet> filterKey)
    {
        this.servlets.put(urlPattern, filterKey);
        return this;
    }

    public ServerModuleBuilder addServletRegex(final String urlPattern, final Class<? extends HttpServlet> filterKey)
    {
        this.servletsRegex.put(urlPattern, filterKey);
        return this;
    }

    public ServerModuleBuilder addJerseyServlet(final String urlPattern, final Class<? extends HttpServlet> filterKey)
    {
        this.jaxRSServlets.put(urlPattern, filterKey);
        return this;
    }

    public ServerModuleBuilder addJerseyServletRegex(final String urlPattern, final Class<? extends HttpServlet> filterKey)
    {
        this.jaxRSServletsRegex.put(urlPattern, filterKey);
        return this;
    }

    public void setJaxRSImplementation(final JaxRSImplementation jaxRSImplementation)
    {
        this.jaxRSImplementation = jaxRSImplementation;
    }

// Path: core/src/main/java/com/ning/jetty/core/modules/ServerModule.java
// public class ServerModule extends ServletModule
// {
//     protected Multibinder<HealthCheck> healthChecksBinder;
// 
//     @Override
//     public void configureServlets()
//     {
//         installJackson();
//         installJMX();
//         installStats();
//     }
// 
//     protected void installJackson()
//     {
//         final ObjectMapper mapper = getJacksonProvider().get();
// 
//         bind(ObjectMapper.class).toInstance(mapper);
//         bind(JacksonJsonProvider.class)
//                 .toInstance(new JacksonJsonProvider(mapper, new Annotations[]{Annotations.JACKSON, Annotations.JAXB}));
//     }
// 
//     /**
//      * Override this method to provide your own Jackson provider.
//      *
//      * @return ObjectMapper provider for Jackson
//      */
//     protected Provider<ObjectMapper> getJacksonProvider()
//     {
//         return new Provider<ObjectMapper>()
//         {
//             @Override
//             public ObjectMapper get()
//             {
//                 final ObjectMapper mapper = new ObjectMapper();
//                 mapper.registerModule(new JodaModule());
//                 mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
//                 return mapper;
//             }
//         };
//     }
// 
//     protected void installJMX()
//     {
//         final MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
//         binder().bind(MBeanServer.class).toInstance(mBeanServer);
// 
//         install(new MBeanModule());
//     }
// 
//     protected void installStats()
//     {
//         // Codahale's metrics
//         install(new InstrumentationModule());
// 
//         // Healthchecks
//         healthChecksBinder = Multibinder.newSetBinder(binder(), HealthCheck.class);
//         install(new AdminServletModule("/1.0/healthcheck", "/1.0/metrics", "/1.0/ping", "/1.0/threads"));
// 
//         // Metrics/Jersey integration
//         install(new TimedResourceModule());
//     }
// }


// Path: base/src/main/java/com/ning/jetty/base/modules/ServerModuleBuilder.java
import java.util.Map;
import com.ning.jetty.core.modules.ServerModule;
import com.google.common.collect.Maps;
import com.google.inject.Module;
import com.yammer.metrics.core.HealthCheck;
import org.skife.config.ConfigSource;
import org.skife.config.SimplePropertyConfigSource;
import javax.servlet.Filter;
import javax.servlet.http.HttpServlet;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;


    public ServerModuleBuilder addServlet(final String urlPattern, final Class<? extends HttpServlet> filterKey)
    {
        this.servlets.put(urlPattern, filterKey);
        return this;
    }

    public ServerModuleBuilder addServletRegex(final String urlPattern, final Class<? extends HttpServlet> filterKey)
    {
        this.servletsRegex.put(urlPattern, filterKey);
        return this;
    }

    public ServerModuleBuilder addJerseyServlet(final String urlPattern, final Class<? extends HttpServlet> filterKey)
    {
        this.jaxRSServlets.put(urlPattern, filterKey);
        return this;
    }

    public ServerModuleBuilder addJerseyServletRegex(final String urlPattern, final Class<? extends HttpServlet> filterKey)
    {
        this.jaxRSServletsRegex.put(urlPattern, filterKey);
        return this;
    }

    public void setJaxRSImplementation(final JaxRSImplementation jaxRSImplementation)
    {
        this.jaxRSImplementation = jaxRSImplementation;
    }

    public ServerModule build()