@Override public int getNumThreads() { return this.server.getThreadPool().getThreads(); }
@Override public int getNumIdleThreads() { return this.server.getThreadPool().getIdleThreads(); }
public boolean dispatch(Runnable task) throws IOException { return getThreadPool().dispatch(task); }
while (isOpen()) { if (m_connection.isIdle()) { if (m_connector.getServer().getThreadPool().isLowOnThreads()) { if (m_sotimeout != m_connector.getLowResourceMaxIdleTime()) { m_sotimeout = m_connector.getLowResourceMaxIdleTime();
public void join() throws InterruptedException { getThreadPool().join(); }
public void dispatch() throws IOException { if (!m_connector.getThreadPool().dispatch(this)) { LOGGER.warn( "dispatch failed for " + m_connection.toString()); close(); } }
if (getServer().getThreadPool().isLowOnThreads())
server.getThreadPool().join();
@Override public int getNumThreads() { return this.server.getThreadPool().getThreads(); }
private void invoke(final Method method,final Client fromClient, final Client toClient, final Message msg) { if (_threadPool==null) doInvoke(method,fromClient,toClient,msg); else { _threadPool.dispatch(new Runnable() { public void run() { try { ((MessageImpl)msg).incRef(); doInvoke(method,fromClient,toClient,msg); } finally { ((MessageImpl)msg).decRef(); } } }); } }
@Override public int getNumIdleThreads() { return this.server.getThreadPool().getIdleThreads(); }
if (getServer().getThreadPool().isLowOnThreads())
@Override public int getNumThreads() { return this.server.getThreadPool().getThreads(); }
private void invoke(final Method method, final Client fromClient, final Client toClient, final Message msg) { if (_threadPool == null) { doInvoke(method,fromClient,toClient,msg); } else { ((MessageImpl)msg).incRef(); _threadPool.dispatch(new Runnable() { public void run() { asyncDoInvoke(method, fromClient, toClient, msg); } }); } }
@Override public int getNumIdleThreads() { return this.server.getThreadPool().getIdleThreads(); }
@Override public void run() { ready.countDown(); try { start.await(); assertEquals("a:b\nc:d\n", readOutput(new URL(baseUrl, "/echo?a=b&c=d"))); int serverThreads = server.webServer.getThreadPool().getThreads(); assertTrue(serverThreads <= MAX_THREADS); System.out.println("Number of threads = " + serverThreads + " which is less or equal than the max = " + MAX_THREADS); } catch (Exception e) { // do nothing } } });
public void dispatch() throws InterruptedException, IOException { if (!getThreadPool().dispatch(this)) { Log.warn("dispatch failed for {}",_connection); close(); } }
@Override public void run() { ready.countDown(); try { start.await(); assertEquals("a:b\nc:d\n", readOutput(new URL(baseUrl, "/echo?a=b&c=d"))); int serverThreads = server.webServer.getThreadPool().getThreads(); assertTrue("More threads are started than expected, Server Threads count: " + serverThreads, serverThreads <= MAX_THREADS); System.out.println("Number of threads = " + serverThreads + " which is less or equal than the max = " + MAX_THREADS); } catch (Exception e) { // do nothing } } });
void dispatch() throws IOException { if (!getThreadPool().dispatch(this)) { Log.warn("dispatch failed for {}",_connection); close(); } }
@Override public void run() { ready.countDown(); try { start.await(); assertEquals("a:b\nc:d\n", readOutput(new URL(baseUrl, "/echo?a=b&c=d"))); int serverThreads = server.webServer.getThreadPool().getThreads(); assertTrue("More threads are started than expected, Server Threads count: " + serverThreads, serverThreads <= MAX_THREADS); System.out.println("Number of threads = " + serverThreads + " which is less or equal than the max = " + MAX_THREADS); } catch (Exception e) { // do nothing } } });