Class DataStoreFactory

java.lang.Object
org.moeaframework.core.spi.AbstractFactory<DataStoreProvider>
org.moeaframework.analysis.store.DataStoreFactory
All Implemented Interfaces:
Iterable<DataStoreProvider>

public class DataStoreFactory extends AbstractFactory<DataStoreProvider>
Factory for creating data store instances. See DataStoreProvider for details on adding new providers.

This class is thread safe.

  • Constructor Details

    • DataStoreFactory

      public DataStoreFactory()
      Constructs a new data store factory.
  • Method Details

    • getInstance

      public static DataStoreFactory getInstance()
      Returns the default data store factory.
      Returns:
      the default data store factory
    • setInstance

      public static void setInstance(DataStoreFactory instance)
      Sets the default data store factory.
      Parameters:
      instance - the default data store factory
    • getDataStore

      public DataStore getDataStore(URI uri)
      Searches through all discovered DataStoreProvider instances, returning an instance of the provider with the configured URI. This method must throw an ProviderNotFoundException if no matching provider is found.
      Parameters:
      uri - the URI defining the data store configuration
      Returns:
      an instance of the data store with the registered name
      Throws:
      ProviderNotFoundException - if no provider for the URI is available