Example usage for org.springframework.context.event SimpleApplicationEventMulticaster SimpleApplicationEventMulticaster

List of usage examples for org.springframework.context.event SimpleApplicationEventMulticaster SimpleApplicationEventMulticaster

Introduction

In this page you can find the example usage for org.springframework.context.event SimpleApplicationEventMulticaster SimpleApplicationEventMulticaster.

Prototype

public SimpleApplicationEventMulticaster() 

Source Link

Document

Create a new SimpleApplicationEventMulticaster.

Usage

From source file:com.netflix.genie.web.configs.EventConfig.java

/**
 * A multicast event publisher to replace the default one used by Spring via the ApplicationContext.
 *
 * @param syncTaskExecutor  The synchronous task executor to use
 * @param asyncTaskExecutor The asynchronous task executor to use
 * @return The application event multicaster to use
 *//*from w ww  .ja  v  a2  s . c  o  m*/
@Bean
public GenieEventBusImpl applicationEventMulticaster(
        @Qualifier("genieSyncTaskExecutor") final SyncTaskExecutor syncTaskExecutor,
        @Qualifier("genieAsyncTaskExecutor") final AsyncTaskExecutor asyncTaskExecutor) {
    final SimpleApplicationEventMulticaster syncMulticaster = new SimpleApplicationEventMulticaster();
    syncMulticaster.setTaskExecutor(syncTaskExecutor);

    final SimpleApplicationEventMulticaster asyncMulticaster = new SimpleApplicationEventMulticaster();
    asyncMulticaster.setTaskExecutor(asyncTaskExecutor);
    return new GenieEventBusImpl(syncMulticaster, asyncMulticaster);
}

From source file:org.fineract.module.stellar.configuration.BridgeConfiguration.java

@Bean
public SimpleApplicationEventMulticaster applicationEventMulticaster() {
    final SimpleApplicationEventMulticaster multicaster = new SimpleApplicationEventMulticaster();
    multicaster.setTaskExecutor(new SimpleAsyncTaskExecutor());
    return multicaster;
}

From source file:com.netflix.genie.core.configs.ServicesConfigTest.java

/**
 * A multicast (async) event publisher to replace the synchronous one used by Spring via the ApplicationContext.
 *
 * @param taskExecutor The task executor to use
 * @return The application event multicaster to use
 *///w ww  .  j  a  v  a2s .c  o  m
@Bean
public ApplicationEventMulticaster applicationEventMulticaster(final TaskExecutor taskExecutor) {
    final SimpleApplicationEventMulticaster applicationEventMulticaster = new SimpleApplicationEventMulticaster();
    applicationEventMulticaster.setTaskExecutor(taskExecutor);
    return applicationEventMulticaster;
}

From source file:org.eclipse.gemini.blueprint.extender.internal.support.ExtenderConfiguration.java

private OsgiBundleApplicationContextEventMulticaster createDefaultEventMulticaster() {
    isMulticasterManagedInternally = true;
    return new OsgiBundleApplicationContextEventMulticasterAdapter(new SimpleApplicationEventMulticaster());
}

From source file:org.springframework.boot.context.event.EventPublishingRunListener.java

public EventPublishingRunListener(SpringApplication application, String[] args) {
    this.application = application;
    this.args = args;
    this.initialMulticaster = new SimpleApplicationEventMulticaster();
    for (ApplicationListener<?> listener : application.getListeners()) {
        this.initialMulticaster.addApplicationListener(listener);
    }//from  ww  w.jav  a2 s.c om
}

From source file:org.springframework.boot.context.logging.LoggingApplicationListenerTests.java

private void multicastEvent(ApplicationListener<?> listener, ApplicationEvent event) {
    SimpleApplicationEventMulticaster multicaster = new SimpleApplicationEventMulticaster();
    multicaster.addApplicationListener(listener);
    multicaster.multicastEvent(event);//w ww.  j  ava2  s  .  c  om
}