コード例 #1
0
 public void testSetIfUnset() throws InterruptedException {
   final BlockingCell<String> cell = new BlockingCell<String>();
   assertTrue(cell.setIfUnset("foo"));
   assertEquals("foo", cell.get());
   assertFalse(cell.setIfUnset("bar"));
   assertEquals("foo", cell.get());
 }
コード例 #2
0
 @Override
 public void handleShutdownSignal(String consumerTag, ShutdownSignalException sig) {
   System.out.println(
       "Shutdown signal terminating consumer " + consumerTag + " with signal " + sig);
   if (sig.getCause() != null) {
     sig.printStackTrace();
   }
   _blocker.setIfUnset(sig);
 }
コード例 #3
0
 public void finish() throws IOException {
   if (!_autoAck) getChannel().basicAck(0, true);
   _blocker.setIfUnset(new Object());
 }