Examples of ApplicationEvent


Examples of org.springframework.context.ApplicationEvent

        advisor.testInit();

        TestCommand cmd = (TestCommand)advisor.getBeanFactory().getBean("testCommand");
        assertEquals("Command must be notified of refresh", 1, cmd.getCount());

        advisor.onApplicationEvent(new ApplicationEvent(this) {});
        assertEquals("Command must be notified", 2, cmd.getCount());
    }
View Full Code Here

Examples of org.springframework.context.ApplicationEvent

    public Producer createProducer() throws Exception {
        ObjectHelper.notNull(applicationContext, "applicationContext");
        return new DefaultProducer(this) {
            public void process(Exchange exchange) throws Exception {
                ApplicationEvent event = toApplicationEvent(exchange);
                applicationContext.publishEvent(event);
            }
        };
    }
View Full Code Here

Examples of pl.eternalsh.simplecalc.common.events.ApplicationEvent

        while(true)
        {
            try
            {
                /* Take the first applicationEvent and handle it. */
                ApplicationEvent applicationEvent = blockingQueue.take();

                /* If somehow the controller has received an unknown applicationEvent - stop the application. */
                if(! eventStrategyMap.containsKey(applicationEvent.getClass()))
                {
                    throw new RuntimeException();
                }

                /* Handle the event. */
                eventStrategyMap.get(applicationEvent.getClass()).handle(applicationEvent);
            }
            catch(InterruptedException exception)
            {
                throw new RuntimeException();
            }
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.