Package org.apache.xbean.finder.archive

Examples of org.apache.xbean.finder.archive.Archive


            final IAnnotationFinder delegate = ((FinderFactory.ModuleLimitedFinder) finder).getDelegate();
            if (!(delegate instanceof AnnotationFinder)) return finder.getAnnotatedClassNames();

            final AnnotationFinder annotationFinder = (AnnotationFinder) delegate;

            final Archive archive = annotationFinder.getArchive();
            if (!(archive instanceof WebappAggregatedArchive)) return finder.getAnnotatedClassNames();

            final List<String> classes = new ArrayList<String>();

            final WebappAggregatedArchive aggregatedArchive = (WebappAggregatedArchive) archive;
View Full Code Here


        // creating the archive and its classloader
        //

        // war is different since it will contain a single descriptor for its lib too (not an ear)
        boolean war = "war".equals(packaging);
        final Archive archive;
        final URLClassLoader loader = createClassLoader(providedDependenciesClassLoader());
        if (war && useAggregatedArchiveIfWar) {
            archive = new ClasspathArchive(loader, loader.getURLs());
            getLog().info("using an aggregated archive");
        } else {
View Full Code Here

            if (!(finder instanceof AnnotationFinder)) return finder.getAnnotatedClassNames();

            final AnnotationFinder annotationFinder = (AnnotationFinder) finder;

            final Archive archive = annotationFinder.getArchive();

            if (!(archive instanceof AggregatedArchive)) return finder.getAnnotatedClassNames();

            final List<String> classes = new ArrayList<String>();
View Full Code Here

        for (URL url : urls) {

            final List<String> classes = new ArrayList<String>();

            final Archive archive = new FilteredArchive(ClasspathArchive.archive(loader, url), new Filter(){
                @Override
                public boolean accept(String name) {
                    classes.add(name);
                    return true;
                }
View Full Code Here

            if (!(finder instanceof AnnotationFinder)) return finder.getAnnotatedClassNames();

            final AnnotationFinder annotationFinder = (AnnotationFinder) finder;

            final Archive archive = annotationFinder.getArchive();

            if (!(archive instanceof AggregatedArchive)) return finder.getAnnotatedClassNames();

            final List<String> classes = new ArrayList<String>();
View Full Code Here

                if (urlByClasses == null) { // try to reuse scanning info, maybe some better indexing can be a nice idea
                    if (finder instanceof FinderFactory.ModuleLimitedFinder) {
                        final IAnnotationFinder limitedFinder = ((FinderFactory.ModuleLimitedFinder) finder).getDelegate();
                        if (limitedFinder instanceof AnnotationFinder) {
                            final Archive archive = ((AnnotationFinder) limitedFinder).getArchive();
                            if (archive instanceof WebappAggregatedArchive) {
                                final Map<URL, List<String>> index = ((WebappAggregatedArchive) archive).getClassesMap();
                                urlByClasses = new HashMap<String, String>();
                                for (final Map.Entry<URL, List<String>> entry : index.entrySet()) {
                                    final String url = entry.getKey().toExternalForm();
View Full Code Here

            // force cast otherwise we would be broken
            final IAnnotationFinder delegate = FinderFactory.ModuleLimitedFinder.class.isInstance(finder) ?
                FinderFactory.ModuleLimitedFinder.class.cast(finder).getDelegate() : finder;
            final AnnotationFinder annotationFinder = AnnotationFinder.class.cast(delegate);

            final Archive archive = annotationFinder.getArchive();
            final List<String> classes = new ArrayList<String>(500);

            if (!WebappAggregatedArchive.class.isInstance(archive)) {
                return annotationFinder.getAnnotatedClassNames();
            }
View Full Code Here

                return new ClassesArchive();
            }

            // read descriptors
            final ScanUtil.ScanHandler scan = ScanUtil.read(scanXml);
            final Archive packageArchive = packageArchive(scan.getPackages(), loader, location);
            final Archive classesArchive = classesArchive(scan.getPackages(), scan.getClasses(), loader);

            if (packageArchive != null && classesArchive != null) {
                return new CompositeArchive(classesArchive, packageArchive);
            } else if (packageArchive != null) {
                return packageArchive;
View Full Code Here

            }
        }

        for (final URL url : urls) {
            final List<String> classes = new ArrayList<String>();
            final Archive archive = new FilteredArchive(new ConfigurableClasspathArchive(module.getClassLoader(), Arrays.asList(url)), new ScanXmlSaverFilter(scanXmlExists, handler, classes));
            map.put(url, classes);
            archives.add(archive);
        }

        archive = new CompositeArchive(archives);
View Full Code Here

                if (urlByClasses == null) { // try to reuse scanning info, maybe some better indexing can be a nice idea
                    if (finder instanceof FinderFactory.ModuleLimitedFinder) {
                        final IAnnotationFinder limitedFinder = ((FinderFactory.ModuleLimitedFinder) finder).getDelegate();
                        if (limitedFinder instanceof AnnotationFinder) {
                            final Archive archive = ((AnnotationFinder) limitedFinder).getArchive();
                            if (archive instanceof WebappAggregatedArchive) {
                                final Map<URL, List<String>> index = ((WebappAggregatedArchive) archive).getClassesMap();
                                urlByClasses = new HashMap<String, String>();
                                for (final Map.Entry<URL, List<String>> entry : index.entrySet()) {
                                    final String url = entry.getKey().toExternalForm();
View Full Code Here

TOP

Related Classes of org.apache.xbean.finder.archive.Archive

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.