EventReport swapReport() { this.reportLock.writeLock().lock(); try { EventReport previousReport = this.activeReport; this.activeReport = new EventReport(this.pcConfig.getEventReportMaxPerSource(), this.pcConfig .getEventReportMaxTotal()); return previousReport; } finally { this.reportLock.writeLock().unlock(); } }
public EventManager(PluginContainerConfiguration configuration) { pcConfig = configuration; activeReport = new EventReport(pcConfig.getEventReportMaxPerSource(), pcConfig.getEventReportMaxTotal()); senderThreadPool = new ScheduledThreadPoolExecutor(SENDER_THREAD_POOL_CORE_SIZE, new LoggingThreadFactory( SENDER_THREAD_POOL_NAME, true)); // Set up a thread pool for polling threads. Polling threads will be added to the pool via calls to // registerEventPoller(). pollerThreadPool = new ScheduledThreadPoolExecutor(POLLER_THREAD_POOL_CORE_SIZE, new LoggingThreadFactory( POLLER_THREAD_POOL_NAME, true)); pollerThreads = new HashMap<PollerKey, Runnable>(); }