Class ClassInjector.UsingReflection.Dispatcher.Direct.ForLegacyVm

    • Constructor Detail

      • ForLegacyVm

        protected ForLegacyVm​(java.lang.reflect.Method findLoadedClass,
                              java.lang.reflect.Method defineClass,
                              java.lang.reflect.Method getDefinedPackage,
                              java.lang.reflect.Method getPackage,
                              java.lang.reflect.Method definePackage)
        Creates a new resolved reflection store for a VM prior to Java 8.
        Parameters:
        findLoadedClass - An instance of ClassLoader.findLoadedClass(String).
        defineClass - An instance of ClassLoader.defineClass(String, byte[], int, int, ProtectionDomain).
        getDefinedPackage - An instance of java.lang.ClassLoader#getDefinedPackage(String). May be null.
        getPackage - An instance of ClassLoader.getPackage(String).
        definePackage - An instance of ClassLoader.definePackage(String, String, String, String, String, String, String, URL).
    • Method Detail

      • getClassLoadingLock

        public java.lang.Object getClassLoadingLock​(java.lang.ClassLoader classLoader,
                                                    java.lang.String name)
        Returns the lock for loading the specified class.
        Parameters:
        classLoader - the class loader to inject the class into.
        name - The name of the class.
        Returns:
        The lock for loading this class.