package pl.edu.agh.awi;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import pl.edu.agh.awi.loader.StartupLoader;

import java.util.List;

@SpringBootApplication
@EnableScheduling
public class Application implements CommandLineRunner {

    @Autowired
    private List<StartupLoader> loaders;

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        loaders.forEach(e -> e.loadData());
    }
}

@@ -18,16 +18,94 @@
 h.awi;%0A%0A
+import com.hazelcast.core.HazelcastInstance;%0Aimport com.hazelcast.core.IList;%0A
 import o
@@ -442,16 +442,55 @@
 oader;%0A%0A
+import javax.annotation.PostConstruct;%0A
 import j
@@ -611,59 +611,307 @@
     
-@Autowired%0A    private List%3CStartupLoader%3E loaders;
+public static final String DEFAULT_ZONE = %22northamerica%22;%0A    @Autowired%0A    private List%3CStartupLoader%3E loaders;%0A%0A    @Autowired%0A    private HazelcastInstance hazelcast;%0A%0A    private IList%3CString%3E zones;%0A%0A    @PostConstruct%0A    public void init() %7B%0A        zones = hazelcast.getList(%22zones%22);%0A    %7D
 %0A%0A  
@@ -1085,16 +1085,41 @@
 ption %7B%0A
+        addZones(args);%0A%0A
         
@@ -1159,11 +1159,241 @@
 );%0A    %7D
+%0A%0A    private void addZones(String... args) %7B%0A        if (args.length %3E 0) %7B%0A            for (String arg : args) %7B%0A                zones.add(arg);%0A            %7D%0A        %7D else %7B%0A            zones.add(DEFAULT_ZONE);%0A        %7D%0A    %7D
 %0A%7D%0A

Add zone name loader