Package EDU.oswego.cs.dl.util.concurrent

Examples of EDU.oswego.cs.dl.util.concurrent.Latch.acquire()


      closerThread.start();

      assertNull(topicConsumer.receive(3000));

      // wait for the closing thread to finish
      latch.acquire();
   }

    /** to be used by testTimeoutReceiveOnClose */
     private class ThreadCloser extends Thread
     {
View Full Code Here


            }
         }
      }, "consumer thread 2").start();

      latch.acquire();
      latch2.acquire();

      assertEquals(5, received.size());
      for(Iterator i = received.iterator(); i.hasNext(); )
      {
         Message m = (Message)i.next();
View Full Code Here

         }

         // need extra commit for cases in which the last message index is not a multiple of 10
         sess.commit();

         latch.acquire();
        
         if (listener.failed)
         {
            fail("listener failed: " + listener.getError());
         }
View Full Code Here

      Thread.sleep(3000);
      receiverThread.interrupt();

      // wait for the reading thread to conclude
      latch.acquire();

      log.trace("Expected message:" + expectedMessage);
     
      assertNull(expectedMessage);     
   }
View Full Code Here

            }
         }
      }, "receiver thread");
      receiverThread.start();

      latch.acquire();
      assertNull(expectedMessage);
   }

   public void testReceiveTimeoutPreservation() throws Exception
   {
View Full Code Here

         }
      }, "sender thread");
      senderThread.start();


      senderLatch.acquire();
      receiverLatch.acquire();

      if (testFailed)
      {
         fail("Test failed by the sender thread. Watch for exception in logs");
View Full Code Here

    public void doExecute(WorkerContext work, GeronimoExecutor executor)
            throws WorkException, InterruptedException {
        Latch latch = work.provideEndLatch();
        executor.execute("A J2EE Connector", work);
        latch.acquire();
    }
}
View Full Code Here

    public void doExecute(WorkerContext work, GeronimoExecutor executor)
            throws WorkException, InterruptedException {
        Latch latch = work.provideStartLatch();
        executor.execute("A J2EE Connector", work);
        latch.acquire();
    }
}
View Full Code Here

              }
           }
        }, "consumer thread 2").start();
 
        latch.acquire();
        latch2.acquire();
 
        assertEquals(5, received.size());
        for(Iterator i = received.iterator(); i.hasNext(); )
        {
           Message m = (Message)i.next();
View Full Code Here

    public void doExecute(WorkerContext work, Executor executor)
            throws WorkException, InterruptedException {
        Latch latch = work.provideEndLatch();
        executor.execute(work);
        latch.acquire();
    }
}
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.