Package java.util

Examples of java.util.EventObject


        _source = source;
    }

    public boolean eval(Object o) {
        if (o instanceof EventObject) {
            EventObject ev = (EventObject) o;
            return _event_class.isInstance(o) && ev.getSource() == _source;

        } else {
            return false;
        }
    }
View Full Code Here


        assertTrue(!new Or(new False(), new False()).eval(o));
    }

    public void testIsEventFrom() {
        Object o = new Object();
        EventObject ev = new EventObject(o);
        EventObject ev2 = new EventObject(new Object());

        Constraint p = new IsEventFrom(o);

        assertTrue(p.eval(ev));
        assertTrue("p should eval to false for an event not from o",
View Full Code Here

    public void testIsEventSubtypeFrom() {
        Object o = new Object();
        DerivedEvent good_ev = new DerivedEvent(o);
        DerivedEvent wrong_source = new DerivedEvent(new Object());
        EventObject wrong_type = new EventObject(o);
        EventObject wrong_source_and_type = new EventObject(new Object());

        Constraint p = new IsEventFrom(DerivedEvent.class, o);

        assertTrue(p.eval(good_ev));
        assertTrue("p should eval to false for an event not from o",
View Full Code Here

        if (this.condition != null && (Boolean) this.condition.invoke(listener, event)) continue;

        handler.invoke(listener, event);
      }
    } else {
      EventObject event = eventType.newInstance(CollectionUtil.insert(arguments, 0, source, name));
      for (java.util.EventListener listener : listeners) {
        if (this.condition != null && !(Boolean) this.condition.invoke(listener, event)) continue;

        if (listener instanceof net.sourceforge.javautil.common.event.IEventListener) {
          ((net.sourceforge.javautil.common.event.IEventListener)listener).handle(event);
View Full Code Here

    }
  }

  public Response waitResponse(SipTransaction trans)
  {
    EventObject event = _sipPhone.waitResponse(trans, getTimeout());
    if (event == null)
      fail("No response received");

    if (event instanceof TimeoutEvent)
      fail("Received timeout");
View Full Code Here

    private Collection<ValueChangedListener> listeners =
            new ConcurrentLinkedQueue<ValueChangedListener>();

    protected final void changed() {
        EventObject event = new EventObject(this);
        for (ValueChangedListener each: listeners) {
            each.valueChanged(event);
        }
    }
View Full Code Here

            EventFactory factory = management.getEventFactory();
            if (factory == null) {
                return;
            }
            EventObject event = factory.createCamelContextStartingEvent(context);
            if (event == null) {
                return;
            }
            doNotifyEvent(notifier, event);
        }
View Full Code Here

            EventFactory factory = management.getEventFactory();
            if (factory == null) {
                return;
            }
            EventObject event = factory.createCamelContextStartedEvent(context);
            if (event == null) {
                return;
            }
            doNotifyEvent(notifier, event);
        }
View Full Code Here

            EventFactory factory = management.getEventFactory();
            if (factory == null) {
                return;
            }
            EventObject event = factory.createCamelContextStartupFailureEvent(context, cause);
            if (event == null) {
                return;
            }
            doNotifyEvent(notifier, event);
        }
View Full Code Here

            EventFactory factory = management.getEventFactory();
            if (factory == null) {
                return;
            }
            EventObject event = factory.createCamelContextStoppingEvent(context);
            if (event == null) {
                return;
            }
            doNotifyEvent(notifier, event);
        }
View Full Code Here

TOP

Related Classes of java.util.EventObject

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.