dk.brics.xact.analysis
Class XMLAnalysis

java.lang.Object
  extended by dk.brics.xact.analysis.XMLAnalysis

public class XMLAnalysis
extends Object

Program analysis for XACT.

Running multiple analyses concurrently

Separate instances of XMLAnalysis can safely be run in parallel. However, because Soot does not support separate instances of itself running, the initial phase will lock soot.G.class to prevent interference. The remaining phases will run concurrently with other analyses.

Enabling concurrency in the analysis

To enable concurrency within one analysis, use setTaskRunner(XactTaskRunner) or setExecutorService(ExecutorService). The analysis will be single-threaded if neither method is called before starting the analysis.


Constructor Summary
XMLAnalysis(String soot_classpath, List<String> classes)
          Initializes XACT program analysis for the given classes.
 
Method Summary
 void analyze()
          Runs the analysis.
 void analyzeXMLGraphs(dk.brics.xact.analysis.flowgraph.FlowGraph g, dk.brics.xact.analysis.xmlgraph.XMLGraphBuilder b)
          Analyzes the XML graphs.
 dk.brics.xact.analysis.soot.TranslationResult buildFlowGraph()
          Builds the flow graph and finds schema URLs.
 dk.brics.xact.analysis.xmlgraph.XMLGraphBuilder buildXMLGraphs(dk.brics.xact.analysis.flowgraph.FlowGraph g)
          Builds the XML graphs.
 List<ErrorReport> getErrors()
           
 void loadClasses()
          Loads the class files.
 void printMessages()
           
 void printMessages(PrintStream out)
           
 void printMessages(PrintWriter out)
           
 void releaseSoot()
          Resets Soot.
 void setConfiguration(dk.brics.xact.analysis.config.Configuration config)
          Sets the Configuration object to be used in the analysis.
 void setDiagnostics(Diagnostics diag)
          Sets the Diagnostics object to receive event notifications.
 void setExecutorService(ExecutorService executor)
          Sets an ExecutorService used to perform parallelizable tasks.
 void setTaskRunner(dk.brics.xact.analysis.concurrent.XactTaskRunner tasks)
          Sets the XactTaskRunner used to perform parallelizable tasks.
 void transformFlowGraph(dk.brics.xact.analysis.flowgraph.FlowGraph g)
          Performs various transformations of the given flow graph.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLAnalysis

public XMLAnalysis(String soot_classpath,
                   List<String> classes)
Initializes XACT program analysis for the given classes. The first class is assumed to be the main class.

Parameters:
soot_classpath - the class path for the classes to be analyzed (if null, just use the normal class path)
classes - names of the classes to be analyzed
Method Detail

analyze

public void analyze()
Runs the analysis.

This method will lock soot.G.class during the initial phase.

One cannot use hotpsots when using this method. If hotspot statements are of interest, use the other more low-level methods.


analyzeXMLGraphs

public void analyzeXMLGraphs(dk.brics.xact.analysis.flowgraph.FlowGraph g,
                             dk.brics.xact.analysis.xmlgraph.XMLGraphBuilder b)
Analyzes the XML graphs.


buildFlowGraph

public dk.brics.xact.analysis.soot.TranslationResult buildFlowGraph()
Builds the flow graph and finds schema URLs. This method is not thread-safe (because of Soot).


buildXMLGraphs

public dk.brics.xact.analysis.xmlgraph.XMLGraphBuilder buildXMLGraphs(dk.brics.xact.analysis.flowgraph.FlowGraph g)
Builds the XML graphs.


getErrors

public List<ErrorReport> getErrors()

loadClasses

public void loadClasses()
Loads the class files. This method is not thread-safe (because of Soot).


printMessages

public void printMessages()

printMessages

public void printMessages(PrintStream out)

printMessages

public void printMessages(PrintWriter out)

releaseSoot

public void releaseSoot()
Resets Soot. Can be invoked after string analysis and flow graph construction.


setConfiguration

public void setConfiguration(dk.brics.xact.analysis.config.Configuration config)
Sets the Configuration object to be used in the analysis.


setDiagnostics

public void setDiagnostics(Diagnostics diag)
Sets the Diagnostics object to receive event notifications.


setExecutorService

public void setExecutorService(ExecutorService executor)
Sets an ExecutorService used to perform parallelizable tasks. This is equivalent to
 setTaskRunner(new ExecutorTaskRunner(executor));
 

Parameters:
executor - an executor service
See Also:
Executors, setTaskRunner(XactTaskRunner)

setTaskRunner

public void setTaskRunner(dk.brics.xact.analysis.concurrent.XactTaskRunner tasks)
Sets the XactTaskRunner used to perform parallelizable tasks.

Parameters:
tasks - the tasks runner
See Also:
setExecutorService(ExecutorService)

transformFlowGraph

public void transformFlowGraph(dk.brics.xact.analysis.flowgraph.FlowGraph g)
Performs various transformations of the given flow graph. Must be invoked before XML graph construction.



Copyright © 2005-2011 Aarhus University.