|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgr.uoa.di.madgik.commons.configuration.parameter.elements.graph.DependencyGraph
public class DependencyGraph
This class creates a graph representing the dependencies that are marked in the parsed configuration file.
The configuration markup allows parameter items to declare that they are dependant from other parameters if
they use their values. Typicaly the parameters that can declare such dependencies are those of type
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 Summary | |
|---|---|
DependencyGraph(java.util.Map<java.lang.String,IParameter> Params)
Creates a new instance |
|
| Method Summary | |
|---|---|
java.lang.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. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DependencyGraph(java.util.Map<java.lang.String,IParameter> Params)
Params - the parameters that can be used to retrieve and set values| Method Detail |
|---|
public void ConstructGraph()
throws java.lang.Exception
java.lang.Exception - The graph could not be constructed
public void ResolveDependencies()
throws java.lang.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 stops
java.lang.Exception - The dependencies could not be resolvedpublic java.lang.Boolean AllChecked()
GraphElement entriues have been evaluated
true if all GraphElement entries are evaluated, false otherwise
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||