Examples of PayloadEvent


Examples of org.springmodules.xt.model.event.support.PayloadEvent

        this.collector = new ConcurrentCollector(c);
        this.barrier = new CyclicBarrier(2);
    }
   
    public void testCollectFIFOOrder() throws Exception {
        PayloadEvent e1 = new PayloadEvent(this, new String("test-1"), null);
        PayloadEvent e2 = new PayloadEvent(this, new String("test-2"), null);
        PayloadEvent e3 = new PayloadEvent(this, new String("test-3"), null);
       
        this.collector.onApplicationEvent(e1);
        this.collector.onApplicationEvent(e2);
        this.collector.onApplicationEvent(e3);
       
View Full Code Here

Examples of org.springmodules.xt.model.event.support.PayloadEvent

    }

    private class Tester implements Callable {
        public Object call() throws Exception {
            for (int i = 0; i < 1000000; i++) {
                ConcurrentCollectorTest.this.collector.onApplicationEvent(new PayloadEvent(this, new String("test-" + i), null));
                ConcurrentCollectorTest.this.collector.pollEvent();
            }
            ConcurrentCollectorTest.this.barrier.await();
            return ConcurrentCollectorTest.this.collector.getEvents().size();
        }
View Full Code Here

Examples of org.springmodules.xt.model.event.support.PayloadEvent

        this.collector = new BlockingCollector();
        this.exchanger = new Exchanger<ApplicationEvent>();
    }
   
    public void testCollectFIFOOrder() throws Exception {
        PayloadEvent e1 = new PayloadEvent(this, new String("test"), null);
        PayloadEvent e2 = new PayloadEvent(this);
        PayloadEvent e3 = new PayloadEvent(this);
       
        this.collector.onApplicationEvent(e1);
        this.collector.onApplicationEvent(e2);
        this.collector.onApplicationEvent(e3);
       
View Full Code Here

Examples of org.springmodules.xt.model.event.support.PayloadEvent

    }
   
    private class Producer implements Callable {
        public Object call() throws Exception {
            for (int i = 0; i < 5; i++) {
                ApplicationEvent produced = new PayloadEvent(this, new String("test-" + i), null);
                BlockingCollectorTest.this.collector.onApplicationEvent(produced);
                ApplicationEvent polled = BlockingCollectorTest.this.exchanger.exchange(produced);
                BlockingCollectorTest.this.assertSame(produced, polled);
            }
            return null;
View Full Code Here

Examples of org.springmodules.xt.model.event.support.PayloadEvent

        this.collector = new ThreadLocalCollector();
        this.barrier = new CyclicBarrier(2);
    }
   
    public void testCollectFIFOOrder() throws Exception {
        PayloadEvent e1 = new PayloadEvent(this, new String("test-1"), null);
        PayloadEvent e2 = new PayloadEvent(this, new String("test-2"), null);
        PayloadEvent e3 = new PayloadEvent(this, new String("test-3"), null);
       
        this.collector.onApplicationEvent(e1);
        this.collector.onApplicationEvent(e2);
        this.collector.onApplicationEvent(e3);
       
View Full Code Here

Examples of org.springmodules.xt.model.event.support.PayloadEvent

    private class Tester implements Callable {
        public Object call() throws Exception {
            ThreadLocalCollectorTest.this.barrier.await();
            for (int i = 0; i < 100; i++) {
                ThreadLocalCollectorTest.this.collector.onApplicationEvent(new PayloadEvent(this, new String("test-" + i), null));
                assertEquals(i + 1, ThreadLocalCollectorTest.this.collector.getEvents().size());
            }
            return null;
        }
View Full Code Here

Examples of org.springmodules.xt.model.event.support.PayloadEvent

    protected void setUp() throws Exception {
        this.collector = new SimpleCollector();
    }
   
    public void testCollectAndFIFOOrder() throws Exception {
        PayloadEvent e1 = new PayloadEvent(this, new String("test-1"), null);
        PayloadEvent e2 = new PayloadEvent(this, new String("test-2"), null);
        PayloadEvent e3 = new PayloadEvent(this, new String("test-3"), null);
       
        this.collector.onApplicationEvent(e1);
        this.collector.onApplicationEvent(e2);
        this.collector.onApplicationEvent(e3);
       
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.