.setContextPath("/") .addServlet(servletInfo) .addServletContextAttribute(WebSocketDeploymentInfo.ATTRIBUTE_NAME, info); for (final Filter filter : filters) { String filterName = filter.getClass().getName();
d.addServletContextAttribute(JspInitializationListener.CONTEXT_KEY, expressionFactoryWrappers); d.addServletContextAttribute(attribute.getName(), attribute.getValue()); d.addListener(new ListenerInfo(sl.getClass(), new ImmediateInstanceFactory<EventListener>(sl))); d.addServletContextAttribute(WebSocketDeploymentInfo.ATTRIBUTE_NAME, webSocketDeploymentInfo);
.addServletContextAttribute(ResteasyDeployment.class.getName(), deployment) .addServlet( resteasyServlet
protected DeploymentManager createPippoDeploymentManager() { DeploymentInfo info = Servlets.deployment(); info.setDeploymentName("Pippo"); info.setClassLoader(this.getClass().getClassLoader()); info.setContextPath(getSettings().getContextPath()); info.setIgnoreFlush(true); // inject application as context attribute info.addServletContextAttribute(PIPPO_APPLICATION, getApplication()); // add pippo filter addPippoFilter(info); // add initializers info.addListener(new ListenerInfo(PippoServletContextListener.class)); // add listeners listeners.forEach(listener -> info.addListener(new ListenerInfo(listener))); ServletInfo defaultServlet = new ServletInfo("DefaultServlet", DefaultServlet.class); defaultServlet.addMapping("/"); MultipartConfigElement multipartConfig = createMultipartConfigElement(); defaultServlet.setMultipartConfig(multipartConfig); info.addServlets(defaultServlet); DeploymentManager deploymentManager = Servlets.defaultContainer().addDeployment(info); deploymentManager.deploy(); return deploymentManager; }
public static void setupDeployment(final DeploymentInfo deploymentInfo, final Map<String, ? extends JspPropertyGroupDescriptor> propertyGroups, final Map<String, TagLibraryInfo> tagLibraries, final InstanceManager instanceManager) { deploymentInfo.addServletContextAttribute(SERVLET_VERSION, deploymentInfo.getMajorVersion() + "." + deploymentInfo.getMinorVersion()); deploymentInfo.addServletContextAttribute(JSP_PROPERTY_GROUPS, propertyGroups); deploymentInfo.addServletContextAttribute(JSP_TAG_LIBRARIES, tagLibraries); deploymentInfo.addServletContextAttribute(InstanceManager.class.getName(), instanceManager); deploymentInfo.setJspConfigDescriptor(new JspConfigDescriptor() { @Override public Collection<TaglibDescriptor> getTaglibs() { return null; } @Override public Collection<JspPropertyGroupDescriptor> getJspPropertyGroups() { return (Collection<JspPropertyGroupDescriptor>) propertyGroups.values(); } }); }
public static void addWebSocketSupport(DeploymentInfo deployment, String packageName) { WebSocketDeploymentInfo wsInfo = new WebSocketDeploymentInfo(); for (Class<?> klass : Scans.me().scanPackage(packageName)) { if (klass.getAnnotation(ServerEndpoint.class) != null) { wsInfo.addEndpoint(klass); } } deployment.addServletContextAttribute(WebSocketDeploymentInfo.ATTRIBUTE_NAME, wsInfo); } }
.addServletContextAttribute(WebSocketDeploymentInfo.ATTRIBUTE_NAME , new WebSocketDeploymentInfo()) .addServlets(servletInfos);
.setDeploymentName(deploymentName).addListener(Servlets.listener(org.jboss.weld.environment.servlet.Listener.class)) .addInitParameter(WeldServletLifecycle.class.getPackage().getName() + ".archive.isolation", "false") .addServletContextAttribute(WeldServletLifecycle.BEAN_MANAGER_ATTRIBUTE_NAME, beanManager);
DeploymentInfo websocketDeployment = deployment() .setContextPath("/jwebmpwssocket") .addServletContextAttribute(ATTRIBUTE_NAME, JWebMPUndertowWebSocketConfiguration.webSocketDeploymentInfo) .setDeploymentName("websocket-deployment") .setClassLoader(Thread.currentThread()
servletBuilder.addServletContextAttribute(WebSocketDeploymentInfo.ATTRIBUTE_NAME, wsInfo);
into.addServletContextAttribute( entry.getKey(), entry.getValue() );
WebSocketDeploymentInfo webSocketDeploymentInfo = new WebSocketDeploymentInfo(); endpoints.forEach(webSocketDeploymentInfo::addEndpoint); di.addServletContextAttribute(WebSocketDeploymentInfo.ATTRIBUTE_NAME, webSocketDeploymentInfo);
private DeploymentInfo configureDeploymentInfo() { DeploymentInfo deploymentInfo = Servlets.deployment() .setEagerFilterInit(true) .setClassLoader(mostCompleteClassLoader) .setDeploymentName(applicationConfig.getId()) .setDisplayName(applicationConfig.getName()) .setDefaultSessionTimeout(serverConfig.sessions().getTimeout()) .addServletContextAttribute( WebSocketDeploymentInfo.ATTRIBUTE_NAME, new WebSocketDeploymentInfo() .setBuffers(new DefaultByteBufferPool( undertowConfig.isDirectBuffers(), undertowConfig.getBufferSize())) .setWorker(xnioWorker) ) .setContextPath(serverConfig.getContextPath()); for (Map.Entry<String, String> initParameter : initParameters.entrySet()) { deploymentInfo.addInitParameter(initParameter.getKey(), initParameter.getValue()); } for (ServletContainerInitializer servletContainerInitializer : loadServletContainerInitializers()) { deploymentInfo.addServletContainerInitalizer( createServletContainerInitializerInfo(servletContainerInitializer)); } return deploymentInfo; }
WebSocketDeploymentInfo webSocketDeploymentInfo = new WebSocketDeploymentInfo(); endpoints.forEach(webSocketDeploymentInfo::addEndpoint); di.addServletContextAttribute(WebSocketDeploymentInfo.ATTRIBUTE_NAME, webSocketDeploymentInfo);
info.addServletContextAttribute(en.getKey(), en.getValue());
info.addServletContextAttribute(en.getKey(), en.getValue());
webSocketDeploymentInfo.addEndpoint(endPointClass); deploymentInfo.addServletContextAttribute(WebSocketDeploymentInfo.ATTRIBUTE_NAME, webSocketDeploymentInfo);
.addServletContextAttribute( ResteasyDeployment.class.getName(), deployment ) .addServlet( resteasyServlet )
d.addServletContextAttribute(JspInitializationListener.CONTEXT_KEY, expressionFactoryWrappers); d.addServletContextAttribute(attribute.getName(), attribute.getValue()); d.addListener(new ListenerInfo(sl.getClass(), new ImmediateInstanceFactory<EventListener>(sl))); d.addServletContextAttribute(WebSocketDeploymentInfo.ATTRIBUTE_NAME, webSocketDeploymentInfo);
d.addServletContextAttribute(JspInitializationListener.CONTEXT_KEY, expressionFactoryWrappers); d.addServletContextAttribute(attribute.getName(), attribute.getValue()); d.addListener(new ListenerInfo(sl.getClass(), new ImmediateInstanceFactory<EventListener>(sl))); d.addServletContextAttribute(WebSocketDeploymentInfo.ATTRIBUTE_NAME, webSocketDeploymentInfo);