public static Class defineClass(String className, byte[] b, ClassLoader loader, ProtectionDomain protectionDomain) throws Exception { return defineClass(className, b, loader, protectionDomain, null); }
public static Class defineClass(String className, byte[] b, ClassLoader loader) throws Exception { return defineClass(className, b, loader, null, null); }
public static Class defineClass(String className, byte[] b, ClassLoader loader, ProtectionDomain protectionDomain) throws Exception { return defineClass(className, b, loader, protectionDomain, null); }
public static Class defineClass(String className, byte[] b, ClassLoader loader) throws Exception { return defineClass(className, b, loader, null, null); }
synchronized (classLoader) { // just in case gen = ReflectUtils.defineClass(className, b, classLoader, protectionDomain, contextClass);
synchronized (classLoader) { // just in case gen = ReflectUtils.defineClass(className, b, classLoader, protectionDomain, contextClass);
public static Class defineClass(String className, byte[] b, ClassLoader loader, ProtectionDomain protectionDomain) throws Exception { return defineClass(className, b, loader, protectionDomain, null); }
public static Class defineClass(String className, byte[] b, ClassLoader loader) throws Exception { return defineClass(className, b, loader, null, null); }
/** * Generate a new class for the given {@link PersistentEntity}. */ static Class<?> generateCustomAccessorClass(PersistentEntity<?, ?> entity) { String className = generateClassName(entity); byte[] bytecode = generateBytecode(className.replace('.', '/'), entity); Class<?> type = entity.getType(); try { return ReflectUtils.defineClass(className, bytecode, type.getClassLoader(), type.getProtectionDomain(), type); } catch (Exception e) { throw new IllegalStateException(e); } }
/** * Generate a new class for the given {@link PersistentEntity}. * * @param entity * @param constructor * @return */ public Class<?> generateCustomInstantiatorClass(PersistentEntity<?, ?> entity, @Nullable PreferredConstructor<?, ?> constructor) { String className = generateClassName(entity); byte[] bytecode = generateBytecode(className, entity, constructor); Class<?> type = entity.getType(); try { return ReflectUtils.defineClass(className, bytecode, type.getClassLoader(), type.getProtectionDomain(), type); } catch (Exception e) { throw new IllegalStateException(e); } }
return defineClass(className, b, loader, null, null); ProtectionDomain protectionDomain) throws Exception { return defineClass(className, b, loader, protectionDomain, null);
synchronized (classLoader) { // just in case gen = ReflectUtils.defineClass(className, b, classLoader, protectionDomain, contextClass);