Interface IDBAdapter.Registry
- All Superinterfaces:
org.eclipse.net4j.util.container.IContainer<Map.Entry<String,,IDBAdapter>> org.eclipse.net4j.util.event.INotifier,org.eclipse.net4j.util.registry.IRegistry<String,,IDBAdapter> Map<String,IDBAdapter>
- Enclosing interface:
IDBAdapter
adapters.
The registry accepts eagerly created adapters and lazy extension descriptors.
Metadata methods such as getAdapterIDs() do not instantiate descriptors.
Methods returning adapters materialize the requested descriptor on demand and
cache the resulting adapter for subsequent lookups.
Registration is keyed by the logical pair of name and version. Names are
case-insensitive. Versions are dot-separated numeric values; trailing zero
components are insignificant. Thus registering MySQL/8 prevents a
second registration of mysql/8.0.0. A lookup by name alone returns the
highest registered version. A lookup by an IDBAdapterID or by separate
name and version performs an exact logical lookup. The arrays returned by this
interface are snapshots and are ordered by name and numeric version.
- Since:
- 4.14
- Author:
- Eike Stepper
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.container.IContainer
org.eclipse.net4j.util.container.IContainer.Modifiable<E>, org.eclipse.net4j.util.container.IContainer.Persistable<E>, org.eclipse.net4j.util.container.IContainer.Persistence<E>Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
org.eclipse.net4j.util.event.INotifier.INotifier2 -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetAdapter(String adapterName) Returns the highest registered version for a name.getAdapter(String adapterName, String version) Returns the adapter for an exact logical name/version pair.Returns the adapter for an exact logical identity.Returns metadata for all registered adapters without instantiating lazy extension descriptors.getAdapterIDs(String adapterName) Returns metadata for all registered versions of a name without instantiating lazy extension descriptors.Returns all registered adapters, materializing lazy descriptors as necessary.getAdapters(String adapterName) Returns all registered variants for a name, materializing matching lazy descriptors as necessary.Methods inherited from interface org.eclipse.net4j.util.container.IContainer
getElements, isEmptyMethods inherited from interface org.eclipse.net4j.util.event.INotifier
addListener, getListeners, hasListeners, removeListenerMethods inherited from interface org.eclipse.net4j.util.registry.IRegistry
commit, commit, isAutoCommit, setAutoCommitMethods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Field Details
-
INSTANCE
-
-
Method Details
-
getAdapterIDs
IDBAdapterID[] getAdapterIDs()Returns metadata for all registered adapters without instantiating lazy extension descriptors.- Returns:
- a sorted snapshot of registered adapter identities
-
getAdapterIDs
Returns metadata for all registered versions of a name without instantiating lazy extension descriptors.- Parameters:
adapterName- the adapter name to match, case-insensitively- Returns:
- a sorted snapshot of matching adapter identities
-
getAdapters
IDBAdapter[] getAdapters()Returns all registered adapters, materializing lazy descriptors as necessary.- Returns:
- a sorted snapshot of the available adapters
-
getAdapters
Returns all registered variants for a name, materializing matching lazy descriptors as necessary.- Parameters:
adapterName- the adapter name to match, case-insensitively- Returns:
- a sorted snapshot of the matching adapters
-
getAdapter
Returns the adapter for an exact logical identity. A lazy descriptor is materialized only if this lookup finds it.- Parameters:
id- the identity to match- Returns:
- the matching adapter, or
nullif none is registered
-
getAdapter
Returns the adapter for an exact logical name/version pair. Name matching is case-insensitive and version matching is numeric by dot-separated components. A lazy descriptor is materialized only if this lookup finds it.- Parameters:
adapterName- the adapter name to matchversion- the adapter version to match- Returns:
- the matching adapter, or
nullif none is registered
-
getAdapter
Returns the highest registered version for a name. If the matching entry is a lazy descriptor, it is materialized and cached before the adapter is returned.- Parameters:
adapterName- the adapter name to match, case-insensitively- Returns:
- the highest-version adapter, or
nullif no version is registered
-