Package org.springframework.context

Examples of org.springframework.context.BeanThatBroadcasts


    RootBeanDefinition listenerDef = new RootBeanDefinition(BeanThatListens.class);
    listenerDef.getConstructorArgumentValues().addGenericArgumentValue(new RuntimeBeanReference("broadcaster"));
    context.registerBeanDefinition("listener", listenerDef);
    context.refresh();

    BeanThatBroadcasts broadcaster = (BeanThatBroadcasts) context.getBean("broadcaster");
    context.publishEvent(new MyEvent(context));
    assertEquals("The event was not received by the listener", 2, broadcaster.receivedCount);
  }
View Full Code Here


    RootBeanDefinition listenerDef = new RootBeanDefinition(BeanThatListens.class);
    listenerDef.getConstructorArgumentValues().addGenericArgumentValue(new RuntimeBeanReference("broadcaster"));
    context.registerBeanDefinition("listener", listenerDef);
    context.refresh();

    BeanThatBroadcasts broadcaster = context.getBean("broadcaster", BeanThatBroadcasts.class);
    context.publishEvent(new MyEvent(context));
    assertEquals("The event was not received by the listener", 2, broadcaster.receivedCount);

    context.close();
  }
View Full Code Here

TOP

Related Classes of org.springframework.context.BeanThatBroadcasts

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.