Package org.apache.xbean.finder.archive

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


    @Keys({@Key(value = "annotation.invalid.managedbean.webservice", type = KeyType.WARNING)})
    public AppModule testWebServiceWithManagedBean() {
        EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new ManagedBean(Red.class));
        EjbModule ejbModule = new EjbModule(ejbJar);
        ejbModule.setFinder(new AnnotationFinder(new ClassesArchive(Red.class)).link());

        AppModule appModule = new AppModule(ejbModule);
        return appModule;
    }
View Full Code Here


    public AppModule testWebServiceWithStateful() {
        final EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new StatelessBean(LocalBeanLocal.class));

        final EjbModule ejbModule = new EjbModule(ejbJar);
        ejbModule.setFinder(new AnnotationFinder(new ClassesArchive(LocalBeanLocal.class)));

        return new AppModule(ejbModule);
    }
View Full Code Here

@RunWith(ValidationRunner.class)
public class CheckCdiEnabledTest {
    @Keys(@Key(value = "cdi.notEnabled", type = KeyType.WARNING))
    public EjbModule cdiShouldBeOn() throws OpenEJBException {
        return new EjbModule(new EjbJar())
                .finder(new AnnotationFinder(new ClassesArchive(Bean1.class, Bean2.class)));
    }
View Full Code Here

        try {
            URL scanXml = new URLClassLoader(new URL[] { location }, new EmptyResourcesClassLoader()).getResource(name);
            if (scanXml == null && !forceDescriptor) {
                return ClasspathArchive.archive(loader, location);
            } else if (scanXml == null) {
                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;
            }
            return classesArchive;
        } catch (IOException e) {
            if (forceDescriptor) {
                return new ClassesArchive();
            }
            return ClasspathArchive.archive(loader, location);
        }
    }
View Full Code Here

            final Class<?>[] updatedClasses = new Class<?>[i];
            System.arraycopy(classes, 0, updatedClasses, 0, i);
            classes = updatedClasses;
        }

        return new ClassesArchive(classes);
    }
View Full Code Here

            // TODO:  Put our scanning ehnancements back, here
            fillEjbJar(webModule, webEjbModule);

            if (webModule.getFinder() == null) {
                if (isMetadataComplete(webModule, webEjbModule)) {
                    final IAnnotationFinder finder = new org.apache.xbean.finder.AnnotationFinder(new ClassesArchive());
                    webModule.setFinder(finder);
                    webEjbModule.setFinder(finder);
                } else {
                    final IAnnotationFinder finder = FinderFactory.createFinder(webModule);
                    webModule.setFinder(finder);
View Full Code Here

                    annotationFinder = af.select(names);
                    finder = af.select(clazz.getName());
                } else {
                    if (!dynamicBean) {
                        annotationFinder = createFinder(clazz);
                        finder = new AnnotationFinder(new ClassesArchive(clazz));
                    } else {
                        final Class<?>[] classes;
                        final Proxy proxy = metaClass.getAnnotation(Proxy.class);
                        if (proxy == null) {
                            classes = new Class<?>[] { clazz };
                        } else {
                            classes = new Class<?>[] { clazz, proxy.value() };
                        }
                        annotationFinder = createFinder(classes);
                        finder = new AnnotationFinder(new ClassesArchive(classes));
                    }
                }

                /*
                 * @PostConstruct
 
View Full Code Here

            Set<Class<?>> parents = new HashSet<Class<?>>();
            for (Class<?> clazz : classes) {
                parents.addAll(Classes.ancestors(clazz));
            }

            return new AnnotationFinder(new ClassesArchive(parents)).link();
        }
View Full Code Here

            } else {
                finder.enableMetaAnnotations(); // needed to stay compliant
                enableSubclassing(finder);
            }
        } else {
            finder = new AnnotationFinder(new ClassesArchive());
        }

        return new ModuleLimitedFinder(finder);
    }
View Full Code Here

                .build();
    }

    @Module
    public IAnnotationFinder finder() { // needed to run the test
        return new AnnotationFinder(new ClassesArchive());
    }
View Full Code Here

TOP

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

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.