Search in sources :

Example 1 with ArchiveContext

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

the class AbstractScannerImpl method scan.

@Override
public ScanResult scan(ScanEnvironment environment, ScanOptions options, ScanParameters parameters) {
    final ScanResultCollector collector = new ScanResultCollector(environment, options, parameters);
    if (environment.getNonRootUrls() != null) {
        final ArchiveContext context = new ArchiveContextImpl(false, collector);
        for (URL url : environment.getNonRootUrls()) {
            final ArchiveDescriptor descriptor = buildArchiveDescriptor(url, environment, false);
            descriptor.visitArchive(context);
        }
    }
    if (environment.getRootUrl() != null) {
        final ArchiveContext context = new ArchiveContextImpl(true, collector);
        final ArchiveDescriptor descriptor = buildArchiveDescriptor(environment.getRootUrl(), environment, true);
        descriptor.visitArchive(context);
    }
    return collector.toScanResult();
}
Also used : ScanResultCollector(org.hibernate.boot.archive.scan.internal.ScanResultCollector) ArchiveContext(org.hibernate.boot.archive.spi.ArchiveContext) ArchiveDescriptor(org.hibernate.boot.archive.spi.ArchiveDescriptor) URL(java.net.URL)

Aggregations

URL (java.net.URL)1 ScanResultCollector (org.hibernate.boot.archive.scan.internal.ScanResultCollector)1 ArchiveContext (org.hibernate.boot.archive.spi.ArchiveContext)1 ArchiveDescriptor (org.hibernate.boot.archive.spi.ArchiveDescriptor)1