public class DependencyGraph extends Object
IParameter.ParameterType.Object. Respectivly, parameters can
declare that they are generated and so they are dependent on the evaluation of the parameter that creates them.
Typically, the parameters that can generate values are the ones of type
IParameter.ParameterType.Object. The dependencies that this
graph can resolve are the ones between parameters. It cannot handle dependencies of a parameter of type
IParameter.ParameterType.Object that are generated in a method
of the same parameter and are needed in a subsequent method of the same parameter. The graph then resolves the
dependencies by evaluating each parameter and generating their values if they are marked as generated or they are
of type IParameter.ParameterType.Object and their evaluation
creates instnaces that are either the target of the configuration markup or are used internally to instnatiate
other parameters. The dependency resolve process is terinated once all parameters are evaluated. If this process
cannot be completed due to either incomplete markup or because of cyclic references, the process stops with error.
TODO Handle dependencies of an ObjectParameter that are generated in a method of the parameter and are needed by a subsequent method of the same parameter
s * @author gpapanikos| Constructor and Description |
|---|
DependencyGraph(Map<String,IParameter> Params)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
Boolean |
AllChecked()
Checks if all
GraphElement entriues have been evaluated |
void |
ConstructGraph()
Creates the graph based on the provided parameters
|
void |
ResolveDependencies()
Resolved the graph nodes dependencies.
|
public DependencyGraph(Map<String,IParameter> Params)
Params - the parameters that can be used to retrieve and set valuespublic void ConstructGraph()
throws Exception
Exception - The graph could not be constructedpublic void ResolveDependencies()
throws Exception
GraphElement
nodes and evaluates their values. This process is repeated untill their is no GraphElement
that has not been succesfully evaluated. A GraphElement is evaluated only if all the
parameters that the GraphElement depends on have already been evaluated. If during
the process of a full iteration no GraphElement has been successfully evaluated, the
process stopsException - The dependencies could not be resolvedpublic Boolean AllChecked()
GraphElement entriues have been evaluatedtrue if all GraphElement entries are evaluated, false otherwiseCopyright © 2018. All Rights Reserved.