Examples of ClassFinder


Examples of org.apache.xbean.finder.ClassFinder

                    } catch (OpenEJBException e) {
                        //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

Examples of org.apache.xbean.finder.ClassFinder

        tag = Strings.lcfirst(Strings.camelCase(tag));

        if (isValidInterface(b, interfce, beanClass, tag));

        ClassFinder finder = new ClassFinder(interfce);

        for (Class<? extends Annotation> annotation : beanOnlyAnnotations) {

            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

Examples of org.apache.xbean.finder.ClassFinder

    private final boolean enabled;

    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

Examples of org.apache.xbean.finder.ClassFinder

            }
        }
       
        URL[] urls = urlList.toArray(new URL[] {});
        JarFileClassLoader tempClassLoader = new JarFileClassLoader(null, urls, parentClassLoader);
        ClassFinder classFinder = new ClassFinder(tempClassLoader, urlList);

        List<Class> classes = new ArrayList<Class>();

        classes.addAll(classFinder.findAnnotatedClasses(WebService.class));
        classes.addAll(classFinder.findAnnotatedClasses(WebServiceProvider.class));      

        tempClassLoader.destroy();

        if (tmpDir != null) {
            DeploymentUtil.recursiveDelete(tmpDir);
View Full Code Here

Examples of org.apache.xbean.finder.ClassFinder

        ApplicationInfo applicationInfo = createApplicationInfo(request, warUrl);
        Module module = (Module) (applicationInfo.getModules().toArray()[0]);
        WebAppType webApp = (WebAppType) module.getSpecDD();

        ClassFinder classFinder = null;
        try {
            classFinder = AbstractWebModuleBuilder.createWebAppClassFinder(webApp, classLoader);
            // classFinder = new ClassFinder(classLoader);
        } catch (DeploymentException e1) {
            // Some of the class types referred in the WAR cannot be resolved.
View Full Code Here

Examples of org.apache.xbean.finder.ClassFinder

                throw new DeploymentException("AppClientModuleBuilder: Could not load callback-handler class: " + cls.getStringValue(), e);
            }
            classes.add(clas);
        }

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

Examples of org.apache.xbean.finder.ClassFinder

        ApplicationInfo applicationInfo = createApplicationInfo(request, warUrl);
        Module module = (Module) (applicationInfo.getModules().toArray()[0]);
        WebAppType webApp = (WebAppType) module.getSpecDD();

        ClassFinder classFinder = null;
        try {
            classFinder = AbstractWebModuleBuilder.createWebAppClassFinder(webApp, classLoader);
            // classFinder = new ClassFinder(classLoader);
        } catch (DeploymentException e1) {
            // Some of the class types referred in the WAR cannot be resolved.
View Full Code Here

Examples of org.apache.xbean.finder.ClassFinder

/**
* @version $Rev: 516141 $ $Date: 2007-03-08 13:45:05 -0500 (Thu, 08 Mar 2007) $
*/
public class LifecycleMethodBuilder extends AbstractNamingBuilder {
    public void buildNaming(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module, Map componentContext) throws DeploymentException {
        ClassFinder classFinder = module.getClassFinder();
        AnnotatedApp annotatedApp = module.getAnnotatedApp();
        if (annotatedApp == null) {
            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();
                    FullyQualifiedClassType classType = callback.addNewLifecycleCallbackClass();
                    classType.setStringValue(className);
                    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

Examples of org.apache.xbean.finder.ClassFinder

            for (EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) {
                classes.add(classLoader.loadClass(bean.getEjbClass()));
            }

            return new ClassFinder(classes);
        } catch (ClassNotFoundException e) {
            throw new DeploymentException("Unable to load bean class.", e);
        }
    }
View Full Code Here

Examples of org.apache.xbean.finder.ClassFinder

            }
        }
       
        URL[] urls = urlList.toArray(new URL[] {});
        JarFileClassLoader tempClassLoader = new JarFileClassLoader(null, urls, this.getClass().getClassLoader());
        ClassFinder classFinder = new ClassFinder(tempClassLoader, urlList);

        List<Class> classes = new ArrayList<Class>();

        classes.addAll(classFinder.findAnnotatedClasses(WebService.class));
        classes.addAll(classFinder.findAnnotatedClasses(WebServiceProvider.class));      

        tempClassLoader.destroy();

        if (tmpDir != null) {
            DeploymentUtil.recursiveDelete(tmpDir);
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.