Package org.apache.hivemind.service

Examples of org.apache.hivemind.service.EventLinker


    public void testNameMatch()
    {
        EventProducer p = new EventProducer();
        EventConsumer c = new EventConsumer();
        EventLinker l = new EventLinkerImpl(null);

        l.addEventListener(p, "propertyChange", c, null);

        PropertyChangeEvent e = new PropertyChangeEvent(this, "whatever", "foo", "bar");

        p.fire(e);
View Full Code Here


                        location,
                        null);

        replayControls();

        EventLinker l = new EventLinkerImpl(el);

        l.addEventListener(p, null, c, location);

        assertEquals(0, p.getListenerCount());

        verifyControls();
    }
View Full Code Here

        el.error("EventProducer does not implement an event set named 'fred'.", location, null);

        replayControls();

        EventLinker l = new EventLinkerImpl(el);

        l.addEventListener(p, "fred", c, location);

        assertEquals(0, p.getListenerCount());

        verifyControls();
    }
View Full Code Here

                        location,
                        null);

        replayControls();

        EventLinker l = new EventLinkerImpl(el);

        l.addEventListener(p, "propertyChange", c, location);

        assertEquals(0, p.getListenerCount());

        verifyControls();
    }
View Full Code Here

                        location,
                        null);

        replayControls();

        EventLinker l = new EventLinkerImpl(el);

        l.addEventListener(p, null, c, location);

        verifyControls();
    }
View Full Code Here

        List eventRegistrations = _parameter.getEventRegistrations();

        if (eventRegistrations.isEmpty())
            return;

        EventLinker linker = new EventLinkerImpl(_factoryParameters.getErrorLog());

        Iterator i = eventRegistrations.iterator();
        while (i.hasNext())
        {
            EventRegistration er = (EventRegistration) i.next();

            // Will log any errors to the errorHandler

            linker.addEventListener(er.getProducer(), er.getEventSetName(), result, er
                    .getLocation());
        }
    }
View Full Code Here

{
    public void testNoName()
    {
        EventProducer p = new EventProducer();
        EventConsumer c = new EventConsumer();
        EventLinker l = new EventLinkerImpl(null);

        l.addEventListener(p, null, c, null);

        PropertyChangeEvent e = new PropertyChangeEvent(this, "whatever", "foo", "bar");

        p.fire(e);

        assertSame(e, c.getLastEvent());

        // Exercise code paths for when the producer has already
        // been scanned.

        EventConsumer c2 = new EventConsumer();

        l.addEventListener(p, null, c2, null);

        p.fire(e);

        assertSame(e, c2.getLastEvent());
    }
View Full Code Here

{
    public void testNoName()
    {
        EventProducer p = new EventProducer();
        EventConsumer c = new EventConsumer();
        EventLinker l = new EventLinkerImpl(null);

        l.addEventListener(p, null, c, null);

        PropertyChangeEvent e = new PropertyChangeEvent(this, "whatever", "foo", "bar");

        p.fire(e);

        assertSame(e, c.getLastEvent());

        // Exercise code paths for when the producer has already
        // been scanned.

        EventConsumer c2 = new EventConsumer();

        l.addEventListener(p, null, c2, null);

        p.fire(e);

        assertSame(e, c2.getLastEvent());
    }
View Full Code Here

    public void testNameMatch()
    {
        EventProducer p = new EventProducer();
        EventConsumer c = new EventConsumer();
        EventLinker l = new EventLinkerImpl(null);

        l.addEventListener(p, "propertyChange", c, null);

        PropertyChangeEvent e = new PropertyChangeEvent(this, "whatever", "foo", "bar");

        p.fire(e);
View Full Code Here

                        location,
                        null);

        replayControls();

        EventLinker l = new EventLinkerImpl(el);

        l.addEventListener(p, null, c, location);

        assertEquals(0, p.getListenerCount());

        verifyControls();
    }
View Full Code Here

TOP

Related Classes of org.apache.hivemind.service.EventLinker

Copyright © 2018 www.massapicom. 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.