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());
    }
}

package pl.edu.agh.awi;

import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.IList;
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 javax.annotation.PostConstruct;
import java.util.List;

@SpringBootApplication
@EnableScheduling
public class Application implements CommandLineRunner {

    public static final String DEFAULT_ZONE = "northamerica";
    @Autowired
    private List<StartupLoader> loaders;

    @Autowired
    private HazelcastInstance hazelcast;

    private IList<String> zones;

    @PostConstruct
    public void init() {
        zones = hazelcast.getList("zones");
    }

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

    @Override
    public void run(String... args) throws Exception {
        addZones(args);

        loaders.forEach(e -> e.loadData());
    }

    private void addZones(String... args) {
        if (args.length > 0) {
            for (String arg : args) {
                zones.add(arg);
            }
        } else {
            zones.add(DEFAULT_ZONE);
        }
    }
}

Add zone name loader