List of usage examples for java.util.concurrent LinkedBlockingQueue LinkedBlockingQueue
public LinkedBlockingQueue()
From source file:eu.vital.maps.server.inmemoryqueue.QueueConfig.java
@Bean public BlockingQueue<String> blockingQueue() { return new LinkedBlockingQueue<>(); }
From source file:ome.services.scheduler.ThreadPool.java
public ThreadPool(int minThreads, int maxThreads, long msTimeout) { queue = new LinkedBlockingQueue<Runnable>(); factory = null;/*from w w w .j a va 2 s . c o m*/ executor = new ThreadPoolExecutor(minThreads, maxThreads, msTimeout, TimeUnit.MILLISECONDS, queue); // factory }
From source file:fr.aliasource.index.core.AbstractCrawler.java
protected AbstractCrawler() { this.logger = LogFactory.getLog(getClass()); this.toCrawl = new LinkedBlockingQueue<String>(); }
From source file:com.opengamma.language.context.DefaultGlobalContextEventHandler.java
public DefaultGlobalContextEventHandler() { final int cores = Runtime.getRuntime().availableProcessors(); final ThreadPoolExecutor executor = new ThreadPoolExecutor(cores, cores, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>()); executor.allowCoreThreadTimeOut(true); executor.setThreadFactory(new NamedThreadPoolFactory("S-Worker")); setSaturatingExecutor(executor);//from w ww .java2s . c om }
From source file:com.dangdang.ddframe.job.util.concurrent.ExecutorServiceObject.java
public ExecutorServiceObject(final String namingPattern, final int threadSize) { workQueue = new LinkedBlockingQueue<>(); threadPoolExecutor = new ThreadPoolExecutor(threadSize, threadSize, 5L, TimeUnit.MINUTES, workQueue, new BasicThreadFactory.Builder().namingPattern(Joiner.on("-").join(namingPattern, "%s")).build()); threadPoolExecutor.allowCoreThreadTimeOut(true); }
From source file:org.jboss.aerogear.windows.mpns.internal.MpnsQueuedService.java
public MpnsQueuedService(AbstractMpnsService service) { this.service = service; this.queue = new LinkedBlockingQueue<Pair<HttpPost, MpnsNotification>>(); }
From source file:io.nebo.container.HttpContentInputStream.java
public HttpContentInputStream() { this.closed = new AtomicBoolean(); queue = new LinkedBlockingQueue<>(); }
From source file:emily.command.fun.FMLCommand.java
public FMLCommand() { super(); items = new LinkedBlockingQueue<>(); }
From source file:fi.jumi.core.suite.SuiteFactoryTest.java
@Test public void sets_the_context_class_loader_for_test_threads() throws InterruptedException { createSuiteFactory();/*from ww w .ja va2s . c o m*/ factory.start(new NullSuiteListener()); BlockingQueue<ClassLoader> spy = new LinkedBlockingQueue<>(); factory.testThreadPool.execute(() -> { spy.add(Thread.currentThread().getContextClassLoader()); }); ClassLoader contextClassLoader = spy.take(); assertThat(contextClassLoader, is(factory.testClassLoader)); }
From source file:org.geowebcache.seed.SeederThreadPoolExecutor.java
public SeederThreadPoolExecutor(int corePoolSize, int maxPoolSize) { super(corePoolSize, maxPoolSize, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), tf); }