Package org.moeaframework.analysis.store
Class DataStoreFactory
java.lang.Object
org.moeaframework.core.spi.AbstractFactory<DataStoreProvider>
org.moeaframework.analysis.store.DataStoreFactory
- All Implemented Interfaces:
Iterable<DataStoreProvider>
Factory for creating data store instances. See
DataStoreProvider
for details on adding new providers.
This class is thread safe.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetDataStore
(URI uri) Searches through all discoveredDataStoreProvider
instances, returning an instance of the provider with the configured URI.static DataStoreFactory
Returns the default data store factory.static void
setInstance
(DataStoreFactory instance) Sets the default data store factory.Methods inherited from class org.moeaframework.core.spi.AbstractFactory
addProvider, hasProvider, iterator
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
DataStoreFactory
public DataStoreFactory()Constructs a new data store factory.
-
-
Method Details
-
getInstance
Returns the default data store factory.- Returns:
- the default data store factory
-
setInstance
Sets the default data store factory.- Parameters:
instance
- the default data store factory
-
getDataStore
Searches through all discoveredDataStoreProvider
instances, returning an instance of the provider with the configured URI. This method must throw anProviderNotFoundException
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
-