Skip to content

Instantly share code, notes, and snippets.

@ekirastogi
Created October 30, 2015 23:09
Show Gist options
  • Save ekirastogi/9454842aca076ebb5094 to your computer and use it in GitHub Desktop.
Save ekirastogi/9454842aca076ebb5094 to your computer and use it in GitHub Desktop.
Spring Boot : How to create a Bootstrap class.
package com.ekiras.bootstrap;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.logging.Logger;
/**
* Created by ekansh on 31/10/15.
*/
@Component
public class Bootstrap implements InitializingBean{
Logger logger = Logger.getLogger(getClass().getName());
@Override
public void afterPropertiesSet() throws Exception {
System.out.println("##########################################");
System.out.println("##########################################");
System.out.println(" START BOOTSTRAP CODE ");
System.out.println("##########################################");
System.out.println("##########################################");
// write the bootstrap code here
System.out.println("##########################################");
System.out.println("##########################################");
System.out.println(" END BOOTSTRAP CODE ");
System.out.println("##########################################");
System.out.println("##########################################");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment