.getServletContext().getAttribute(NativeWebSocketConfiguration.class.getName()); for (String path : webSocketHandlers.keySet()) { WebSocketCreator webSocketCreator = WebSocketCreatorFactory.create(webSocketHandlers.get(path));
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()); } }
(_context != null?(File)_context.getAttribute("javax.servlet.context.tempdir"):null));
Object value = _scontext.getAttribute(name); checkManagedAttribute(name,value);
(_context != null?(File)_context.getAttribute("javax.servlet.context.tempdir"):null));
HttpClient httpClient = (HttpClient) context.getServletContext().getAttribute(HTTPCLIENT_ATTRIBUTE); if(httpClient == null)
Object value = _scontext.getAttribute(name); checkManagedAttribute(name,value);
.getServletContext().getAttribute(NativeWebSocketConfiguration.class.getName()); for (String path : webSocketHandlers.keySet()) { WebSocketCreator webSocketCreator = WebSocketCreatorFactory.create(webSocketHandlers.get(path));
Object value = _scontext.getAttribute(name); checkManagedAttribute(name,value);
(_context != null?(File)_context.getAttribute("javax.servlet.context.tempdir"):null)); setAttribute(__MULTIPART_INPUT_STREAM, _multiPartInputStream); setAttribute(__MULTIPART_CONTEXT, _context);
public void start(boolean withMonitoring) { server.setConnectors(new Connector[] { connector }); context.setContextPath("/"); context.setParentLoaderPriority(true); String containerProjectPath = buildContainerProjectPath(); String webXml = withMonitoring ? "web.xml" : "web-without-monitoring.xml"; String descriptor = containerProjectPath + "/src/main/webapp/WEB-INF/" + webXml; String resourceBase = containerProjectPath + "/src/main/webapp"; context.setDescriptor(descriptor); context.setResourceBase(resourceBase); server.setHandler(context); if (startDefaultServices) { context.setExtraClasspath(containerProjectPath + "/src/main/resources/"); } try { server.start(); webApplicationContext = (WebApplicationContext) context.getServletContext() .getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE); if (webApplicationContext instanceof ConfigurableApplicationContext) { ((ConfigurableApplicationContext) webApplicationContext).registerShutdownHook(); } } catch (final Exception e) { logger.error("Exception reported", e); } }
public Object mangle( final Server server ) { ContextHandler ctx = getContext( server ); if ( ctx != null && ctx.getServletContext() != null ) { // try with servlet context is available, it falls back to attributes anyway return ctx.getServletContext().getAttribute( attributeKey ); } else if ( ctx != null ) { // try plain jetty attributes return ctx.getAttribute( attributeKey ); } else { return null; } } }
/** * Get the WebSocketContainer out of the current ThreadLocal reference * of the active ContextHandler. * * @return the WebSocketContainer if found, null if not found. */ public static WebSocketContainer getWebSocketContainer() { ContextHandler.Context context = ContextHandler.getCurrentContext(); if (context == null) return null; ContextHandler handler = ContextHandler.getContextHandler(context); if (handler == null) return null; if (!(handler instanceof ServletContextHandler)) return null; return (javax.websocket.WebSocketContainer) handler.getServletContext().getAttribute("javax.websocket.server.ServerContainer"); }
private MultiParts newMultiParts(ServletInputStream inputStream, String contentType, MultipartConfigElement config, Object object) throws IOException { MultiPartFormDataCompliance compliance = getHttpChannel().getHttpConfiguration().getMultipartFormDataCompliance(); if(LOG.isDebugEnabled()) LOG.debug("newMultiParts {} {}",compliance, this); switch(compliance) { case RFC7578: return new MultiParts.MultiPartsHttpParser(getInputStream(), getContentType(), config, (_context != null?(File)_context.getAttribute("javax.servlet.context.tempdir"):null), this); case LEGACY: default: return new MultiParts.MultiPartsUtilParser(getInputStream(), getContentType(), config, (_context != null?(File)_context.getAttribute("javax.servlet.context.tempdir"):null), this); } }
public void start() throws Exception{ if(!started){ started=true; server.start(); //context.getServletHandler().dumpStdErr(); groovity = (Groovity) context.getServletContext().getAttribute(GroovityServlet.SERVLET_CONTEXT_GROOVITY_INSTANCE); } } public Groovity getGroovity(){
public void resetFactories() { LOG.debug("reset >>"); ResourceBinder binder = (ResourceBinder)context.getServletContext().getAttribute(ResourceBinder.class.getName()); ((ResourceBinderImpl)binder).clear(); ApplicationProviderBinder providerBinder = (ApplicationProviderBinder)context.getServletContext().getAttribute(ApplicationProviderBinder.class.getName()); ApplicationProviderBinderHelper.resetApplicationProviderBinder(providerBinder); }
public void publishPerRequestGroovyScript(String resourcePath, String name) { GroovyResourcePublisher groovyPublisher = (GroovyResourcePublisher)context.getServletContext().getAttribute(GroovyResourcePublisher.class.getName()); BaseResourceId publishedResourceId = new BaseResourceId(name); groovyPublisher.publishPerRequest(IoUtil.getResource(resourcePath), publishedResourceId, null, null, null); }
public void publish(Application application){ ResourceBinder binder = (ResourceBinder)context.getServletContext().getAttribute(ResourceBinder.class.getName()); ApplicationProviderBinder providerBinder = (ApplicationProviderBinder)context.getServletContext().getAttribute(ApplicationProviderBinder.class.getName()); ApplicationPublisher applicationPublisher = new ApplicationPublisher(binder, providerBinder); applicationPublisher.publish(application); }
public void start() throws Exception{ if(!started){ started=true; server.start(); //context.getServletHandler().dumpStdErr(); groovity = (Groovity) context.getServletContext().getAttribute(GroovityServlet.SERVLET_CONTEXT_GROOVITY_INSTANCE); } } public Groovity getGroovity(){