candlepin/candlepin — pull request #654 by jmrodri (2014-07-24 19:59:52+00:00)
Title: Init code refactor more like Candlepin.

Seperate Guice initialization into 2 classes:

GutterballModule - to put all of the application specific classes, this extends
AbstractModule.

GutterballServletModule - only binds webapp items like servlets and filters.
Removed the Configuration provider as the Guice code comment states you really
shouldn't be using getServletContext(). And getServletContext is only usable if
you extend GuiceServletContextListener (see note on that later).

EventReceiver - added logging

GutterballGuiceResteasyBootstrap - We need to copy a bunch of methods from
RestEasy because they are private in 2.x. In 3.0 they were made protected, so
this class mimics what 3.0 does. That way when we do eventually switch we can
remove this class and simply extend their provided listener. It initializes the
guice modules, stage, and binds the resources to the ResteasyProviderFactory in
processInjector.

GutterballContextListener - Was GutterballServletContextListener, but to be
consistent with Candlepin's CandlepinContextListener it was renamed. It also now
extends GutterballGuiceResteasyBootstrap. It sets up our injector,
servletcontext, and reads in the configuration. The Configuration is bound to
the injector to an instance instead of from the servlet context.

web.xml - is simplified and inline with what we do in Candlepin. We only include
a single GutterballContextListener. The rest is configured in code from the
Bootstrap class.