Code example for EventBus

0
		return authProvider;
	} 
 
	@Bean 
	public EventBus eventBus() {
		return new EventBus();
	} 
 
	@Bean(destroyMethod="shutdown") 
	public ListeningExecutorService taskExecutor() {
		ThreadFactory threadFactory = new ThreadFactoryBuilder()
			.setNameFormat("Task Executor (%d)").build(); //$NON-NLS-1$
		ExecutorService executorService = Executors.newScheduledThreadPool(
				DocumentrConstants.TASK_EXECUTOR_THREADS, threadFactory);
		return MoreExecutors.listeningDecorator(executorService);
	} 
 
	@Override 
	public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
		taskRegistrar.setScheduler(taskExecutor());