/** * Return the {@link WebAppContext} for the {@link Server}. * * @param server * The {@link Server}. * * @return The {@link WebAppContext} associated with the bigdata webapp. */ public static WebAppContext getWebApp(final Server server) { final WebAppContext wac = server .getChildHandlerByClass(WebAppContext.class); /* * Note: This assumes that this is the webapp for bigdata. If there are * multiple webapps then this assumption is no longer valid and things * will break. */ return wac; }
/** * Return the {@link WebAppContext} for the {@link Server}. * * @param server * The {@link Server}. * * @return The {@link WebAppContext} associated with the bigdata webapp. */ public static WebAppContext getWebApp(final Server server) { final WebAppContext wac = server .getChildHandlerByClass(WebAppContext.class); /* * Note: This assumes that this is the webapp for bigdata. If there are * multiple webapps then this assumption is no longer valid and things * will break. */ return wac; }
/** * @throws Exception */ public void finishConfigurationBeforeStart() throws Exception { HandlerCollection contexts = (HandlerCollection)server.getChildHandlerByClass(ContextHandlerCollection.class); if (contexts==null) contexts = (HandlerCollection)server.getChildHandlerByClass(HandlerCollection.class); for (int i=0; (this.contextHandlers != null) && (i < this.contextHandlers.length); i++) { contexts.addHandler(this.contextHandlers[i]); } }
private static void logStartupBanner(Server server) { Object banner = null; ContextHandler contextHandler = server.getChildHandlerByClass(ContextHandler.class); if (contextHandler != null) { Context context = contextHandler.getServletContext(); if (context != null) { banner = context.getAttribute("nexus-banner"); } } StringBuilder buf = new StringBuilder(); buf.append("\n-------------------------------------------------\n\n"); buf.append("Started ").append(banner instanceof String ? banner : "Nexus Repository Manager"); buf.append("\n\n-------------------------------------------------"); log.info(buf.toString()); } }
private static void logStartupBanner(Server server) { Object banner = null; ContextHandler contextHandler = server.getChildHandlerByClass(ContextHandler.class); if (contextHandler != null) { Context context = contextHandler.getServletContext(); if (context != null) { banner = context.getAttribute("nexus-banner"); } } StringBuilder buf = new StringBuilder(); buf.append("\n-------------------------------------------------\n\n"); buf.append("Started ").append(banner instanceof String ? banner : "Nexus Repository Manager"); buf.append("\n\n-------------------------------------------------"); log.info(buf.toString()); } }
private void enableSessionSupport(Server server, String connectorKey) throws Exception { ServletContextHandler context = server.getChildHandlerByClass(ServletContextHandler.class); if (context.getSessionHandler() == null) { SessionHandler sessionHandler = new SessionHandler(); if (context.isStarted()) { throw new IllegalStateException("Server has already been started. Cannot enabled sessionSupport on " + connectorKey); } else { context.setSessionHandler(sessionHandler); } } }
public void init() throws ServletException { ServletContext context = getServletContext(); ContextHandler.Context scontext = (ContextHandler.Context) context; Server _server = scontext.getContextHandler().getServer(); Handler handler = _server.getChildHandlerByClass(StatisticsHandler.class); if (handler != null) { _statsHandler = (StatisticsHandler) handler; } else { LOG.warn("Statistics Handler not installed!"); return; } _memoryBean = ManagementFactory.getMemoryMXBean(); _connectors = _server.getConnectors(); if (getInitParameter("restrictToLocalhost") != null) { _restrictToLocalhost = "true".equals(getInitParameter("restrictToLocalhost")); } }
public void init() throws ServletException { ServletContext context = getServletContext(); ContextHandler.Context scontext = (ContextHandler.Context) context; Server _server = scontext.getContextHandler().getServer(); Handler handler = _server.getChildHandlerByClass(StatisticsHandler.class); if (handler != null) { _statsHandler = (StatisticsHandler) handler; } else { LOG.warn("Statistics Handler not installed!"); return; } _memoryBean = ManagementFactory.getMemoryMXBean(); _connectors = _server.getConnectors(); if (getInitParameter("restrictToLocalhost") != null) { _restrictToLocalhost = "true".equals(getInitParameter("restrictToLocalhost")); } }
public void init() throws ServletException { ServletContext context = getServletContext(); ContextHandler.Context scontext = (ContextHandler.Context) context; Server _server = scontext.getContextHandler().getServer(); Handler handler = _server.getChildHandlerByClass(StatisticsHandler.class); if (handler != null) { _statsHandler = (StatisticsHandler) handler; } else { LOG.warn("Statistics Handler not installed!"); return; } _memoryBean = ManagementFactory.getMemoryMXBean(); _connectors = _server.getConnectors(); if (getInitParameter("restrictToLocalhost") != null) { _restrictToLocalhost = "true".equals(getInitParameter("restrictToLocalhost")); } }
/** * @see javax.servlet.GenericServlet#init() */ public void init() throws ServletException { ServletContext context = getServletContext(); ContextHandler.Context scontext = (ContextHandler.Context) context; Server _server = scontext.getContextHandler().getServer(); Handler handler = _server.getChildHandlerByClass(StatisticsHandler.class); if (handler != null) { _statsHandler = (StatisticsHandler) handler; } else { LOG.warn("Statistics Handler not installed!"); return; } _memoryBean = ManagementFactory.getMemoryMXBean(); _connectors = _server.getConnectors(); if (getInitParameter("restrictToLocalhost") != null) { _restrictToLocalhost = "true".equals(getInitParameter("restrictToLocalhost")); } }
/** * @see javax.servlet.GenericServlet#init() */ public void init() throws ServletException { ServletContext context = getServletContext(); ContextHandler.Context scontext = (ContextHandler.Context) context; Server _server = scontext.getContextHandler().getServer(); Handler handler = _server.getChildHandlerByClass(StatisticsHandler.class); if (handler != null) { _statsHandler = (StatisticsHandler) handler; } else { LOG.warn("Statistics Handler not installed!"); return; } _memoryBean = ManagementFactory.getMemoryMXBean(); _connectors = _server.getConnectors(); if (getInitParameter("restrictToLocalhost") != null) { _restrictToLocalhost = "true".equals(getInitParameter("restrictToLocalhost")); } }
@Override public void init() throws ServletException { ServletContext context = getServletContext(); ContextHandler.Context scontext = (ContextHandler.Context) context; Server _server = scontext.getContextHandler().getServer(); Handler handler = _server.getChildHandlerByClass(StatisticsHandler.class); if (handler != null) { _statsHandler = (StatisticsHandler) handler; } else { LOG.warn("Statistics Handler not installed!"); return; } _memoryBean = ManagementFactory.getMemoryMXBean(); _connectors = _server.getConnectors(); if (getInitParameter("restrictToLocalhost") != null) { _restrictToLocalhost = "true".equals(getInitParameter("restrictToLocalhost")); } }
/** * @see javax.servlet.GenericServlet#init() */ public void init() throws ServletException { ServletContext context = getServletContext(); ContextHandler.Context scontext = (ContextHandler.Context) context; Server _server = scontext.getContextHandler().getServer(); Handler handler = _server.getChildHandlerByClass(StatisticsHandler.class); if (handler != null) { _statsHandler = (StatisticsHandler) handler; } else { LOG.warn("Statistics Handler not installed!"); return; } _memoryBean = ManagementFactory.getMemoryMXBean(); _connectors = _server.getConnectors(); if (getInitParameter("restrictToLocalhost") != null) { _restrictToLocalhost = "true".equals(getInitParameter("restrictToLocalhost")); } }
/** * @see javax.servlet.GenericServlet#init() */ public void init() throws ServletException { ServletContext context = getServletContext(); ContextHandler.Context scontext = (ContextHandler.Context) context; Server _server = scontext.getContextHandler().getServer(); Handler handler = _server.getChildHandlerByClass(StatisticsHandler.class); if (handler != null) { _statsHandler = (StatisticsHandler) handler; } else { LOG.warn("Statistics Handler not installed!"); return; } _memoryBean = ManagementFactory.getMemoryMXBean(); _connectors = _server.getConnectors(); if (getInitParameter("restrictToLocalhost") != null) { _restrictToLocalhost = "true".equals(getInitParameter("restrictToLocalhost")); } }
requestLogHandler.setRequestLog(this.requestLog); contexts = (ContextHandlerCollection)super.getChildHandlerByClass(ContextHandlerCollection.class); if (contexts==null) HandlerCollection handlers = (HandlerCollection)super.getChildHandlerByClass(HandlerCollection.class); if (handlers==null)
return null; ContextHandler context = getChildHandlerByClass(ContextHandler.class);
return null; ContextHandler context = getChildHandlerByClass(ContextHandler.class);
return null; ContextHandler context = getChildHandlerByClass(ContextHandler.class);
return null; ContextHandler context = getChildHandlerByClass(ContextHandler.class);
return null; ContextHandler context = getChildHandlerByClass(ContextHandler.class);