Class WatcheeInstrumentor

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

      • WatcheeInstrumentor

        public WatcheeInstrumentor()
    • Method Detail

      • addFieldToWatch

        public void addFieldToWatch​(String className,
                                    String fieldName)
        Adds the named field in the named class as a field to watch.
        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.
        path -
      • instrument

        public void instrument​(String classpath)
        Instrument the fields and classes as Watchees searching the boot classpath as well as the specified classpath.
        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.
        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.
        className -
        whether or not the named class has been instrumented as a Watchee.
      • getInstrumented

        public static Set<String> getInstrumented()