public class PersistenceBackendFactoryRegistry extends Object
URI
schemes with their associated
PersistenceBackendFactory
.
This PersistenceBackendFactoryRegistry
is used for dynamically create PersistentStore
and
PersistenceBackend
when loading and saving a PersistentResource
. For this reason, a
PersistenceBackendFactory
must be registered before using these operations, with the
register(String, PersistenceBackendFactory)
method.
Resource.load(Map)
,
Resource.save(Map)
Modifier and Type | Method and Description |
---|---|
static Map<String,PersistenceBackendFactory> |
getFactories()
Returns all registered
URI schemes with their PersistenceBackendFactory . |
static PersistenceBackendFactory |
getFactoryProvider(String scheme)
|
static boolean |
isRegistered(String scheme)
|
static void |
register(String scheme,
PersistenceBackendFactory factory)
|
static void |
unregister(String scheme)
|
static void |
unregisterAll()
Unregisters all back-end factories.
|
@Nonnull public static Map<String,PersistenceBackendFactory> getFactories()
URI
schemes with their PersistenceBackendFactory
.@Nonnull public static PersistenceBackendFactory getFactoryProvider(String scheme)
scheme
- the URI
scheme identifying the back-end factoryNullPointerException
- if no back-end factory is registered for the given scheme
public static boolean isRegistered(@Nullable String scheme)
scheme
- the URI
scheme identifying the back-end factorytrue
if a back-end factory is registered for the given scheme
public static void register(@Nonnull String scheme, @Nonnull PersistenceBackendFactory factory)
PersistenceBackendFactory
identified by the given URI
scheme
.
If the given URI
scheme
is already registered, its value will be overridden by the given factory
.
scheme
- the URI
scheme identifying the back-end factoryfactory
- the back-end factorypublic static void unregister(@Nullable String scheme)
scheme
- the URI
scheme identifying the back-end factorypublic static void unregisterAll()
Copyright © 2013–2017 Atlanmod INRIA LINA Mines Nantes. All rights reserved.