Class DataStoreRegistry

java.lang.Object
org.apache.sis.storage.DataStoreRegistry

final class DataStoreRegistry extends Object
Creates DataStore instances for a given storage object by scanning all providers on the classpath. Storage objects are typically File or DataSource instances, but can also be any other objects documented in the StorageConnector class.
API note: this class is package-private for now in order to get more experience about what could be a good API. This class may become public in a future SIS version.

Thread safety

The same DataStoreRegistry instance can be safely used by many threads without synchronization on the part of the caller.
Since:
0.4
Version:
1.1
  • Field Details

    • loader

      private final ServiceLoader<DataStoreProvider> loader
      The loader to use for searching for DataStoreProvider implementations. Note that ServiceLoader are not thread-safe - usage of this field must be protected in a synchronized block.
  • Constructor Details

    • DataStoreRegistry

      public DataStoreRegistry()
      Creates a new registry which will look for data stores accessible to the default class loader. The default is the current thread context class loader, provided that it can access at least the Apache SIS stores.
    • DataStoreRegistry

      public DataStoreRegistry(ClassLoader loader)
      Creates a new registry which will look for data stores accessible to the given class loader.
      Parameters:
      loader - the class loader to use for loading DataStoreProvider implementations.
  • Method Details