Class WatcheeInstrumentor

java.lang.Object
repast.simphony.engine.watcher.WatcheeInstrumentor

public class WatcheeInstrumentor extends Object
Instruments watchee classes to add the watcher notification mechanism.
Version:
$Revision$ $Date$
Author:
Nick Collier
  • Constructor Details

    • WatcheeInstrumentor

      public WatcheeInstrumentor()
  • Method Details

    • addFieldToWatch

      public void addFieldToWatch(String className, String fieldName)
      Adds the named field in the named class as a field to watch.
      Parameters:
      className - the field's class
      fieldName - the field to watch
    • addFieldToWatchFromWatcherPath

      public void addFieldToWatchFromWatcherPath(String path)
      Adds fields to watch from any @Watch annotations on any class that this finds in the specified path. The path can be a top level class directory of classes or a jar file.
      Parameters:
      path -
    • instrument

      public void instrument(String classpath)
      Instrument the fields and classes as Watchees searching the boot classpath as well as the specified classpath.
      Parameters:
      classpath -
    • instrument

      public void instrument(String classpath, Filter<String> filter)
      Instrument the watched classes. The watched classes are those derived from @Watch annotation found on the added paths set in addFieldtoWatchFromWatcherPaths, and any classes or classes and fields explicitly set in the other add methods. Only classes that pass the filter will be queried for the @Watch annotation.
      Parameters:
      classpath - the classpath to search for the classes to instrument
      filter -
    • isInstrumented

      public boolean isInstrumented(String className)
      Gets whether or not the named class has been instrumented as a Watchee.
      Parameters:
      className -
      Returns:
      whether or not the named class has been instrumented as a Watchee.
    • getInstrumented

      public static Set<String> getInstrumented()