Package kilim.tools
Class Weaver
java.lang.Object
kilim.tools.Weaver
This class supports both command-line and run time weaving of Kilim bytecode.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static String[]static int(package private) static boolean(package private) static StringgetDirName(String className) (package private) static voidhelp()static voidUsage: java kilim.tools.Weaver -d <output directory> {source classe, jar, directory ...}(package private) static voidweave(InputStream is) Analyzes the list of supplied classes and inserts Kilim-related bytecode if necessary.voidweaveFile(String name, InputStream is) static voidwriteClass(ClassInfo ci) (package private) static void
-
Field Details
-
outputDir
-
verbose
public static boolean verbose -
force
public static boolean force -
proxy
public static boolean proxy -
excludePattern
-
err
static int err -
context
-
-
Constructor Details
-
Weaver
-
-
Method Details
-
main
Usage: java kilim.tools.Weaver -d <output directory> {source classe, jar, directory ...}If directory names or jar files are given, all classes in that container are processed. It is perfectly fine to specify the same directory for source and output like this:java kilim.tools.Weaver -d ./classes ./classesby default, each element is added to the classpath (use -c to suppress classpath augmentation) arguments:- -d directory: write output to directory (required)
- -f: force, write output even if output file is newer than source
- -c: don't add source class list to the classpath
- -h: print help info
- -q: quiet
- -x regex: exclude, skip classes matching regex
- Throws:
IOException- See Also:
-
concat
-
doMain
- Throws:
IOException
-
exclude
-
weave
-
weaveFile
- Throws:
IOException
-
writeClasses
- Throws:
IOException
-
writeClass
- Throws:
IOException
-
mkdir
- Throws:
IOException
-
getDirName
-
help
static void help() -
parseArgs
- Throws:
IOException
-
weave
Analyzes the list of supplied classes and inserts Kilim-related bytecode if necessary. If a supplied class is dependent upon another class X, it is the caller's responsibility to ensure that X is either in the classpath, or loaded by the context classloader, or has been seen in an earlier invocation of weave(). Since weave() remembers method signatures from earlier invocations, the woven classes do not have to be classloaded to help future invocations of weave. If two classes A and B are not in the classpath, and are mutually recursive, they can be woven only if supplied in the same input list. This method is thread safe.- Parameters:
classes- A list of (className, byte[]) pairs. The first part is a fully qualified class name, and the second part is the bytecode for the class.- Returns:
- A list of (className, byte[]) pairs. Some of the classes may or may not have been modified, and new ones may be added.
- Throws:
KilimExceptionIOException
-