@Override public void afterPropertiesSet() throws Exception { String name = this.threadPrefix + "@" + Integer.toHexString(hashCode()); if (this.executor == null) { QueuedThreadPool threadPool = new QueuedThreadPool(); threadPool.setName(name); this.executor = threadPool; } if (this.byteBufferPool == null) { this.byteBufferPool = new MappedByteBufferPool(2048, this.executor instanceof ThreadPool.SizedThreadPool ? ((ThreadPool.SizedThreadPool) executor).getMaxThreads() / 2 : ProcessorUtils.availableProcessors() * 2); } if (this.scheduler == null) { this.scheduler = new ScheduledExecutorScheduler(name + "-scheduler", false); } if (this.executor instanceof LifeCycle) { ((LifeCycle)this.executor).start(); } this.scheduler.start(); }
@Override public void afterPropertiesSet() throws Exception { String name = this.threadPrefix + "@" + Integer.toHexString(hashCode()); if (this.executor == null) { QueuedThreadPool threadPool = new QueuedThreadPool(); threadPool.setName(name); this.executor = threadPool; } if (this.byteBufferPool == null) { this.byteBufferPool = new MappedByteBufferPool(2048, this.executor instanceof ThreadPool.SizedThreadPool ? ((ThreadPool.SizedThreadPool) executor).getMaxThreads() / 2 : ProcessorUtils.availableProcessors() * 2); } if (this.scheduler == null) { this.scheduler = new ScheduledExecutorScheduler(name + "-scheduler", false); } if (this.executor instanceof LifeCycle) { ((LifeCycle)this.executor).start(); } this.scheduler.start(); }
public WebSocketUpgradeHandlerWrapper(ServletContextHandler context) { this(context, new MappedByteBufferPool()); }
/** * Entry point for {@link org.eclipse.jetty.websocket.servlet.WebSocketServletFactory.Loader} * * @param context the servlet context * @param policy the policy to use */ public WebSocketServerFactory(ServletContext context, WebSocketPolicy policy) { this(context, policy, new MappedByteBufferPool()); }
public WebSocketHandler() { this(new MappedByteBufferPool()); }
public WebSocketServerFactory(WebSocketPolicy policy) { this(policy,new MappedByteBufferPool()); }
public WebSocketServerFactory(WebSocketPolicy policy) { this(policy,new MappedByteBufferPool()); }
/** * Entry point for Spring Boot's MockMVC framework */ public WebSocketServerFactory() { this(WebSocketPolicy.newServerPolicy(), null, new MappedByteBufferPool()); }
public SimpleContainerScope(WebSocketPolicy policy) { this(policy, new MappedByteBufferPool(), new DecoratedObjectFactory()); this.sslContextFactory = new SslContextFactory(); }
public WebSocketServerFactory(ServletContext context) { this(context, WebSocketPolicy.newServerPolicy(), new MappedByteBufferPool()); }
public WebSocketServerFactory() { this(WebSocketPolicy.newServerPolicy(),new MappedByteBufferPool()); }
public WebSocketServerFactory() { this(WebSocketPolicy.newServerPolicy(),new MappedByteBufferPool()); }
@Override public void afterPropertiesSet() throws Exception { String name = this.threadPrefix + "@" + Integer.toHexString(hashCode()); if (this.executor == null) { QueuedThreadPool threadPool = new QueuedThreadPool(); threadPool.setName(name); this.executor = threadPool; } if (this.byteBufferPool == null) { this.byteBufferPool = new MappedByteBufferPool(2048, this.executor instanceof ThreadPool.SizedThreadPool ? ((ThreadPool.SizedThreadPool) executor).getMaxThreads() / 2 : ProcessorUtils.availableProcessors() * 2); } if (this.scheduler == null) { this.scheduler = new ScheduledExecutorScheduler(name + "-scheduler", false); } if (this.executor instanceof LifeCycle) { ((LifeCycle)this.executor).start(); } this.scheduler.start(); }
@Override public void afterPropertiesSet() throws Exception { String name = this.threadPrefix + "@" + Integer.toHexString(hashCode()); if (this.executor == null) { QueuedThreadPool threadPool = new QueuedThreadPool(); threadPool.setName(name); this.executor = threadPool; } if (this.byteBufferPool == null) { this.byteBufferPool = new MappedByteBufferPool(2048, this.executor instanceof ThreadPool.SizedThreadPool ? ((ThreadPool.SizedThreadPool) executor).getMaxThreads() / 2 : ProcessorUtils.availableProcessors() * 2); } if (this.scheduler == null) { this.scheduler = new ScheduledExecutorScheduler(name + "-scheduler", false); } if (this.executor instanceof LifeCycle) { ((LifeCycle)this.executor).start(); } this.scheduler.start(); }
byteBufferPool = new MappedByteBufferPool(); addBean(byteBufferPool);
bufferPool = new MappedByteBufferPool();
@Override protected void doStart() throws Exception { if (executor == null) executor = getServer().getThreadPool(); if (scheduler == null) addBean(scheduler = new ScheduledExecutorScheduler()); if (bufferPool == null) addBean(bufferPool = new MappedByteBufferPool()); addBean(selector = newSelectorManager()); selector.setConnectTimeout(getConnectTimeout()); super.doStart(); }
public Factory(Executor executor, Scheduler scheduler, ByteBufferPool bufferPool, SslContextFactory sslContextFactory, long idleTimeout) { this.idleTimeout = idleTimeout; setConnectTimeout(15000); if (executor == null) executor = new QueuedThreadPool(); this.executor = executor; addBean(executor); if (scheduler == null) scheduler = new ScheduledExecutorScheduler(); this.scheduler = scheduler; addBean(scheduler); if (bufferPool == null) bufferPool = new MappedByteBufferPool(); this.bufferPool = bufferPool; addBean(bufferPool); this.sslContextFactory = sslContextFactory; if (sslContextFactory != null) addBean(sslContextFactory); selector = new ClientSelectorManager(executor, scheduler); selector.setConnectTimeout(getConnectTimeout()); addBean(selector); }
setByteBufferPool(new MappedByteBufferPool());
@Override protected void doStart() throws Exception { if (executor == null) { QueuedThreadPool threadPool = new QueuedThreadPool(); threadPool.setName(name); setExecutor(threadPool); } if (byteBufferPool == null) setByteBufferPool(new MappedByteBufferPool(2048, executor instanceof ThreadPool.SizedThreadPool ? ((ThreadPool.SizedThreadPool)executor).getMaxThreads() / 2 : ProcessorUtils.availableProcessors() * 2)); if (scheduler == null) setScheduler(new ScheduledExecutorScheduler(name + "-scheduler", false)); if (resolver == null) setSocketAddressResolver(new SocketAddressResolver.Async(executor, scheduler, getAddressResolutionTimeout())); handlers.put(new ContinueProtocolHandler()); handlers.put(new RedirectProtocolHandler(this)); handlers.put(new WWWAuthenticationProtocolHandler(this)); handlers.put(new ProxyAuthenticationProtocolHandler(this)); decoderFactories.add(new GZIPContentDecoder.Factory(byteBufferPool)); cookieManager = newCookieManager(); cookieStore = cookieManager.getCookieStore(); transport.setHttpClient(this); super.doStart(); }