Package org.nuxeo.runtime.model.impl
Class ComponentRegistry
java.lang.Object
org.nuxeo.runtime.model.impl.ComponentRegistry
This class is synchronized to safely update and access the different maps managed by the registry
- Author:
- Bogdan Stefanescu
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<ComponentName,
ComponentName> Map of aliased name to canonical name.protected Map<ComponentName,
RegistrationInfo> All registered components including unresolved ones.protected ComponentRegistry.MappedSet
Map pending components to the set of unresolved components they are waiting for.protected ComponentRegistry.MappedSet
Maps a component name to a set of component names that are depending on that component.protected LinkedHashMap<ComponentName,
RegistrationInfo> The list of resolved components. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
protected final boolean
Fill the pending map with all unresolved dependencies of the given component.boolean
contains
(ComponentName name) Check if the component is already registered against this registryvoid
destroy()
getComponent
(ComponentName name) Get the registration info for the given component name or null if none was registered.Get a copy of the registered components as an array.final boolean
isResolved
(ComponentName name) removeComponent
(ComponentName name) protected void
int
size()
Get the registered components countprotected ComponentName
unaliased
(ComponentName name) protected void
-
Field Details
-
components
All registered components including unresolved ones. You can check the state of a component for getting the unresolved ones. -
resolved
The list of resolved components. We need to use a linked hash map preserve the resolve order. We don't use a simple list to optimize removal by name (used by unregister operations).- Since:
- 9.2
-
aliases
Map of aliased name to canonical name. -
requirements
Maps a component name to a set of component names that are depending on that component. Values are always unaliased. -
pendings
Map pending components to the set of unresolved components they are waiting for. Key is always unaliased.
-
-
Constructor Details
-
ComponentRegistry
public ComponentRegistry() -
ComponentRegistry
-
-
Method Details
-
destroy
public void destroy() -
isResolved
-
addComponent
- Returns:
- true if the component was resolved, false if the component is pending
-
removeComponent
-
getResolvedRegistrationInfo
- Returns:
- an unmodifiable collection of resolved registration infos, sorted by
LinkedHashMap
- Since:
- 9.2
-
getResolvedNames
- Returns:
- an unmodifiable collection of resolved component names, sorted by
LinkedHashMap
- Since:
- 9.2
-
getMissingDependencies
- Returns:
- an unmodifiable collection of missing dependencies
- Since:
- 9.2
-
getComponent
Get the registration info for the given component name or null if none was registered.- Since:
- 9.2
-
contains
Check if the component is already registered against this registry -
size
public int size()Get the registered components count -
getComponents
- Returns:
- an unmodifiable collection of registered components
-
getComponentsArray
Get a copy of the registered components as an array. -
getPendingComponents
- Returns:
- an unmodifiable map of pending components
-
unaliased
-
computePendings
Fill the pending map with all unresolved dependencies of the given component. Returns false if no unresolved dependencies are found, otherwise returns true. -
resolveComponent
-
unresolveComponent
-