/** * Based on optional properties, create a new MethodFactory. By default, * this will create a code-generation-based InvocationMethodFactory. If * security restricts code generation, ReflectionMethodFactory will be used. * If we are dumping class definitions, DumpingInvocationMethodFactory will * be used. See MethodFactory's static initializer for more details. * * @param classLoader The classloader to use for searching for and * dynamically loading code. * @return A new MethodFactory. */ public static MethodFactory createFactory(ClassLoader classLoader) { // otherwise, generate invokers at runtime if (Options.INVOKEDYNAMIC_HANDLES.load()) { return new InvokeDynamicMethodFactory(classLoader); } else { return new InvocationMethodFactory(classLoader); } }
/** * Based on optional properties, create a new MethodFactory. By default, * this will create a code-generation-based InvocationMethodFactory. If * security restricts code generation, ReflectionMethodFactory will be used. * If we are dumping class definitions, DumpingInvocationMethodFactory will * be used. See MethodFactory's static initializer for more details. * * @param classLoader The classloader to use for searching for and * dynamically loading code. * @return A new MethodFactory. */ public static MethodFactory createFactory(ClassLoader classLoader) { // otherwise, generate invokers at runtime if (Options.INVOKEDYNAMIC_HANDLES.load()) { return new InvokeDynamicMethodFactory(classLoader); } else { return new InvocationMethodFactory(classLoader); } }
/** * Based on optional properties, create a new MethodFactory. By default, * this will create a code-generation-based InvocationMethodFactory. If * security restricts code generation, ReflectionMethodFactory will be used. * If we are dumping class definitions, DumpingInvocationMethodFactory will * be used. See MethodFactory's static initializer for more details. * * @param classLoader The classloader to use for searching for and * dynamically loading code. * @return A new MethodFactory. */ public static MethodFactory createFactory(ClassLoader classLoader) { // if reflection is forced or we've determined that we can't load bytecode, use reflection if (reflection || !CAN_LOAD_BYTECODE) return new ReflectionMethodFactory(); // otherwise, generate invokers at runtime if (Options.COMPILE_INVOKEDYNAMIC.load() && Options.INVOKEDYNAMIC_HANDLES.load()) { return new InvokeDynamicMethodFactory(classLoader); } else { return new InvocationMethodFactory(classLoader); } }
/** * Based on optional properties, create a new MethodFactory. By default, * this will create a code-generation-based InvocationMethodFactory. If * security restricts code generation, ReflectionMethodFactory will be used. * If we are dumping class definitions, DumpingInvocationMethodFactory will * be used. See MethodFactory's static initializer for more details. * * @param classLoader The classloader to use for searching for and * dynamically loading code. * @return A new MethodFactory. */ public static MethodFactory createFactory(ClassLoader classLoader) { // if reflection is forced or we've determined that we can't load bytecode, use reflection if (reflection || !CAN_LOAD_BYTECODE) return new ReflectionMethodFactory(); // otherwise, generate invokers at runtime if (Options.COMPILE_INVOKEDYNAMIC.load() && Options.INVOKEDYNAMIC_HANDLES.load()) { return new InvokeDynamicMethodFactory(classLoader); } else { return new InvocationMethodFactory(classLoader); } }