Package org.apache.xbean.finder

Examples of org.apache.xbean.finder.ClassFinder.findAnnotatedClasses()


                    SessionBean sessionBean = (SessionBean) enterpriseBean;
                    sessionBean.setSessionType(SessionType.STATELESS);
                }
            }

            classes = finder.findAnnotatedClasses(Stateful.class);
            for (Class<?> beanClass : classes) {
                Stateful stateful = beanClass.getAnnotation(Stateful.class);
                String ejbName = stateful.name().length() == 0 ? beanClass.getSimpleName() : stateful.name();
                EnterpriseBean enterpriseBean = ejbJar.getEnterpriseBean(ejbName);
                if (enterpriseBean == null) {
View Full Code Here


                    SessionBean sessionBean = (SessionBean) enterpriseBean;
                    sessionBean.setSessionType(SessionType.STATEFUL);
                }
            }

            classes = finder.findAnnotatedClasses(MessageDriven.class);
            for (Class<?> beanClass : classes) {
                MessageDriven mdb = beanClass.getAnnotation(MessageDriven.class);
                String ejbName = mdb.name().length() == 0 ? beanClass.getSimpleName() : mdb.name();
                MessageDrivenBean messageBean = (MessageDrivenBean) ejbJar.getEnterpriseBean(ejbName);
                if (messageBean == null) {
View Full Code Here

                if (messageBean.getEjbClass() == null) {
                    messageBean.setEjbClass(beanClass.getName());
                }
            }

            classes = finder.findAnnotatedClasses(ApplicationException.class);
            if (!classes.isEmpty()) {
                if (ejbJar.getAssemblyDescriptor() == null) {
                    ejbJar.setAssemblyDescriptor(new AssemblyDescriptor());
                }
            }
View Full Code Here

            tempClassLoader = new TemporaryClassLoader(urls, parentClassLoader);
            List<Class> classes = new ArrayList<Class>();
            for (URL url : urlList) {
                try {
                    ClassFinder classFinder = new ClassFinder(tempClassLoader, Collections.singletonList(url));
                    classes.addAll(classFinder.findAnnotatedClasses(WebService.class));
                    classes.addAll(classFinder.findAnnotatedClasses(WebServiceProvider.class));
                } catch (Exception e) {
                    LOG.warn("Fail to search Web Service in jar [" + url + "]", e);
                }
            }
View Full Code Here

            List<Class> classes = new ArrayList<Class>();
            for (URL url : urlList) {
                try {
                    ClassFinder classFinder = new ClassFinder(tempClassLoader, Collections.singletonList(url));
                    classes.addAll(classFinder.findAnnotatedClasses(WebService.class));
                    classes.addAll(classFinder.findAnnotatedClasses(WebServiceProvider.class));
                } catch (Exception e) {
                    LOG.warn("Fail to search Web Service in jar [" + url + "]", e);
                }
            }
            return classes;
View Full Code Here

            } else if ("plugin".equals(classLoader)) {
                finder = new ClassFinder(getClass().getClassLoader());
            } else {
                throw new MojoFailureException("classLoader attribute must be 'project' or 'plugin'");
            }
            List<Class<?>> classes = finder.findAnnotatedClasses(Command.class);
            if (classes.isEmpty()) {
                throw new MojoFailureException("No command found");
            }

            Map<String, Set<String>> commands = new TreeMap<String, Set<String>>();
View Full Code Here

            } else if ("plugin".equals(classLoader)) {
                finder = new ClassFinder(getClass().getClassLoader());
            } else {
                throw new MojoFailureException("classLoader attribute must be 'project' or 'plugin'");
            }
            List<Class> classes = finder.findAnnotatedClasses(Command.class);
            if (classes.isEmpty()) {
                throw new MojoFailureException("No command found");
            }

            Map<String, Set<String>> commands = new TreeMap<String, Set<String>>();
View Full Code Here

                urls.add(new File(path).toURI().toURL());
            }

            ClassLoader loader = new URLClassLoader(urls.toArray(new URL[urls.size()]), getClass().getClassLoader());
            ClassFinder finder = new ClassFinder(loader, urls);
            List<Class> classes = finder.findAnnotatedClasses(Command.class);
            if (classes.isEmpty()) {
                throw new MojoFailureException("No command found");
            }

            Map<String, Set<String>> commands = new TreeMap<String, Set<String>>();
View Full Code Here

                }


                for (Class<? extends Annotation> annotation : annotations) {
                    logger.debug("Scanning for @" + annotation.getName());
                    List<Class> list = finder.findAnnotatedClasses(annotation);
                    if (logger.isDebugEnabled()) for (Class clazz : list) {
                        logger.debug("Found " + clazz.getName());
                    }
                   
                    classes.addAll(list);
View Full Code Here

                }

                /*
                 * @Interceptors
                 */
                for (Class<?> interceptorsAnnotatedClass : inheritedClassFinder.findAnnotatedClasses(Interceptors.class)) {
                    Interceptors interceptors = interceptorsAnnotatedClass.getAnnotation(Interceptors.class);
                    EjbJar ejbJar = ejbModule.getEjbJar();
                    for (Class interceptor : interceptors.value()) {
                        if (ejbJar.getInterceptor(interceptor.getName()) == null) {
                            ejbJar.addInterceptor(new Interceptor(interceptor.getName()));
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.