use of com.peterphi.std.guice.web.rest.setup.WebappGuiceRole in project stdlib by petergeneric.
the class ResteasyDispatcher method init.
@Override
public void init(ServletConfig config) throws ServletException {
super.init(config);
GuiceBuilder builder = new GuiceBuilder().withRole(new WebappGuiceRole(config));
this.registry = new GuiceRegistry(builder);
dispatcher = new GuicedResteasy(registry, config, new ServletBootstrap(config), true);
startInitialise();
}
use of com.peterphi.std.guice.web.rest.setup.WebappGuiceRole in project stdlib by petergeneric.
the class GuiceServlet method service.
@Override
protected final void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
final HttpCallContext ctx = HttpCallContext.set(req, resp, getServletContext());
try {
// Share the call id to log4j
Tracing.start(ctx.getLogId(), ctx.isVerbose());
// If necessary set up Guice
if (!ready.get()) {
if (registry == null)
registry = new GuiceRegistry(new GuiceBuilder().withRole(new WebappGuiceRole(getServletConfig())));
registry.register(this, true);
}
// Make the call
doService(req, resp);
} finally {
HttpCallContext.clear();
Tracing.clear();
}
}
use of com.peterphi.std.guice.web.rest.setup.WebappGuiceRole in project stdlib by petergeneric.
the class ResteasyDispatcher method init.
@Override
public void init(FilterConfig config) throws ServletException {
GuiceBuilder builder = new GuiceBuilder().withRole(new WebappGuiceRole(config));
this.registry = new GuiceRegistry(builder);
dispatcher = new GuicedResteasy(registry, config, new FilterBootstrap(config), false);
startInitialise();
}
Aggregations