Package repast.simphony.engine.watcher
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 Summary
Constructors Constructor Description WatcheeInstrumentor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFieldToWatch(String className, String fieldName)
Adds the named field in the named class as a field to watch.void
addFieldToWatchFromWatcherPath(String path)
Adds fields to watch from any @Watch annotations on any class that this finds in the specified path.static Set<String>
getInstrumented()
void
instrument(String classpath)
Instrument the fields and classes as Watchees searching the boot classpath as well as the specified classpath.void
instrument(String classpath, Filter<String> filter)
Instrument the watched classes.boolean
isInstrumented(String className)
Gets whether or not the named class has been instrumented as a Watchee.
-
-
-
Method Detail
-
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 classfieldName
- 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 instrumentfilter
-
-
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.
-
-