Class ExecutionPlan


  • public class ExecutionPlan
    extends java.lang.Object
    A plan for executing Detectors on an application. Automatically assigns Detectors to passes and orders Detectors within each pass based on ordering constraints specified in the plugin descriptor(s).
    • Constructor Detail

      • ExecutionPlan

        public ExecutionPlan()
        Constructor. Creates an empty plan.
    • Method Detail

      • dispose

        public void dispose()
      • setDetectorFactoryChooser

        public void setDetectorFactoryChooser​(DetectorFactoryChooser factoryChooser)
        Set the DetectorFactoryChooser to use to select which detectors to enable. This must be called before any Plugins are added to the execution plan.
      • isActive

        public boolean isActive​(@DottedClassName
                                java.lang.String detectorClass)
      • isActive

        public boolean isActive​(java.lang.Class<? extends Detector> detectorClass)
      • build

        public void build()
                   throws OrderingConstraintException
        Build the execution plan. Using the ordering constraints specified in the plugin descriptor(s), assigns Detectors to passes and orders the Detectors within those passes.
        Throws:
        OrderingConstraintException
      • passIterator

        public java.util.Iterator<AnalysisPass> passIterator()
        Get an Iterator over the AnalysisPasses.
      • getNumPasses

        public int getNumPasses()
        Get the number of passes in the execution plan.
        Returns:
        the number of passes in the execution plan
      • copyTo

        private static <T> void copyTo​(java.util.Iterator<T> iter,
                                       java.util.Collection<T> dest)
      • buildConstraintGraph

        private ConstraintGraph buildConstraintGraph​(java.util.Map<java.lang.String,​DetectorNode> nodeMap,
                                                     java.util.Set<DetectorFactory> factorySet,
                                                     java.util.List<DetectorOrderingConstraint> constraintList)
        Build a constraint graph. This represents ordering constraints between Detectors. A topological sort of the constraint graph will yield a correct ordering of the detectors (which may mean either passes or an ordering within a single pass, depending on whether the constraints are inter-pass or intra-pass).
        Parameters:
        nodeMap - map to be populated with detector class names to constraint graph nodes for those detectors
        factorySet - build the graph using these DetectorFactories as nodes
        constraintList - List of ordering constraints
        Returns:
        the ConstraintGraph
      • getUnassignedSet

        private java.util.Set<DetectorFactory> getUnassignedSet()
      • assignToPass

        private void assignToPass​(DetectorFactory factory,
                                  AnalysisPass pass)
        Make a DetectorFactory a member of an AnalysisPass.
      • appendToPass

        private void appendToPass​(DetectorFactory factory,
                                  AnalysisPass pass)
        Append a DetectorFactory to the end position in an AnalysisPass. The DetectorFactory must be a member of the pass.
      • appendDetectorsToPass

        private void appendDetectorsToPass​(java.util.Collection<DetectorFactory> detectorSet,
                                           AnalysisPass pass)
      • print

        private void print()
      • main

        public static void main​(java.lang.String[] argv)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception