/** * Create and configure a BufferCache object to the list of subresources * * @param key * The key for the BufferCache resource * @param config * The BufferCacheConsumer to use * @return this */ @SuppressWarnings("unchecked") public T bufferCache(java.lang.String childKey, BufferCacheConsumer consumer) { BufferCache<? extends BufferCache> child = new BufferCache<>(childKey); if (consumer != null) { consumer.accept(child); } bufferCache(child); return (T) this; }
public BufferCache bufferCache(java.lang.String key) { return this.bufferCaches.stream() .filter(e -> e.getKey().equals(key)).findFirst() .orElse(null); } /**
/** * Create and configure a BufferCache object to the list of subresources * * @param key * The key for the BufferCache resource * @param config * The BufferCacheConsumer to use * @return this */ @SuppressWarnings("unchecked") public T bufferCache(java.lang.String childKey, BufferCacheConsumer consumer) { BufferCache<? extends BufferCache> child = new BufferCache<>(childKey); if (consumer != null) { consumer.accept(child); } bufferCache(child); return (T) this; }
public BufferCache bufferCache(java.lang.String key) { return this.bufferCaches.stream() .filter(e -> e.getKey().equals(key)).findFirst() .orElse(null); } /**
/** * Create the default, HTTP-only fraction. * * @return The configured fraction. */ @Default public static UndertowFraction createDefaultFraction() { UndertowFraction fraction = new UndertowFraction(); final boolean enabled = ( System.getProperty( SwarmProperties.HTTP_EAGER ) != null ); fraction.server( new Server("default-server") .httpListener("default", (listener) -> { listener.socketBinding("http") .enabled(enabled); }) .host(new Host("default-host"))) .bufferCache(new BufferCache("default")) .servletContainer(new ServletContainer("default") .websocketsSetting(new WebsocketsSetting()) .jspSetting(new JSPSetting())) .handlerConfiguration(new HandlerConfiguration()); return fraction; }
/** * Create the default, HTTP-only fraction. * * @return The configured fraction. */ public static UndertowFraction createDefaultFraction() { UndertowFraction fraction = new UndertowFraction(); fraction.server( new Server("default-server") .httpListener(new HTTPListener("default") .socketBinding("http")) .host(new Host("default-host"))) .bufferCache(new BufferCache("default")) .servletContainer(new ServletContainer("default") .websocketsSetting(new WebsocketsSetting()) .jspSetting(new JSPSetting())) .handlerConfiguration(new HandlerConfiguration()); return fraction; }
public UndertowFraction applyDefaults() { defaultServer(DEFAULT_SERVER) .defaultVirtualHost(DEFAULT_HOST) .defaultServletContainer(DEFAULT_SERVLET_CONTAINER) .defaultSecurityDomain("other") .server(new Server(DEFAULT_SERVER) .httpListener(DEFAULT_HTTP_LISTENER, (listener) -> { listener.socketBinding("http"); }) .host(new Host(DEFAULT_HOST))) .bufferCache(new BufferCache(DEFAULT_BUFFER_CACHE)) .servletContainer(new ServletContainer(DEFAULT_SERVLET_CONTAINER) .websocketsSetting(new WebsocketsSetting()) .jspSetting(new JSPSetting())) .handlerConfiguration(new HandlerConfiguration()); return this; }