Examples of countDown()


Examples of java.util.concurrent.CountDownLatch.countDown()

      };
    // Create an exception handler that counts down latch when it's called
    ThreadedTaskController.ExceptionHandler exceptionHandler =
        new ThreadedTaskController.ExceptionHandler() {
          public void handleException(Exception ex) {
            failingTaskLatch.countDown();
          }
        };
    // Check that a long task creates a visible dialog at screen
    new ThreadedTaskController(failingTask, "Message", exceptionHandler, preferences, viewFactory).executeTask(null);
    failingTaskLatch.await(1000, TimeUnit.MILLISECONDS);
View Full Code Here

Examples of java.util.concurrent.CountDownLatch.countDown()

      // a latch to check further if a rendering error happened during off screen rendering
      // (rendering error listener is called from a notification thread)
      final CountDownLatch latch = new CountDownLatch(1);
      setRenderingErrorObserver(new RenderingErrorObserver() {
          public void errorOccured(int errorCode, String errorMessage) {
            latch.countDown();
          }
        });
     
      // Create an off screen canvas and bind it to view
      offScreenCanvas = getOffScreenCanvas3D(width, height);
View Full Code Here

Examples of java.util.concurrent.CountDownLatch.countDown()

                if (latch == null && req.getAttribute(AtmosphereResourceImpl.PRE_SUSPEND) == null) {
                    logger.debug("response wasn't suspended: {}", res);
                    return action;
                }

                latch.countDown();
                                                                 
                Action nextAction = resumed(req, res);
                if (nextAction.type == Action.TYPE.SUSPEND) {
                    logger.debug("Suspending after resuming response: {}", res);
                    suspend(action, req, res);
View Full Code Here

Examples of java.util.concurrent.CountDownLatch.countDown()

        if (req.getAttribute(LATCH) != null) {
            latchId = (Integer) req.getAttribute(LATCH);
        }
        CountDownLatch latch = latchs.remove(latchId);
        Action a = super.cancelled(req,res);
        latch.countDown();
        return a;       
    }

    /**
     * {@inheritDoc}
 
View Full Code Here

Examples of java.util.concurrent.CountDownLatch.countDown()

                    CountDownLatch latch = latchs.remove(latchId);
                    if (latch == null) {
                        logger.error("Unable to resume the suspended connection with latchId: {}", latchId);
                    }
                    else {
                        latch.countDown();
                    }
                }
                else if (req.getAttribute(AtmosphereResourceImpl.PRE_SUSPEND) == null) {
                    logger.error("Unable to resume the suspended connection");
                }
View Full Code Here

Examples of java.util.concurrent.CountDownLatch.countDown()

            c.prepareGet(urlTarget).execute(new AsyncCompletionHandler<Response>() {

                @Override
                public Response onCompleted(Response response) throws Exception {
                    r.set(response);
                    latch.countDown();
                    return response;
                }
            });

            servletLatch.await();
View Full Code Here

Examples of java.util.concurrent.atomic.AtomicInteger.countDown()

        Request.Listener.Adapter requestListener = new Request.Listener.Adapter()
        {
            @Override
            public void onSuccess(Request request)
            {
                requests.countDown();
            }
        };
        client.getRequestListeners().add(requestListener);

        ContentResponse response = client.newRequest("localhost", connector.getLocalPort())
View Full Code Here

Examples of org.apache.openejb.test.beans.TimerSync.countDown()

    public void ejbTimeout(Timer timer) {
        testAllowedOperations("ejbTimeout");
        try {
            String name = (String) timer.getInfo();
            TimerSync timerSync = (TimerSync) ejbContext.lookup("TimerSyncBeanBusinessRemote");
            timerSync.countDown(name);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
View Full Code Here

Examples of org.apache.tomcat.util.threads.CounterLatch.countDown()

    }
   
    protected long countDownConnection() {
        CounterLatch latch = connectionCounterLatch;
        if (latch!=null) {
            long result = latch.countDown();
            if (result<0) {
                getLog().warn("Incorrect connection count, multiple socket.close called on the same socket." );
            }
            return result;
        } else return -1;
View Full Code Here

Examples of org.apache.tomcat.util.threads.LimitLatch.countDown()

    protected long countDownConnection() {
        if (maxConnections==-1) return -1;
        LimitLatch latch = connectionLimitLatch;
        if (latch!=null) {
            long result = latch.countDown();
            if (result<0) {
                getLog().warn("Incorrect connection count, multiple socket.close called on the same socket." );
            }
            return result;
        } else return -1;
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.