@Override public String getJmxName() { return threadPool.getConfig().getPoolName(); }
@Override public String getJmxName() { return threadPool.getConfig().getPoolName(); }
@Override public void onTaskCancelEvent(AbstractThreadPool threadPool, Runnable task) { // when dequeued task is cancelled - we have to "return" the thread, that // we marked as dispatched from the pool grizzlyMonitoring.getThreadPoolProbeProvider().threadReturnedToPoolEvent( monitoringId, threadPool.getConfig().getPoolName(), Thread.currentThread().getId()); }
@Override public void onTaskCompleteEvent(AbstractThreadPool threadPool, Runnable task) { grizzlyMonitoring.getThreadPoolProbeProvider().threadReturnedToPoolEvent( monitoringId, threadPool.getConfig().getPoolName(), Thread.currentThread().getId()); }
@Override public void onTaskDequeueEvent(AbstractThreadPool threadPool, Runnable task) { grizzlyMonitoring.getThreadPoolProbeProvider().threadDispatchedFromPoolEvent( monitoringId, threadPool.getConfig().getPoolName(), Thread.currentThread().getId()); grizzlyMonitoring.getConnectionQueueProbeProvider().onTaskDequeuedEvent( monitoringId, task.getClass().getName()); }
@Override public void onThreadReleaseEvent(AbstractThreadPool threadPool, Thread thread) { grizzlyMonitoring.getThreadPoolProbeProvider().threadReleasedEvent( monitoringId, threadPool.getConfig().getPoolName(), thread.getId()); }
@Override public void onThreadAllocateEvent(AbstractThreadPool threadPool, Thread thread) { grizzlyMonitoring.getThreadPoolProbeProvider().threadAllocatedEvent( monitoringId, threadPool.getConfig().getPoolName(), thread.getId()); }
@Override public void onMaxNumberOfThreadsEvent(AbstractThreadPool threadPool, int maxNumberOfThreads) { grizzlyMonitoring.getThreadPoolProbeProvider().maxNumberOfThreadsReachedEvent( monitoringId, threadPool.getConfig().getPoolName(), maxNumberOfThreads); }
@Test public void testWorkerThreadPoolConfiguration() throws Exception { LOGGER.log(Level.INFO, "Running: testWorkerThreadPoolConfiguration ({0})", transport.getName()); ThreadPoolConfig config = ThreadPoolConfig.defaultConfig(); config.setCorePoolSize(1); config.setMaxPoolSize(1); config.setPoolName("custom"); transport.setWorkerThreadPoolConfig(config); transport.setIOStrategy(WorkerThreadIOStrategy.getInstance()); ThreadPoolConfig underTest = transport.getWorkerThreadPoolConfig(); assertEquals(1, underTest.getCorePoolSize()); assertEquals(1, underTest.getMaxPoolSize()); assertEquals("custom", underTest.getPoolName()); }
assertEquals(config3.getPoolName(), cfg.getPoolName()); assertTrue(config3.getQueueLimit() == tasks); assertTrue(config3.getCorePoolSize() == coresize);