Package org.fusesource.hawtdispatch.internal.util

Examples of org.fusesource.hawtdispatch.internal.util.RunnableCountDownLatch.await()


  public void autoCreateBroker() throws Exception {
    Transport connect = TransportFactory.connect("vm://test1");
        connect.setDispatchQueue(Dispatch.createQueue());
        RunnableCountDownLatch cd = new RunnableCountDownLatch(1);
        connect.start(cd);
        cd.await();
    assertNotNull(connect);
        cd = new RunnableCountDownLatch(1);
    connect.stop(cd);
        cd.await();
  }
View Full Code Here


        connect.start(cd);
        cd.await();
    assertNotNull(connect);
        cd = new RunnableCountDownLatch(1);
    connect.stop(cd);
        cd.await();
  }
 
  @Test(expected=IOException.class)
  public void noAutoCreateBroker() throws Exception {
    TransportFactory.connect("vm://test2?create=false");
View Full Code Here

    public void stop(Service service) {
        try {
            if (service != null) {
                RunnableCountDownLatch latch = new RunnableCountDownLatch(1);
                service.stop(latch);
                latch.await();
            }
        } catch (Exception e) {
            onException(service, e);
        }
    }
View Full Code Here

            } catch (Exception e) {
                onException(service, e);
            }
        }
        if( firstException==null ) {
            latch.await();
        }
    }

    public void onException(Object owner, Throwable e) {
        logError(owner, e);
View Full Code Here

    public static void dispose(Service service) {
        try {
            RunnableCountDownLatch latch = new RunnableCountDownLatch(1);
            service.stop(latch);
            latch.await();
        } catch (Exception e) {
            LOG.debug("Could not stop service: " + service + ". Reason: " + e, e);
        }
    }
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.