package com.aranga.config;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.core.env.Environment;

/**
 * Created by Aranga on 7/02/2016.
 */

public class DockerContainerPortScanner implements ApplicationListener<ApplicationEnvironmentPreparedEvent>
{

    private static final Logger LOG = Logger.getLogger(DockerContainerPortScanner.class);

    @Autowired
    private Environment env;

    public DockerContainerPortScanner()
    {

    }
    @Override
    public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event)
    {
        LOG.info("DockerContainerPortScanner() loaded!!");
        LOG.info("HELLO!!");
        LOG.info(env.getProperty("DB_PREFIX"));
        for(String s :event.getEnvironment().getSystemEnvironment().keySet())
        {
            LOG.info(s);
        }

    }

}

@@ -555,51 +555,8 @@
 );%0A%0A
-    @Autowired%0A    private Environment env;
 %0A%0A  
@@ -796,55 +796,8 @@
 %22);%0A
-        LOG.info(env.getProperty(%22DB_PREFIX%22));
 %0A   

remove auto wiring environment