Created
August 20, 2016 23:42
-
-
Save saifiahmada/28be148bd08e6b16566708134890316d to your computer and use it in GitHub Desktop.
melihat bean yang diload saat spring boot dijalankan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.saifiahmada.spring; | |
import java.util.Arrays; | |
import org.springframework.beans.factory.annotation.Configurable; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | |
import org.springframework.context.ApplicationContext; | |
@Configurable | |
@EnableAutoConfiguration | |
public class OfflineTest { | |
public static void main(String [] args){ | |
ApplicationContext ctx = SpringApplication.run(OfflineTest.class, args); | |
System.out.println("List beans pada Spring Boot adalah :"); | |
String[] beanNames = ctx.getBeanDefinitionNames(); | |
Arrays.sort(beanNames); | |
for (String beanName : beanNames) { | |
System.out.println(beanName); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment