Example usage for org.springframework.boot SpringApplication addListeners

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

Introduction

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

Prototype

public void addListeners(ApplicationListener<?>... listeners) 

Source Link

Document

Add ApplicationListener s to be applied to the SpringApplication and registered with the ApplicationContext .

Usage

From source file:fi.hsl.parkandride.Application.java

public static void main(String[] args) {
    SpringApplication app = new SpringApplication(Application.class);
    app.addListeners(new ApplicationPidListener());
    app.run(args);// ww  w. jav a 2 s.c om
}