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

io.nosqlbench.docsys.core.DocsysPathLoader Maven / Gradle / Ivy

There is a newer version: 4.15.102
Show newest version
package io.nosqlbench.docsys.core;

import io.nosqlbench.docsys.api.*;

import java.util.ServiceLoader;

/**
 * The standard way to load and use all of the {@link DocsNameSpaceImpl}
 * instances which are present in the runtime via SPI.
 *
 * This implementation ensures that names space collisions are known.
 */
public class DocsysPathLoader {

    public static DocsBinder loadStaticPaths() {
        ServiceLoader loader = ServiceLoader.load(DocsysStaticManifest.class);
        Docs docs = new Docs();
        for (DocsysStaticManifest docPathInfos : loader) {
            docs.merge(docPathInfos.getDocs());
        }
        return docs;
    }

    public static DocsBinder loadDynamicPaths() {
        ServiceLoader loader = ServiceLoader.load(DocsysDynamicManifest.class);
        Docs docs = new Docs();
        for (DocsysDynamicManifest docPathInfos : loader) {
            docs.merge(docPathInfos.getDocs());
        }
        return docs;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy