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

chao.java.tools.servicepool.BuildInServiceLoader Maven / Gradle / Ivy

There is a newer version: 1.9.0
Show newest version
package chao.java.tools.servicepool;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * chao.java.tools.servicepool.gen.ServiceFactoriesInstance
 * chao.java.tools.servicepool.gen.InitServiceManagerInstance
 * chao.java.tools.servicepool.gen.PathServicesInstance
 * chao.android.tools.servicepool.AndroidNoOpInstantiator
 *
 * @author luqin
 * @since 2020/9/6
 */
public class BuildInServiceLoader implements IServiceLoader {

    private List> services;

    public BuildInServiceLoader() {
        services = new ArrayList<>();

        try {
            services.add(Class.forName("chao.java.tools.servicepool.gen.PathServicesInstance").asSubclass(IService.class));
            services.add(Class.forName("chao.java.tools.servicepool.gen.ServiceFactoriesInstance").asSubclass(IService.class));
            services.add(Class.forName("chao.java.tools.servicepool.gen.InitServiceManagerInstance").asSubclass(IService.class));
        } catch (ClassNotFoundException e) {
            throw new ServicePoolException("build in services not found.", e);
        }
    }

    @Override
    public Iterable> getServices() {
        return services;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy