Examples of ArrayBlockingQueue


Examples of java.util.concurrent.ArrayBlockingQueue

      frame.setResizable(true);
   }

   public InfinispanDemo(String cfgFileName) {
      asyncExecutor = Executors.newFixedThreadPool(1);
      tableUpdateExecutor = new ThreadPoolExecutor(1, 1, 0, TimeUnit.SECONDS, new ArrayBlockingQueue(1),
            new ThreadPoolExecutor.DiscardPolicy());

      cacheConfigFile = cfgFileName;
      cacheStatusProgressBar.setVisible(false);
      cacheStatusProgressBar.setEnabled(false);
View Full Code Here

Examples of java.util.concurrent.ArrayBlockingQueue

      frame.setResizable(true);
   }

   public InfinispanDemo(String cfgFileName) {
      asyncExecutor = Executors.newFixedThreadPool(1);
      tableUpdateExecutor = new ThreadPoolExecutor(1, 1, 0, TimeUnit.SECONDS, new ArrayBlockingQueue(1),
            new ThreadPoolExecutor.DiscardPolicy());

      cacheConfigFile = cfgFileName;
      cacheStatusProgressBar.setVisible(false);
      cacheStatusProgressBar.setEnabled(false);
View Full Code Here

Examples of java.util.concurrent.ArrayBlockingQueue

        assertEquals(k * k, count.get());
    }

    @Test
    public void testIssue292() throws Exception {
        final BlockingQueue qResponse = new ArrayBlockingQueue(1);
        createSingleNodeExecutorService("testIssue292").submit(new MemberCheck(), new ExecutionCallback<Member>() {
            public void onResponse(Member response) {
                qResponse.offer(response);
            }

            public void onFailure(Throwable t) {
            }
        });
        Object response = qResponse.poll(10, TimeUnit.SECONDS);
        assertNotNull(response);
        assertTrue(response instanceof Member);
    }
View Full Code Here

Examples of java.util.concurrent.ArrayBlockingQueue

  public AsyncWriter(Writer out,int queueCapacity) {
    this(out,queueCapacity,Thread.NORM_PRIORITY + 1);
  }
 
  public AsyncWriter(Writer out,int queueCapacity,int dataProcesserThreadPriority) {
    this(out,new ArrayBlockingQueue(queueCapacity),dataProcesserThreadPriority);
  }
View Full Code Here

Examples of java.util.concurrent.ArrayBlockingQueue

        final CountDownLatch latch = new CountDownLatch(thread);
        ExecutorService executor = new ThreadPoolExecutor(thread,
            thread,
            60,
            TimeUnit.SECONDS,
            new ArrayBlockingQueue(thread * 2),
            new NamedThreadFactory("load"),
            new ThreadPoolExecutor.CallerRunsPolicy());

        for (int sec = 0; sec < minute * 60; sec++) {
            // 执行秒循环
View Full Code Here

Examples of java.util.concurrent.ArrayBlockingQueue

        this.useBatch = pipeline.getParameters().isUseBatch();
    }

    public void afterPropertiesSet() throws Exception {
        executor = new ThreadPoolExecutor(poolSize, poolSize, 0L, TimeUnit.MILLISECONDS,
                                          new ArrayBlockingQueue(poolSize * 4), new NamedThreadFactory(WORKER_NAME),
                                          new ThreadPoolExecutor.CallerRunsPolicy());
    }
View Full Code Here

Examples of java.util.concurrent.ArrayBlockingQueue

    private BlockingQueue<?> getBlockingQueue(int acceptCount, HandleMode mode) {
        if (acceptCount < 0) {
            return new LinkedBlockingQueue();
        } else if (acceptCount == 0) {
            return new ArrayBlockingQueue(1); // 等于0时等价于队列1
        } else {
            return new ArrayBlockingQueue(acceptCount);
        }
    }
View Full Code Here

Examples of java.util.concurrent.ArrayBlockingQueue

        }
    }

    public void afterPropertiesSet() throws Exception {
        executor = new ThreadPoolExecutor(poolSize, poolSize, 0L, TimeUnit.MILLISECONDS,
                                          new ArrayBlockingQueue(poolSize * 4), new NamedThreadFactory(WORKER_NAME),
                                          new ThreadPoolExecutor.CallerRunsPolicy());
    }
View Full Code Here

Examples of java.util.concurrent.ArrayBlockingQueue

    public void afterPropertiesSet() throws Exception {
        executor = new ThreadPoolExecutor(poolSize,
            poolSize,
            0L,
            TimeUnit.MILLISECONDS,
            new ArrayBlockingQueue(poolSize * 4),
            new NamedThreadFactory(WORKER_NAME),
            new ThreadPoolExecutor.CallerRunsPolicy());
    }
View Full Code Here

Examples of java.util.concurrent.ArrayBlockingQueue

        }
    }

    public void afterPropertiesSet() throws Exception {
        executor = new ThreadPoolExecutor(poolSize, poolSize, 0L, TimeUnit.MILLISECONDS,
                                          new ArrayBlockingQueue(poolSize * 4), new NamedThreadFactory(WORKER_NAME),
                                          new ThreadPoolExecutor.CallerRunsPolicy());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.