|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthudson.model.DependencyGraph
public class DependencyGraph
Maintains the build dependencies between AbstractProject
s
for efficient dependency computation.
The "master" data of dependencies are owned/persisted/maintained by
individual AbstractProject
s, but because of that, it's relatively
slow to compute backward edges.
This class builds the complete bi-directional dependency graph
by collecting information from all AbstractProject
s.
Once built, DependencyGraph
is immutable, and every time
there's a change (which is relatively rare), a new instance
will be created. This eliminates the need of synchronization.
Jenkins.getDependencyGraph()
Nested Class Summary | |
---|---|
static class |
DependencyGraph.Dependency
Represents an edge in the dependency graph. |
Field Summary | |
---|---|
static DependencyGraph |
EMPTY
|
Constructor Summary | |
---|---|
DependencyGraph()
Builds the dependency graph. |
Method Summary | ||
---|---|---|
void |
addDependency(AbstractProject upstream,
AbstractProject downstream)
Deprecated. since 1.341; use addDependency(Dependency) |
|
void |
addDependency(AbstractProject upstream,
Collection<? extends AbstractProject> downstream)
Deprecated. since 1.341 |
|
void |
addDependency(Collection<? extends AbstractProject> upstream,
AbstractProject downstream)
Deprecated. since 1.341 |
|
void |
addDependency(DependencyGraph.Dependency dep)
Called during the dependency graph build phase to add a dependency edge. |
|
void |
addDependencyDeclarers(AbstractProject upstream,
Collection<?> possibleDependecyDeclarers)
Lists up DependencyDeclarer from the collection and let them builds dependencies. |
|
void |
build()
|
|
int |
compare(AbstractProject o1,
AbstractProject o2)
Compare to Projects based on the topological order defined by this Dependency Graph |
|
|
getComputationalData(Class<T> key)
Gets temporary data which is needed for building up the dependency graph. |
|
List<AbstractProject> |
getDownstream(AbstractProject p)
Gets all the immediate downstream projects (IOW forward edges) of the given project. |
|
List<DependencyGraph.Dependency> |
getDownstreamDependencies(AbstractProject p)
|
|
Set<AbstractProject> |
getTransitiveDownstream(AbstractProject src)
Gets all the direct and indirect downstream dependencies of the given project. |
|
Set<AbstractProject> |
getTransitiveUpstream(AbstractProject src)
Gets all the direct and indirect upstream dependencies of the given project. |
|
List<AbstractProject> |
getUpstream(AbstractProject p)
Gets all the immediate upstream projects (IOW backward edges) of the given project. |
|
List<DependencyGraph.Dependency> |
getUpstreamDependencies(AbstractProject p)
|
|
boolean |
hasIndirectDependencies(AbstractProject src,
AbstractProject dst)
Returns true if a project has a non-direct dependency to another project. |
|
|
putComputationalData(Class<T> key,
T value)
Adds data which is useful for the time when the dependency graph is built up. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
---|
equals |
Field Detail |
---|
public static final DependencyGraph EMPTY
Constructor Detail |
---|
public DependencyGraph()
Method Detail |
---|
public void build()
public <T> void putComputationalData(Class<T> key, T value)
public <T> T getComputationalData(Class<T> key)
public List<AbstractProject> getDownstream(AbstractProject p)
public List<AbstractProject> getUpstream(AbstractProject p)
public List<DependencyGraph.Dependency> getDownstreamDependencies(AbstractProject p)
public List<DependencyGraph.Dependency> getUpstreamDependencies(AbstractProject p)
@Deprecated public void addDependency(AbstractProject upstream, AbstractProject downstream)
addDependency(Dependency)
public void addDependency(DependencyGraph.Dependency dep)
@Deprecated public void addDependency(AbstractProject upstream, Collection<? extends AbstractProject> downstream)
@Deprecated public void addDependency(Collection<? extends AbstractProject> upstream, AbstractProject downstream)
public void addDependencyDeclarers(AbstractProject upstream, Collection<?> possibleDependecyDeclarers)
DependencyDeclarer
from the collection and let them builds dependencies.
public boolean hasIndirectDependencies(AbstractProject src, AbstractProject dst)
A non-direct dependency is a path of dependency "edge"s from the source to the destination, where the length is greater than 1.
public Set<AbstractProject> getTransitiveUpstream(AbstractProject src)
public Set<AbstractProject> getTransitiveDownstream(AbstractProject src)
public int compare(AbstractProject o1, AbstractProject o2)
compare
in interface Comparator<AbstractProject>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |