use of org.glassfish.javaee.full.deployment.EarClassLoader in project Payara by payara.
the class HandlerChainHandler method getHandlerFileStream.
private InputStream getHandlerFileStream(AnnotationInfo annInfo, String relativePath, String handlerFile) {
InputStream handlerFileStream = null;
ClassLoader appCl = annInfo.getProcessingContext().getProcessingInput().getClassLoader();
if (appCl instanceof EarClassLoader) {
EarClassLoader earCl = (EarClassLoader) appCl;
String moduleName = FileUtils.revertFriendlyFilenameExtension(annInfo.getProcessingContext().getArchive().getName());
ClassLoader moduleCl = earCl.getModuleClassLoader(moduleName);
handlerFileStream = moduleCl.getResourceAsStream(relativePath == null ? handlerFile : relativePath + "/" + handlerFile);
}
if (handlerFileStream == null) {
handlerFileStream = appCl.getResourceAsStream(relativePath == null ? handlerFile : relativePath + "/" + handlerFile);
}
return handlerFileStream;
}
Aggregations