Package kilim.tools
Class Kilim
- java.lang.Object
-
- kilim.tools.Kilim
-
public class Kilim extends java.lang.Objectruntime weaver This class dynamically weaves kilim-related classes and runs "class". Invoke as java kilim.tools.Kilim class args... if -Dkilim.class.path="classDir1:classDir2:jar1.jar:..." is supplied then runtime weaving will be limited to those paths otherwise, everything on the classpath will be analyzed and woven if needed a main method can also call the trampoline to trigger automatic weaving if needed
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classKilim.Config
-
Constructor Summary
Constructors Constructor Description Kilim()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisWoven(java.lang.Class klass)has klass been wovenstatic voidmain(java.lang.String[] args)private static java.lang.String[]processArgs(java.lang.String[] args)static voidrun(java.lang.String className, java.lang.String method, java.lang.String... args)run static method className.method(args) using reflection and the WeavingClassLoaderstatic booleantrampoline(boolean check, java.lang.String... args)run the calling (static) method in the WeavingClassLoader context intended to be used from mainstatic booleantrampoline(java.lang.Object example, boolean check, java.lang.String... args)run the calling (static) method in the WeavingClassLoader context using the classloader that was used to load example intended to be used from mainstatic booleantrampoline(Kilim.Config config, java.lang.String... args)run the calling (static) method in the WeavingClassLoader context using the provided configprivate static voidusage()
-
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception- Throws:
java.lang.Exception
-
run
public static void run(java.lang.String className, java.lang.String method, java.lang.String... args) throws java.lang.Exceptionrun static method className.method(args) using reflection and the WeavingClassLoader- Throws:
java.lang.Exception
-
trampoline
public static boolean trampoline(boolean check, java.lang.String... args)run the calling (static) method in the WeavingClassLoader context intended to be used from main- Parameters:
check- if the class is already woven then just returnargs- to be passed to the target method- Returns:
- true if the trampoline was called and returned
- Throws:
java.lang.RuntimeException- (wrapping for checked) Exceptions from the method calljava.lang.SecurityException- cascaded from Class.getField
-
trampoline
public static boolean trampoline(java.lang.Object example, boolean check, java.lang.String... args)run the calling (static) method in the WeavingClassLoader context using the classloader that was used to load example intended to be used from main- Parameters:
example- an object or a Class that has been loaded by the desired classloadercheck- if the class is already woven then just returnargs- to be passed to the target method- Returns:
- true if the trampoline was called and returned
- Throws:
java.lang.RuntimeException- (wrapping for checked) Exceptions from the method calljava.lang.SecurityException- cascaded from Class.getField
-
trampoline
public static boolean trampoline(Kilim.Config config, java.lang.String... args)
run the calling (static) method in the WeavingClassLoader context using the provided config- Parameters:
config- the configargs- the args to pass to the method- Returns:
- true if the trampoline was called and returned
-
isWoven
public static boolean isWoven(java.lang.Class klass)
has klass been woven- Parameters:
klass- the class to check- Returns:
- true if it has been woven
- Throws:
java.lang.SecurityException- cascaded from Class.getField
-
usage
private static void usage()
-
processArgs
private static java.lang.String[] processArgs(java.lang.String[] args)
-
-