Package org.ametys.core.ui
Class ClientSideElementDependenciesManager
- java.lang.Object
-
- org.ametys.core.ui.ClientSideElementDependenciesManager
-
public class ClientSideElementDependenciesManager extends Object
Dependencies manager, able to compute the full chain of dependencies.
-
-
Field Summary
Fields Modifier and Type Field Description private Map<String,List<String>>
_dependencies
protected org.slf4j.Logger
_logger
Loggerprivate ServiceManager
_manager
-
Constructor Summary
Constructors Constructor Description ClientSideElementDependenciesManager(ServiceManager manager)
Default constructor for the dependencies manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,List<ClientSideElement>>
computeDependencies()
Compute the chain of dependenciesprivate void
computeDependencies(Map<String,List<ClientSideElement>> computedDependencies, Map<String,List<String>> dependenciesToProcess, List<ClientSideElement> knownElements)
Recursively Compute the chain of dependency.void
register(String extensionPoint, String extensionId)
Register a new dependencyvoid
register(ClientSideElement element)
Register a new dependency to a client side element
-
-
-
Field Detail
-
_logger
protected org.slf4j.Logger _logger
Logger
-
_dependencies
private Map<String,List<String>> _dependencies
-
_manager
private ServiceManager _manager
-
-
Constructor Detail
-
ClientSideElementDependenciesManager
public ClientSideElementDependenciesManager(ServiceManager manager)
Default constructor for the dependencies manager.- Parameters:
manager
- The service manager, used to resolve dependencies.
-
-
Method Detail
-
register
public void register(String extensionPoint, String extensionId)
Register a new dependency- Parameters:
extensionPoint
- The dependency extension pointextensionId
- The dependency extension
-
register
public void register(ClientSideElement element)
Register a new dependency to a client side element- Parameters:
element
- The client side element
-
computeDependencies
public Map<String,List<ClientSideElement>> computeDependencies() throws ServiceException
Compute the chain of dependencies- Returns:
- The list of dynamic dependencies calculated from the registered dependencies.
- Throws:
ServiceException
- If an error occurs with the list of ExtensionPoints
-
computeDependencies
private void computeDependencies(Map<String,List<ClientSideElement>> computedDependencies, Map<String,List<String>> dependenciesToProcess, List<ClientSideElement> knownElements) throws ServiceException
Recursively Compute the chain of dependency.- Parameters:
computedDependencies
- The list of dependencies that have already been computed from the chain. This map is filled with the full dependencies chain.dependenciesToProcess
- The list of extensions to parse, mapped by extension points, that can have additional dependencies.knownElements
- The list of elements that were already handled (to avoid infinite loop)- Throws:
ServiceException
- If an error occurs
-
-