public <T> T decorate(T o) { getInjector().inject(o); return o; }
public static void process(ServletContext context) { if (context instanceof ContextHandler.Context) { ContextHandler.Context cc = (ContextHandler.Context) context; ContextHandler handler = cc.getContextHandler(); if (handler instanceof ServletContextHandler) { ServletContextHandler sch = (ServletContextHandler) handler; DecoratedObjectFactory decObjFact = sch.getObjectFactory(); decObjFact.addDecorator(new WeldDecorator(context)); } } }
@Override public void initialize(ContainerContext context) { // Try pushing a Jetty Injector into the servlet context try { context.getServletContext().setAttribute(INJECTOR_ATTRIBUTE_NAME, new JettyWeldInjector(context.getManager())); WeldDecorator.process(context.getServletContext()); if(Boolean.TRUE.equals(context.getServletContext().getAttribute(EnhancedListener.ENHANCED_LISTENER_USED_ATTRIBUTE_NAME))) { // ServletContainerInitializer works on versions prior to 9.1.1 but the listener injection doesn't JettyLogger.LOG.jettyDetectedListenersInjectionIsSupported(); } else { JettyLogger.LOG.jettyDetectedListenersInjectionIsNotSupported(); } } catch (Exception e) { JettyLogger.LOG.unableToCreateJettyWeldInjector(e); } }
public static void process(ServletContext context) { if (context instanceof ContextHandler.Context) { ContextHandler.Context cc = (ContextHandler.Context) context; ContextHandler handler = cc.getContextHandler(); if (handler instanceof ServletContextHandler) { ServletContextHandler sch = (ServletContextHandler) handler; DecoratedObjectFactory decObjFact = sch.getObjectFactory(); decObjFact.addDecorator(new WeldDecorator(context)); } } }
@Override public void initialize(ContainerContext context) { // Try pushing a Jetty Injector into the servlet context try { context.getServletContext().setAttribute(INJECTOR_ATTRIBUTE_NAME, new JettyWeldInjector(context.getManager())); WeldDecorator.process(context.getServletContext()); if(Boolean.TRUE.equals(context.getServletContext().getAttribute(EnhancedListener.ENHANCED_LISTENER_USED_ATTRIBUTE_NAME))) { // ServletContainerInitializer works on versions prior to 9.1.1 but the listener injection doesn't JettyLogger.LOG.jettyDetectedListenersInjectionIsSupported(); } else { JettyLogger.LOG.jettyDetectedListenersInjectionIsNotSupported(); } } catch (Exception e) { JettyLogger.LOG.unableToCreateJettyWeldInjector(e); } }
public <T> T decorate(T o) { getInjector().inject(o); return o; }
public static void process(ServletContext context) { if (context instanceof ContextHandler.Context) { ContextHandler.Context cc = (ContextHandler.Context) context; ContextHandler handler = cc.getContextHandler(); if (handler instanceof ServletContextHandler) { ServletContextHandler sch = (ServletContextHandler) handler; DecoratedObjectFactory decObjFact = sch.getObjectFactory(); decObjFact.addDecorator(new WeldDecorator(context)); } } }
@Override public void initialize(ContainerContext context) { // Try pushing a Jetty Injector into the servlet context try { context.getServletContext().setAttribute(INJECTOR_ATTRIBUTE_NAME, new JettyWeldInjector(context.getManager())); WeldDecorator.process(context.getServletContext()); if(Boolean.TRUE.equals(context.getServletContext().getAttribute(EnhancedListener.ENHANCED_LISTENER_USED_ATTRIBUTE_NAME))) { // ServletContainerInitializer works on versions prior to 9.1.1 but the listener injection doesn't JettyLogger.LOG.jettyDetectedListenersInjectionIsSupported(); } else { JettyLogger.LOG.jettyDetectedListenersInjectionIsNotSupported(); } } catch (Exception e) { JettyLogger.LOG.unableToCreateJettyWeldInjector(e); } }
public <T> T decorate(T o) { getInjector().inject(o); return o; }
public void destroy(Object o) { getInjector().destroy(o); }
public void destroy(Object o) { getInjector().destroy(o); }
public void destroy(Object o) { getInjector().destroy(o); }