コード例 #1
0
  @Override
  protected void onInit() {
    schedulingLock.lock();
    try {
      if (this.initialized) {
        return;
      }

      Assert.notNull(this.cassQueue, "Configured cassandra queue is required");
      try {
        popperPool = new ArrayList<PopperImpl>(numberOfPoppers);
        for (int x = 0; x < numberOfPoppers; x++) {
          popperPool.add(cassQueue.createPopper());
        }

        this.initialized = true;

      } catch (Exception e) {
        throw new MessagingException("Failed to create Poller", e);
      }
    } finally {
      schedulingLock.unlock();
    }
  }
 @Before
 public void setupTest() throws Exception {
   cq.truncate();
   msgReceivedConsumer.getMsgs().clear();
 }