Package org.apache.xbean.finder

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


            throw new NullPointerException("No AnnotatedApp supplied");
        }
        Map<String, LifecycleCallbackType> postConstructMap = mapLifecycleCallbacks(annotatedApp.getPostConstructArray(), annotatedApp.getComponentType());
        Map<String, LifecycleCallbackType> preDestroyMap = mapLifecycleCallbacks(annotatedApp.getPreDestroyArray(), annotatedApp.getComponentType());
        if (module.getClassFinder() != null) {
            List<Method> postConstructs = classFinder.findAnnotatedMethods(PostConstruct.class);
            for (Method m : postConstructs) {
                String methodName = m.getName();
                String className = m.getDeclaringClass().getName();
                if (!postConstructMap.containsKey(className)) {
                    LifecycleCallbackType callback = annotatedApp.addPostConstruct();
View Full Code Here


                    JavaIdentifierType method = callback.addNewLifecycleCallbackMethod();
                    method.setStringValue(methodName);
                    postConstructMap.put(className, callback);
                }
            }
            List<Method> preDestroys = classFinder.findAnnotatedMethods(PreDestroy.class);
            for (Method m : preDestroys) {
                String methodName = m.getName();
                String className = m.getDeclaringClass().getName();
                if (!preDestroyMap.containsKey(className)) {
                    LifecycleCallbackType callback = annotatedApp.addPreDestroy();
View Full Code Here

                        //ignore ?
                    }
                }
            } else {
                ClassFinder classFinder = new ClassFinder(ejbClass);
                for (Method method : classFinder.findAnnotatedMethods(Asynchronous.class)) {
                    ignoredMethodAnnotation("Asynchronous", bean, bean.getEjbClass(), method.getName(), bean.getClass().getSimpleName());
                }
                if (ejbClass.getAnnotation(Asynchronous.class) != null) {
                    ignoredClassAnnotation("Asynchronous", bean, bean.getEjbClass(), bean.getClass().getSimpleName());
                }
View Full Code Here

            if (interfce.isAnnotationPresent(annotation)){
                warn(b, "interface.beanOnlyAnnotation", annotation.getSimpleName(), interfce.getName(), b.getEjbClass());
            }

            for (Method method : finder.findAnnotatedMethods(annotation)) {
                warn(b, "interfaceMethod.beanOnlyAnnotation", annotation.getSimpleName(), interfce.getName(), method.getName(), b.getEjbClass());
            }
        }

    }
View Full Code Here

    public StatsInterceptor(Class<?> componentClass) {

        monitor = componentClass.getAnnotation(Monitor.class);
        ClassFinder finder = new ClassFinder(componentClass);
        for (Method method : finder.findAnnotatedMethods(Monitor.class)) {
            map.put(method, new Stats(method, monitor));
        }
        enabled = monitor != null || map.size() > 0;
    }
View Full Code Here

            throw new NullPointerException("No AnnotatedApp supplied");
        }
        Map<String, LifecycleCallbackType> postConstructMap = mapLifecycleCallbacks(annotatedApp.getPostConstructArray());
        Map<String, LifecycleCallbackType> preDestroyMap = mapLifecycleCallbacks(annotatedApp.getPreDestroyArray());
        if (module.getClassFinder() != null) {
            List<Method> postConstructs = classFinder.findAnnotatedMethods(PostConstruct.class);
            for (Method m: postConstructs) {
                String methodName = m.getName();
                String className = m.getDeclaringClass().getName();
                if (!postConstructMap.containsKey(className)) {
                    LifecycleCallbackType  callback = annotatedApp.addPostConstruct();
View Full Code Here

                    JavaIdentifierType method = callback.addNewLifecycleCallbackMethod();
                    method.setStringValue(methodName);
                    postConstructMap.put(className, callback);
                }
            }
            List<Method> preDestroys = classFinder.findAnnotatedMethods(PreDestroy.class);
            for (Method m: preDestroys) {
                String methodName = m.getName();
                String className = m.getDeclaringClass().getName();
                if (!preDestroyMap.containsKey(className)) {
                    LifecycleCallbackType  callback = annotatedApp.addPreDestroy();
View Full Code Here

                    EJB ejb = field.getAnnotation(EJB.class);
                    AnnotationDeployer.Member member = new AnnotationDeployer.FieldMember(field);
                    buildEjbRef(consumer, ejb, member);
                }

                for (Method method : finder.findAnnotatedMethods(EJB.class)) {
                    EJB ejb = method.getAnnotation(EJB.class);
                    AnnotationDeployer.Member member = new AnnotationDeployer.MethodMember(method);
                    buildEjbRef(consumer, ejb, member);
                }
View Full Code Here

                /*
                 * @Schedule
                 * @Schedules
                 */
                Set<Method> scheduleMethods = new HashSet<Method>();
                scheduleMethods.addAll(inheritedClassFinder.findAnnotatedMethods(javax.ejb.Schedules.class));
                scheduleMethods.addAll(inheritedClassFinder.findAnnotatedMethods(javax.ejb.Schedule.class));

                Map<String, List<MethodAttribute>> existingDeclarations = assemblyDescriptor.getMethodScheduleMap(ejbName);

                for (Method method : scheduleMethods) {
View Full Code Here

                 * @Schedule
                 * @Schedules
                 */
                Set<Method> scheduleMethods = new HashSet<Method>();
                scheduleMethods.addAll(inheritedClassFinder.findAnnotatedMethods(javax.ejb.Schedules.class));
                scheduleMethods.addAll(inheritedClassFinder.findAnnotatedMethods(javax.ejb.Schedule.class));

                Map<String, List<MethodAttribute>> existingDeclarations = assemblyDescriptor.getMethodScheduleMap(ejbName);

                for (Method method : scheduleMethods) {

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.