Package kilim.tools
Class Kilim
java.lang.Object
kilim.tools.Kilim
runtime 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanhas klass been wovenstatic voidprivate static String[]processArgs(String[] args) static voidrun static method className.method(args) using reflection and the WeavingClassLoaderstatic booleantrampoline(boolean check, String... args) run the calling (static) method in the WeavingClassLoader context intended to be used from mainstatic booleantrampoline(Object example, boolean check, 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, String... args) run the calling (static) method in the WeavingClassLoader context using the provided configprivate static voidusage()
-
Constructor Details
-
Kilim
public Kilim()
-
-
Method Details
-
main
- Throws:
Exception
-
run
run static method className.method(args) using reflection and the WeavingClassLoader- Throws:
Exception
-
trampoline
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:
RuntimeException- (wrapping for checked) Exceptions from the method callSecurityException- cascaded from Class.getField
-
trampoline
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:
RuntimeException- (wrapping for checked) Exceptions from the method callSecurityException- cascaded from Class.getField
-
trampoline
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
has klass been woven- Parameters:
klass- the class to check- Returns:
- true if it has been woven
- Throws:
SecurityException- cascaded from Class.getField
-
usage
private static void usage() -
processArgs
-