Search in sources :

Example 1 with JarFileEntryUrlAdjuster

use of org.hibernate.boot.archive.spi.JarFileEntryUrlAdjuster in project hibernate-orm by hibernate.

the class AbstractScannerImpl method buildArchiveDescriptor.

private ArchiveDescriptor buildArchiveDescriptor(URL url, ScanEnvironment environment, boolean isRootUrl) {
    final ArchiveDescriptor descriptor;
    final ArchiveDescriptorInfo descriptorInfo = archiveDescriptorCache.get(url);
    if (descriptorInfo == null) {
        if (!isRootUrl && archiveDescriptorFactory instanceof JarFileEntryUrlAdjuster) {
            url = ((JarFileEntryUrlAdjuster) archiveDescriptorFactory).adjustJarFileEntryUrl(url, environment.getRootUrl());
        }
        descriptor = archiveDescriptorFactory.buildArchiveDescriptor(url);
        archiveDescriptorCache.put(url, new ArchiveDescriptorInfo(descriptor, isRootUrl));
    } else {
        validateReuse(descriptorInfo, isRootUrl);
        descriptor = descriptorInfo.archiveDescriptor;
    }
    return descriptor;
}
Also used : JarFileEntryUrlAdjuster(org.hibernate.boot.archive.spi.JarFileEntryUrlAdjuster) ArchiveDescriptor(org.hibernate.boot.archive.spi.ArchiveDescriptor)

Aggregations

ArchiveDescriptor (org.hibernate.boot.archive.spi.ArchiveDescriptor)1 JarFileEntryUrlAdjuster (org.hibernate.boot.archive.spi.JarFileEntryUrlAdjuster)1