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

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

Introduction

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

Prototype

public void setTaskExecutor(@Nullable Executor taskExecutor) 

Source Link

Document

Set a custom executor (typically a org.springframework.core.task.TaskExecutor ) to invoke each listener with.

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  ww w  .ja  v  a 2  s . com*/
@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
 *//*from   w  ww  .  j av a2s.c om*/
@Bean
public ApplicationEventMulticaster applicationEventMulticaster(final TaskExecutor taskExecutor) {
    final SimpleApplicationEventMulticaster applicationEventMulticaster = new SimpleApplicationEventMulticaster();
    applicationEventMulticaster.setTaskExecutor(taskExecutor);
    return applicationEventMulticaster;
}