package com.springdeveloper.demo.yarn;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.yarn.annotation.OnContainerStart;
import org.springframework.yarn.annotation.YarnComponent;

@Configuration
@ComponentScan
@EnableAutoConfiguration
public class Application {

    public static void main(String[] args) {
    	new HelloPojo();
        SpringApplication.run(Application.class, args);
    }
    
    @YarnComponent
    @Profile("container")
    public static class HelloPojo {
    	private static final Log log = LogFactory.getLog(HelloPojo.class);
    	
    	@OnContainerStart
    	public void onStart() {
    		log.info("Hello from YARN!");
    	}
	}
}

@@ -620,20 +620,17 @@
 tion %7B%0A%0A
-    
+%09
 public s
@@ -662,20 +662,17 @@
 args) %7B%0A
-    
+%09
 %09new Hel
@@ -685,16 +685,10 @@
 ();%0A
-        
+%09%09
 Spri
@@ -735,23 +735,13 @@
 s);%0A
-    %7D%0A    %0A    
+%09%7D%0A%0A%09
 @Yar
@@ -751,20 +751,17 @@
 mponent%0A
-    
+%09
 @Profile
@@ -774,20 +774,17 @@
 ainer%22)%0A
-    
+%09
 public s
@@ -807,20 +807,18 @@
 oPojo %7B%0A
-    
+%0A%09
 %09private
@@ -881,18 +881,10 @@
 s);%0A
-    %09%0A    
+%0A%09
 %09@On
@@ -898,20 +898,17 @@
 erStart%0A
-    
+%09
 %09public 
@@ -924,20 +924,17 @@
 art() %7B%0A
-    
+%09
 %09%09log.in
@@ -961,12 +961,9 @@
 %22);%0A
-    
+%09
 %09%7D%0A%09

Update YARN example