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

ec.tss.tsproviders.odbc.registry.IOdbcRegistryLoader Maven / Gradle / Ivy

There is a newer version: 2.2.5
Show newest version
package ec.tss.tsproviders.odbc.registry;

import java.lang.Iterable;
import java.util.Optional;
import java.util.ServiceLoader;
import java.util.stream.StreamSupport;

/**
 * Custom service loader for {@link ec.tss.tsproviders.odbc.registry.IOdbcRegistry}.
 * 
This class is thread-safe. *

Properties: *

    *
  • Quantifier: OPTIONAL
  • *
  • Fallback: null
  • *
  • Preprocessing: null
  • *
  • Mutability: NONE
  • *
  • Singleton: true
  • *
  • Name: null
  • *
  • Backend: null
  • *
  • Cleaner: null
  • *
  • Batch: false
  • *
  • Batch name: null
  • *
*/ public final class IOdbcRegistryLoader { private static final Iterable SOURCE = ServiceLoader.load(IOdbcRegistry.class); private static final Optional RESOURCE = doLoad(); private IOdbcRegistryLoader() { } private static Optional doLoad() { return StreamSupport.stream(SOURCE.spliterator(), false) .findFirst(); } /** * Gets an optional {@link ec.tss.tsproviders.odbc.registry.IOdbcRegistry} instance. *
This method is thread-safe. * @return the current non-null value */ public static Optional get() { return RESOURCE; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy