Search in sources :

Example 1 with SimpleServiceLoader

use of io.nosqlbench.nb.api.spi.SimpleServiceLoader in project nosqlbench by nosqlbench.

the class BundledDriverAdapterDocs method getDocs.

@Override
public DocsBinder getDocs() {
    Docs docs = new Docs().namespace("adapter-docs");
    SimpleServiceLoader<DriverAdapter> loader = new SimpleServiceLoader<>(DriverAdapter.class, Maturity.Any);
    List<SimpleServiceLoader.Component<? extends DriverAdapter>> namedProviders = loader.getNamedProviders();
    for (SimpleServiceLoader.Component<? extends DriverAdapter> namedProvider : namedProviders) {
        DriverAdapter driverAdapter = namedProvider.provider.get();
        DocsBinder bundledDocs = driverAdapter.getBundledDocs();
        docs.merge(bundledDocs);
    }
    return docs;
}
Also used : SimpleServiceLoader(io.nosqlbench.nb.api.spi.SimpleServiceLoader) Docs(io.nosqlbench.docapi.Docs) DocsBinder(io.nosqlbench.docapi.DocsBinder)

Aggregations

Docs (io.nosqlbench.docapi.Docs)1 DocsBinder (io.nosqlbench.docapi.DocsBinder)1 SimpleServiceLoader (io.nosqlbench.nb.api.spi.SimpleServiceLoader)1