コード例 #1
0
 void registerArquillianConfig(ArquillianConfig arqConfig) {
   synchronized (deployedTests) {
     log.debugf("Register Arquillian config: %s", arqConfig.getServiceName());
     deployedTests.add(arqConfig);
     deployedTests.notifyAll();
   }
 }
コード例 #2
0
 public void xxPostSignal() throws Exception {
   log.info(tid() + " XX_POST_SIGNAL (" + id + ")");
   synchronized (signals) {
     signals.add(id);
     signals.notifyAll();
   }
 }
コード例 #3
0
ファイル: PushServlet.java プロジェクト: Cognifide/CQ-Actions
 @Deactivate
 public void deactivate() {
   synchronized (connectionHold) {
     connectionHold.notify();
   }
   connectionHold = null;
   writer = null;
   synchronized (receivedConfirmations) {
     receivedConfirmations.notifyAll();
   }
 }
コード例 #4
0
 private void lockOnReportDir(File reportDir) {
   synchronized (files) {
     while (files.contains(reportDir))
       try {
         files.wait();
       } catch (InterruptedException ex) {
         logger.log(SEVERE, Thread.currentThread().getName() + " INTERRUPTED", ex);
       }
     files.add(reportDir);
     files.notifyAll(); // must own the lock
   }
 }
コード例 #5
0
ファイル: PushServlet.java プロジェクト: Cognifide/CQ-Actions
  public void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response)
      throws ServletException, IOException {
    if (!authenticate(request, response)) {
      return;
    }

    final String msgId = StringUtils.removeStart(request.getRequestPathInfo().getSuffix(), "/");
    if (StringUtils.isBlank(msgId)) {
      throw new ServletException("No suffix found");
    }
    if (!sentMessages.contains(msgId)) {
      throw new ServletException("No one is waiting for confirmation for " + msgId);
    } else {
      receivedConfirmations.add(msgId);
      synchronized (receivedConfirmations) {
        receivedConfirmations.notifyAll();
      }
      response.getWriter().append("Message " + msgId + " confirmed");
      LOG.debug("Message " + msgId + " confirmed");
    }
  }
コード例 #6
0
 private void unlockOnReportDir(File reportDir) {
   synchronized (files) {
     files.remove(reportDir);
     files.notifyAll();
   }
 }