All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.vrap.rmf.base.client.SolutionInfoService Maven / Gradle / Ivy

There is a newer version: 17.17.0
Show newest version

package io.vrap.rmf.base.client;

import java.util.*;

//for architecture see https://docs.oracle.com/javase/tutorial/ext/basics/spi.html
final class SolutionInfoService {
    private static SolutionInfoService instance;

    private SolutionInfoService() {

    }

    public static synchronized SolutionInfoService getInstance() {
        if (instance == null) {
            instance = new SolutionInfoService();
        }
        return instance;
    }

    public List getSolutionInfos() {
        List solutions = new ArrayList<>();
        final ServiceLoader loader = ServiceLoader.load(SolutionInfo.class,
            SolutionInfo.class.getClassLoader());
        loader.forEach(solutions::add);

        solutions.sort(Comparator.comparing(SolutionInfo::getName));
        return Collections.unmodifiableList(solutions);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy