Package kilim.tools

Class Kilim

java.lang.Object
kilim.tools.Kilim

public class Kilim extends Object
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
    Modifier and Type
    Class
    Description
    static class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isWoven(Class klass)
    has klass been woven
    static void
    main(String[] args)
     
    private static String[]
     
    static void
    run(String className, String method, String... args)
    run static method className.method(args) using reflection and the WeavingClassLoader
    static boolean
    trampoline(boolean check, String... args)
    run the calling (static) method in the WeavingClassLoader context intended to be used from main
    static boolean
    trampoline(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 main
    static boolean
    trampoline(Kilim.Config config, String... args)
    run the calling (static) method in the WeavingClassLoader context using the provided config
    private static void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Kilim

      public Kilim()
  • Method Details

    • main

      public static void main(String[] args) throws Exception
      Throws:
      Exception
    • run

      public static void run(String className, String method, String... args) throws Exception
      run static method className.method(args) using reflection and the WeavingClassLoader
      Throws:
      Exception
    • trampoline

      public static boolean trampoline(boolean check, 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 return
      args - 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 call
      SecurityException - cascaded from Class.getField
    • trampoline

      public static boolean trampoline(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 main
      Parameters:
      example - an object or a Class that has been loaded by the desired classloader
      check - if the class is already woven then just return
      args - 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 call
      SecurityException - cascaded from Class.getField
    • trampoline

      public static boolean trampoline(Kilim.Config config, String... args)
      run the calling (static) method in the WeavingClassLoader context using the provided config
      Parameters:
      config - the config
      args - the args to pass to the method
      Returns:
      true if the trampoline was called and returned
    • isWoven

      public static boolean isWoven(Class klass)
      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

      private static String[] processArgs(String[] args)