if (!PipingRules.enabled)
return false;
- if (requestUpdates.size() == 0)
- return false;
-
- List<PipeControlPoint> temp = new ArrayList<PipeControlPoint>(requestUpdates.size());
- synchronized(updateMutex) {
+ List<PipeControlPoint> temp;
+ synchronized(updateMutex) {
+ if (requestUpdates.size() == 0)
+ return false;
+
+ temp = new ArrayList<PipeControlPoint>(requestUpdates.size());
temp.addAll(requestUpdates);
requestUpdates.clear();
}
public static void validate(PipeRun pipeRun) {
if (pipeRun == null)
return;
- Collection<PipeControlPoint> pcps = pipeRun.getControlPoints();
- int count = 0;
- //System.out.println("Validate " + pipeRun.getName());
- for (PipeControlPoint pcp : pcps) {
- if (pcp.getParentPoint() == null || pcp.getParentPoint().getPipeRun() != pipeRun)
- count++;
- }
- List<PipeControlPoint> runPcps = getControlPoints(pipeRun);
- if (runPcps.size() != count) {
- System.out.println("Run " + pipeRun.getName() + " contains unconnected control points, found " + runPcps.size() + " connected, " + pcps.size() + " total.");
+ synchronized (ruleMutex) {
+ Collection<PipeControlPoint> pcps = pipeRun.getControlPoints();
+ int count = 0;
+ //System.out.println("Validate " + pipeRun.getName());
for (PipeControlPoint pcp : pcps) {
- if (!runPcps.contains(pcp)) {
- System.out.println("Unconnected " + pcp + " " + pcp.getPipelineComponent());
- }
+ if (pcp.getParentPoint() == null || pcp.getParentPoint().getPipeRun() != pipeRun)
+ count++;
}
- }
- for (PipeControlPoint pcp : pcps) {
- if (pcp.getPipeRun() == null) {
- System.out.println("PipeRun ref missing " + pcp + " " + pcp.getPipelineComponent());
- }
- if (!pcp.isDirected() && pcp.getNext() == null && pcp.getPrevious() == null)
- System.out.println("Orphan undirected " + pcp + " " + pcp.getPipelineComponent());
- }
- for (PipeControlPoint pcp : pcps) {
- if (pcp.getParentPoint() == null) {
- PipeControlPoint sub = null;
- if (pcp.isDualInline())
- sub = pcp.getDualSub();
- PipeControlPoint next = pcp.getNext();
- PipeControlPoint prev = pcp.getPrevious();
- if (next != null) {
- if (!(next.getPrevious() == pcp || next.getPrevious() == sub)) {
- System.out.println("Inconsistency between " + pcp + " -> " +next );
- }
+ List<PipeControlPoint> runPcps = getControlPoints(pipeRun);
+ if (runPcps.size() != count) {
+ System.out.println("Run " + pipeRun.getName() + " contains unconnected control points, found " + runPcps.size() + " connected, " + pcps.size() + " total.");
+ for (PipeControlPoint pcp : pcps) {
+ if (!runPcps.contains(pcp)) {
+ System.out.println("Unconnected " + pcp + " " + pcp.getPipelineComponent());
+ }
}
- if (prev != null) {
- PipeControlPoint prevParent = null;
- if (prev.isDualSub()) {
- prevParent = prev.getParentPoint();
- } else if (prev.isDualInline()) {
- System.out.println("Inconsistency between " + pcp + " <-- " +prev );
+ }
+ for (PipeControlPoint pcp : pcps) {
+ if (pcp.getPipeRun() == null) {
+ System.out.println("PipeRun ref missing " + pcp + " " + pcp.getPipelineComponent());
+ }
+ if (!pcp.isDirected() && pcp.getNext() == null && pcp.getPrevious() == null)
+ System.out.println("Orphan undirected " + pcp + " " + pcp.getPipelineComponent());
+ }
+ for (PipeControlPoint pcp : pcps) {
+ if (pcp.getParentPoint() == null) {
+ PipeControlPoint sub = null;
+ if (pcp.isDualInline())
+ sub = pcp.getDualSub();
+ PipeControlPoint next = pcp.getNext();
+ PipeControlPoint prev = pcp.getPrevious();
+ if (next != null) {
+ if (!(next.getPrevious() == pcp || next.getPrevious() == sub)) {
+ System.out.println("Inconsistency between " + pcp + " -> " +next );
+ }
}
- if (!(prev.getNext() == pcp && (prevParent == null || prevParent.getNext() == pcp))) {
- System.out.println("Inconsistency between " + pcp + " <-- " +prev );
+ if (prev != null) {
+ PipeControlPoint prevParent = null;
+ if (prev.isDualSub()) {
+ prevParent = prev.getParentPoint();
+ } else if (prev.isDualInline()) {
+ System.out.println("Inconsistency between " + pcp + " <-- " +prev );
+ }
+ if (!(prev.getNext() == pcp && (prevParent == null || prevParent.getNext() == pcp))) {
+ System.out.println("Inconsistency between " + pcp + " <-- " +prev );
+ }
}
}
}