protected void inject(Object injectable) { if (injector == null) { injector = (JettyWeldInjector) sco.getAttribute(AbstractJettyContainer.INJECTOR_ATTRIBUTE_NAME); } if (injector == null) { JettyLogger.LOG.cantFindInjectior(injectable); } else { injector.inject(injectable); } }
protected void inject(Object injectable) { if (injector == null) { injector = (JettyWeldInjector) sco.getAttribute(AbstractJettyContainer.INJECTOR_ATTRIBUTE_NAME); } if (injector == null) { JettyLogger.LOG.cantFindInjector(injectable); } else { injector.inject(injectable); } }
private int parseVersion(String version) { try { return Integer.parseInt(version); } catch (NumberFormatException e) { JettyLogger.LOG.debugv("Unable to parse version string: {0}", version); return -1; } }
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())); JettyLogger.LOG.gwtHostedModeDetected(); Class<?> decoratorClass = getWeldServletHandlerClass(); Method processMethod = decoratorClass.getMethod("process", ServletContext.class); processMethod.invoke(null, context.getServletContext()); } catch (Exception e) { JettyLogger.LOG.unableToCreateJettyWeldInjector(e); } } }
@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) throws Exception { WebAppContext wac = (WebAppContext) WebAppContext.getCurrentWebAppContext(); if (wac == null) { wac = findWAC(context); } if (wac != null) { process(wac, true); } else { JettyLogger.LOG.cantFindWebApplicationContext(); } }
public static void process(ServletContext context) throws Exception { WebAppContext wac = WebAppContext.getCurrentWebAppContext(); if (wac == null) { wac = findWAC(context); } if (wac != null) { process(wac, true); } else { JettyLogger.LOG.cantFindMatchingWebApplicationContext(); } }
protected static void process(WebAppContext wac, boolean startNewHandler) throws Exception { EclipseWeldServletHandler wHandler = new EclipseWeldServletHandler(wac.getServletHandler(), wac.getServletContext()); wac.setServletHandler(wHandler); wac.getSecurityHandler().setHandler(wHandler); if (startNewHandler) { wHandler.start(); } Resource jettyEnv = null; Resource webInf = wac.getWebInf(); if (webInf != null && webInf.exists()) { jettyEnv = webInf.addPath("jetty-env.xml"); } if (jettyEnv == null || !(jettyEnv.exists())) { JettyLogger.LOG.missingJettyEnvXml(); } }
protected static void process(WebAppContext wac, boolean startNewHandler) throws Exception { MortbayWeldServletHandler wHanlder = new MortbayWeldServletHandler(wac.getServletHandler(), wac.getServletContext()); wac.setServletHandler(wHanlder); wac.getSecurityHandler().setHandler(wHanlder); if (startNewHandler) { wHanlder.start(); } Resource jettyEnv = null; Resource webInf = wac.getWebInf(); if (webInf != null && webInf.exists()) { jettyEnv = webInf.addPath("jetty-env.xml"); } if (jettyEnv == null || !(jettyEnv.exists())) { JettyLogger.LOG.missingJettyEnv(); } }
@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 void initialize(ContainerContext context) { // Try pushing a Jetty Injector into the servlet context try { context.getServletContext().setAttribute(INJECTOR_ATTRIBUTE_NAME, new JettyWeldInjector(context.getManager())); JettyLogger.LOG.gwtHostedModeDetected(); Class<?> decoratorClass = getWeldServletHandlerClass(); Method processMethod = decoratorClass.getMethod("process", ServletContext.class); processMethod.invoke(null, context.getServletContext()); } catch (Exception e) { JettyLogger.LOG.unableToCreateJettyWeldInjector(e); } } }
public static void process(ServletContext context) throws Exception { WebAppContext wac = (WebAppContext) WebAppContext.getCurrentWebAppContext(); if (wac == null) { wac = findWAC(context); } if (wac != null) { process(wac, true); } else { JettyLogger.LOG.cantFindWebApplicationContext(); } }
public static void process(ServletContext context) throws Exception { WebAppContext wac = WebAppContext.getCurrentWebAppContext(); if (wac == null) { wac = findWAC(context); } if (wac != null) { process(wac, true); } else { JettyLogger.LOG.cantFindMatchingWebApplicationContext(); } }
protected static void process(WebAppContext wac, boolean startNewHandler) throws Exception { EclipseWeldServletHandler wHandler = new EclipseWeldServletHandler(wac.getServletHandler(), wac.getServletContext()); wac.setServletHandler(wHandler); wac.getSecurityHandler().setHandler(wHandler); if (startNewHandler) { wHandler.start(); } Resource jettyEnv = null; Resource webInf = wac.getWebInf(); if (webInf != null && webInf.exists()) { jettyEnv = webInf.addPath("jetty-env.xml"); } if (jettyEnv == null || !(jettyEnv.exists())) { JettyLogger.LOG.missingJettyEnvXml(); } }
protected static void process(WebAppContext wac, boolean startNewHandler) throws Exception { MortbayWeldServletHandler wHanlder = new MortbayWeldServletHandler(wac.getServletHandler(), wac.getServletContext()); wac.setServletHandler(wHanlder); wac.getSecurityHandler().setHandler(wHanlder); if (startNewHandler) { wHanlder.start(); } Resource jettyEnv = null; Resource webInf = wac.getWebInf(); if (webInf != null && webInf.exists()) { jettyEnv = webInf.addPath("jetty-env.xml"); } if (jettyEnv == null || !(jettyEnv.exists())) { JettyLogger.LOG.missingJettyEnv(); } }
@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 void initialize(ContainerContext context) { // Try pushing a Jetty Injector into the servlet context try { context.getServletContext().setAttribute(INJECTOR_ATTRIBUTE_NAME, new JettyWeldInjector(context.getManager())); JettyLogger.LOG.gwtHostedModeDetected(); Class<?> decoratorClass = getWeldServletHandlerClass(); Method processMethod = decoratorClass.getMethod("process", ServletContext.class); processMethod.invoke(null, context.getServletContext()); } catch (Exception e) { JettyLogger.LOG.unableToCreateJettyWeldInjector(e); } } }
private int parseVersion(String version) { try { return Integer.parseInt(version); } catch (NumberFormatException e) { JettyLogger.LOG.debugv("Unable to parse version string: {0}", version); return -1; } }
public static void process(ServletContext context) throws Exception { WebAppContext wac = (WebAppContext) WebAppContext.getCurrentWebAppContext(); if (wac == null) { wac = findWAC(context); } if (wac != null) { process(wac, true); } else { JettyLogger.LOG.cantFindWebApplicationContext(); } }
public static void process(ServletContext context) throws Exception { WebAppContext wac = WebAppContext.getCurrentWebAppContext(); if (wac == null) { wac = findWAC(context); } if (wac != null) { process(wac, true); } else { JettyLogger.LOG.cantFindMatchingWebApplicationContext(); } }