Example usage for org.springframework.boot SpringApplication getListeners

List of usage examples for org.springframework.boot SpringApplication getListeners

Introduction

In this page you can find the example usage for org.springframework.boot SpringApplication getListeners.

Prototype

public Set<ApplicationListener<?>> getListeners() 

Source Link

Document

Returns read-only ordered Set of the ApplicationListener s that will be applied to the SpringApplication and registered with the ApplicationContext .

Usage

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);
    }/* w w  w .  ja v a2  s. co m*/
}