org.sourceforge.jemm.weaver.analysis
Class DependencyManager

java.lang.Object
  extended by org.sourceforge.jemm.weaver.analysis.DependencyManager

public class DependencyManager
extends java.lang.Object

Supports the dependencies between various transformations and determines the correct execution order.

Author:
Paul Keeble

Constructor Summary
DependencyManager()
          Creates a DependencyManager instance.
 
Method Summary
 void addTransformation(Transformation ct)
          Adds a transformation to the set for which dependencies are determined.
 void executeDependents(Transformation t, javassist.CtClass c, javassist.CtClass proxy)
          Executes all the dependents of the ClassTransformation so that t can be executed.
 Transformation findTransform(java.lang.String clazz)
          Finds the instance of the passed in class.
 TransformationChain getCompleteChain()
           
 java.util.List<Transformation> getDependencyTree(Transformation t)
          Gets the list of dependencies that need to be executed before t can be run.
 java.util.Set<Transformation> getTransformations()
          Retrieves all the transformations.
 void removeTransformation(Transformation ct)
          Removes the instance from the transformation list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DependencyManager

public DependencyManager()
Creates a DependencyManager instance.

Method Detail

addTransformation

public void addTransformation(Transformation ct)
Adds a transformation to the set for which dependencies are determined. Inserting the same transformation again will do nothing.

Parameters:
ct - The transformation to add

removeTransformation

public void removeTransformation(Transformation ct)
Removes the instance from the transformation list.

Parameters:
ct - The transformation to remove

getTransformations

public java.util.Set<Transformation> getTransformations()
Retrieves all the transformations.

Returns:
The list of transformations

executeDependents

public void executeDependents(Transformation t,
                              javassist.CtClass c,
                              javassist.CtClass proxy)
Executes all the dependents of the ClassTransformation so that t can be executed.

Parameters:
t - The Transformation to find the dependencies from
c - The class to transform
Throws:
InvalidDependencyTreeException - If the ordering can not be determined, such as when a transformations dependencies have not been added.

getDependencyTree

public java.util.List<Transformation> getDependencyTree(Transformation t)
Gets the list of dependencies that need to be executed before t can be run.

Parameters:
t - The transformation that dependencies are needed for.
Returns:
An in order list of the dependent transforms

findTransform

public Transformation findTransform(java.lang.String clazz)
Finds the instance of the passed in class. Note this uses the exact class and not instanceof so subclasses will not be found.

Parameters:
clazz - the class to search for
Returns:
The transformation
Throws:
InvalidDependencyTreeException - If no such transformation can be found

getCompleteChain

public TransformationChain getCompleteChain()


Copyright © 2009. All Rights Reserved.