sustain/src/main/java/net/happyonroad/spring/context/ContextUtils.java
public static void initApplicationEventMulticaster(GenericApplicationContext context) {
        ApplicationEventMulticaster multicaster;
        ConfigurableListableBeanFactory beanFactory = context.getBeanFactory();
        if (beanFactory.containsLocalBean(APPLICATION_EVENT_MULTICASTER_BEAN_NAME)) {
            multicaster =
                    beanFactory.getBean(APPLICATION_EVENT_MULTICASTER_BEAN_NAME, ApplicationEventMulticaster.class);
        } else {
            multicaster = new SmartApplicationEventMulticaster(beanFactory);
            beanFactory.registerSingleton(APPLICATION_EVENT_MULTICASTER_BEAN_NAME, multicaster);
        }
        setApplicationEventMulticaster(context, multicaster);

    }
public static void initApplicationEventMulticaster(GenericApplicationContext context) {
        ApplicationEventMulticaster multicaster;
        ConfigurableListableBeanFactory beanFactory = context.getBeanFactory();
        if (beanFactory.containsLocalBean(APPLICATION_EVENT_MULTICASTER_BEAN_NAME)) {
            multicaster =
                    beanFactory.getBean(APPLICATION_EVENT_MULTICASTER_BEAN_NAME, ApplicationEventMulticaster.class);
        } else {
            multicaster = new SmartApplicationEventMulticaster(beanFactory);
            beanFactory.registerSingleton(APPLICATION_EVENT_MULTICASTER_BEAN_NAME, multicaster);
        }
        setApplicationEventMulticaster(context, multicaster);

    }
public static void initApplicationEventMulticaster ( GenericApplicationContext context ) { ApplicationEventMulticaster multicaster ; ConfigurableListableBeanFactory beanFactory = context . getBeanFactory ( ) ; if ( beanFactory . containsLocalBean ( APPLICATION_EVENT_MULTICASTER_BEAN_NAME ) ) { multicaster = beanFactory . getBean ( APPLICATION_EVENT_MULTICASTER_BEAN_NAME , ApplicationEventMulticaster . class ) ; } else { multicaster = new SmartApplicationEventMulticaster ( beanFactory ) ; beanFactory . registerSingleton ( APPLICATION_EVENT_MULTICASTER_BEAN_NAME , multicaster ) ; } setApplicationEventMulticaster ( context , multicaster ) ; }
修改特定上下文的Event Multicaster的默认实现

@param context 被修改的上下文
修改特定上下文的Event Multicaster的默认实现