private SpelCompiler(@Nullable ClassLoader classloader) { this.ccl = new ChildClassLoader(classloader); }
private SpelCompiler(@Nullable ClassLoader classloader) { this.ccl = new ChildClassLoader(classloader); }
/** * Load a compiled expression class. Makes sure the classloaders aren't used too much * because they anchor compiled classes in memory and prevent GC. If you have expressions * continually recompiling over time then by replacing the classloader periodically * at least some of the older variants can be garbage collected. * @param name name of the class * @param bytes bytecode for the class * @return the Class object for the compiled expression */ @SuppressWarnings("unchecked") private Class<? extends CompiledExpression> loadClass(String name, byte[] bytes) { if (this.ccl.getClassesDefinedCount() > CLASSES_DEFINED_LIMIT) { this.ccl = new ChildClassLoader(this.ccl.getParent()); } return (Class<? extends CompiledExpression>) this.ccl.defineClass(name, bytes); }
/** * Load a compiled expression class. Makes sure the classloaders aren't used too much * because they anchor compiled classes in memory and prevent GC. If you have expressions * continually recompiling over time then by replacing the classloader periodically * at least some of the older variants can be garbage collected. * @param name name of the class * @param bytes bytecode for the class * @return the Class object for the compiled expression */ @SuppressWarnings("unchecked") private Class<? extends CompiledExpression> loadClass(String name, byte[] bytes) { if (this.ccl.getClassesDefinedCount() > CLASSES_DEFINED_LIMIT) { this.ccl = new ChildClassLoader(this.ccl.getParent()); } return (Class<? extends CompiledExpression>) this.ccl.defineClass(name, bytes); }
/** * Load a compiled expression class. Makes sure the classloaders aren't used too much * because they anchor compiled classes in memory and prevent GC. If you have expressions * continually recompiling over time then by replacing the classloader periodically * at least some of the older variants can be garbage collected. * @param name name of the class * @param bytes bytecode for the class * @return the Class object for the compiled expression */ @SuppressWarnings("unchecked") private Class<? extends CompiledExpression> loadClass(String name, byte[] bytes) { if (this.ccl.getClassesDefinedCount() > CLASSES_DEFINED_LIMIT) { this.ccl = new ChildClassLoader(this.ccl.getParent()); } return (Class<? extends CompiledExpression>) this.ccl.defineClass(name, bytes); }
private SpelCompiler(@Nullable ClassLoader classloader) { this.ccl = new ChildClassLoader(classloader); }