Examples of ClassesArchive


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

        WebApp webApp = new WebApp();
        webApp.setContextRoot("/");
        webApp.setId("web");
        webApp.setVersion("2.5");
        WebModule webModule = new WebModule(webApp, webApp.getContextRoot(), Thread.currentThread().getContextClassLoader(), "myapp", webApp.getId());
        webModule.setFinder(new AnnotationFinder(new ClassesArchive(RESTClass.class, RESTMethod.class, RESTApp.class)).link());

        AnnotationDeployer annotationDeployer = new AnnotationDeployer();
        webModule = annotationDeployer.deploy(webModule);

        Set<String> classes = webModule.getRestClasses();
View Full Code Here

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

        webApp.setContextRoot("/my-web-app");
        webApp.setId("web");
        webApp.setVersion("2.5");
        WebModule webModule = new WebModule(webApp, webApp.getContextRoot(),
                Thread.currentThread().getContextClassLoader(), "myapp", webApp.getId());
        webModule.setFinder(new AnnotationFinder(new ClassesArchive(
                MyFirstRestClass.class, MySecondRestClass.class, MyNonListedRestClass.class,
                MyRESTApplication.class, MyExpertRestClass.class, HookedRest.class, RestWithInjections.class)).link());

        Assembler assembler = new Assembler();
        SystemInstance.get().setComponent(Assembler.class, assembler);
View Full Code Here

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

                        loadedClasses[i++] = classLoader.loadClass(s);
                    } catch (final ClassNotFoundException e) {
                        // no-op
                    }
                }
                clientModule.getFinderReference().set(new FinderFactory.OpenEJBAnnotationFinder(new ClassesArchive(loadedClasses)));
            }
            processWebServiceClientHandlers(client, AnnotationFinder.class.cast(clientModule.getFinder()), classLoader);

            return clientModule;
        }
View Full Code Here

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

        private AnnotationFinder createFinder(final Class<?>... classes) {
            final Set<Class<?>> parents = new HashSet<Class<?>>();
            for (final Class<?> clazz : classes) {
                parents.addAll(Classes.ancestors(clazz));
            }
            return new AnnotationFinder(new ClassesArchive(parents)).enableMetaAnnotations(); // no need to have subclasses/impl here
        }
View Full Code Here

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

        try {
            final 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 (final IOException e) {
            if (forceDescriptor) {
                return new ClassesArchive();
            }
            return ClasspathArchive.archive(loader, location);
        }
    }
View Full Code Here

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

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

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

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

    @Keys({@Key(value = "annotation.invalid.stateful.webservice", type = KeyType.WARNING)})
    public AppModule testWebServiceWithStateful() {
        final EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new StatefulBean(Green.class));
        final EjbModule ejbModule = new EjbModule(ejbJar);
        ejbModule.setFinder(new AnnotationFinder(new ClassesArchive(Green.class)).link());

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

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

    @Keys({@Key(value = "annotation.invalid.messagedriven.webservice", type = KeyType.WARNING)})
    public AppModule testWebServiceWithMessageDriven() {
        final EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new MessageDrivenBean(Yellow.class));
        final EjbModule ejbModule = new EjbModule(ejbJar);
        ejbModule.setFinder(new AnnotationFinder(new ClassesArchive(Yellow.class)).link());

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

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

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

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

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

    @Keys({@Key(value = "ann.local.forLocalBean", type = KeyType.WARNING)})
    public EjbModule shouldWarnForLocalAnnotationOnBeanWithNoInterface() {
        final EjbJar ejbJar = new EjbJar();
        ejbJar.addEnterpriseBean(new StatelessBean(EjbWithoutInterface.class));
        final EjbModule ejbModule = new EjbModule(ejbJar);
        ejbModule.setFinder(new AnnotationFinder(new ClassesArchive(EjbWithoutInterface.class)).link());
        return ejbModule;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.