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

                    clazz = classLoader.loadClass(ejbClassName);
                } catch (ClassNotFoundException e) {
                    // Handled in CheckClasses.java along with other missing classes
                    continue;
                }
                final AnnotationFinder finder = new AnnotationFinder(new ClassesArchive(clazz));

                final AnnotationFinder annotationFinder = createFinder(clazz);

                /*
                 * @PostConstruct
 
View Full Code Here

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

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

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

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

            } else {
                url = new URL(location);
            }
            return new AnnotationFinder(new ClasspathArchive(module.getClassLoader(), url)).link();
        } else {
            return new AnnotationFinder(new ClassesArchive()).link();
        }
    }
View Full Code Here

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

            } else {
                url = new URL(location);
            }
            return new AnnotationFinder(new ClasspathArchive(module.getClassLoader(), url)).link();
        } else {
            return new AnnotationFinder(new ClassesArchive()).link();
        }
    }
View Full Code Here

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

                    clazz = classLoader.loadClass(realClassName(ejbClassName));
                } catch (ClassNotFoundException e) {
                    // Handled in CheckClasses.java along with other missing classes
                    continue;
                }
                final AnnotationFinder finder = new AnnotationFinder(new ClassesArchive(clazz));

                final AnnotationFinder annotationFinder = createFinder(clazz);

                /*
                 * @PostConstruct
 
View Full Code Here

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

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

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

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

                    final EnterpriseBean bean = (EnterpriseBean) obj;
                    final EjbJar ejbJar = new EjbJar(method.getName());
                    ejbJar.addEnterpriseBean(bean);
                    EjbModule ejbModule = new EjbModule(ejbJar);
                    Class<?> clazz = Thread.currentThread().getContextClassLoader().loadClass(bean.getEjbClass());
                    ejbModule.setFinder(new AnnotationFinder(new ClassesArchive(clazz)).link());
                    appModule.getEjbModules().add(ejbModule);

                } else if (obj instanceof Application) {

                    application = (Application) obj;
                    setId(application, method);

                } else if (obj instanceof Connector) {

                    final Connector connector = (Connector) obj;
                    setId(connector, method);
                    appModule.getConnectorModules().add(new ConnectorModule(connector));

                } else if (obj instanceof Persistence) {

                    final Persistence persistence = (Persistence) obj;
                    appModule.getPersistenceModules().add(new PersistenceModule("", persistence));

                } else if (obj instanceof PersistenceUnit) {

                    final PersistenceUnit unit = (PersistenceUnit) obj;
                    appModule.getPersistenceModules().add(new PersistenceModule("", new Persistence(unit)));

                } else if (obj instanceof Beans) {

                    final Beans beans = (Beans) obj;
                    final EjbModule ejbModule = new EjbModule(new EjbJar(method.getName()));
                    ejbModule.setBeans(beans);
                    appModule.getEjbModules().add(ejbModule);

                } else if (obj instanceof Class[]) {

                    final Class[] beans = (Class[]) obj;
                    final EjbModule ejbModule = new EjbModule(new EjbJar(method.getName()));
                    ejbModule.setFinder(new AnnotationFinder(new ClassesArchive(beans)).link());
                    ejbModule.setBeans(new Beans());
                    appModule.getEjbModules().add(ejbModule);
                } else if (obj instanceof Class) {

                    final Class bean = (Class) obj;
                    final EjbModule ejbModule = new EjbModule(new EjbJar(method.getName()));
                    ejbModule.setFinder(new AnnotationFinder(new ClassesArchive(bean)).link());
                    ejbModule.setBeans(new Beans());
                    appModule.getEjbModules().add(ejbModule);
                }
            }
View Full Code Here

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

    }


    @Test
    public void testSortClasses() throws Exception {
        AnnotationFinder finder = new AnnotationFinder(new ClassesArchive(Emerald.class)).link();

        List<Annotated<Class<?>>> classes = finder.findMetaAnnotatedClasses(Resource.class);
        assertTrue(classes.size() >= 3);

        List<Annotated<Class<?>>> sorted = AnnotationDeployer.sortClasses(classes);
View Full Code Here

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

        assertEquals(Color.class, sorted.get(2).get());
    }

    @Test
    public void testSortMethods() throws Exception {
        AnnotationFinder finder = new AnnotationFinder(new ClassesArchive(Emerald.class)).link();

        List<Annotated<Method>> classes = finder.findMetaAnnotatedMethods(Resource.class);
        assertTrue(classes.size() >= 3);

        List<Annotated<Method>> sorted = AnnotationDeployer.sortMethods(classes);
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.