use of org.glassfish.api.deployment.GeneratedResourceEntry in project Payara by payara.
the class WebappClassLoader method addResourceEntry.
@Override
public Class addResourceEntry(String name, String path, ResourceEntry entry) {
Class clazz = null;
if (!this.resourceEntries.containsKey(name)) {
definePackage(name, entry);
clazz = defineLoadedClass(name, entry);
this.resourceEntries.put(name, entry);
for (Map.Entry<String, GeneratedResourceEntry> e : entry.generatedResources.entrySet()) {
String generatedClassName = e.getKey();
GeneratedResourceEntry generatedEntry = e.getValue();
generatedEntry.loadedClass = defineClass(generatedClassName, generatedEntry.binaryContent, 0, generatedEntry.binaryContent.length, generatedEntry.protectionDomain);
}
}
return clazz;
}
use of org.glassfish.api.deployment.GeneratedResourceEntry in project Payara by payara.
the class WebappClassLoader method addGeneratedResourceEntry.
@Override
public Class addGeneratedResourceEntry(String mainClassName, String generatedClassName, byte[] generatedBinaryContent, ProtectionDomain protectionDomain) {
Class generatedClass;
if (this.resourceEntries.containsKey(mainClassName)) {
generatedClass = defineClass(generatedClassName, generatedBinaryContent, 0, generatedBinaryContent.length, protectionDomain);
GeneratedResourceEntry generatedResourceEntry = new GeneratedResourceEntry();
generatedResourceEntry.binaryContent = generatedBinaryContent;
generatedResourceEntry.loadedClass = generatedClass;
generatedResourceEntry.protectionDomain = protectionDomain;
ResourceEntry entry = this.resourceEntries.get(mainClassName);
entry.generatedResources.put(generatedClassName, generatedResourceEntry);
} else {
generatedClass = defineClass(generatedClassName, generatedBinaryContent, 0, generatedBinaryContent.length, protectionDomain);
}
return generatedClass;
}
Aggregations