Examples of ClassFinder


Examples of org.apache.openejb.finder.ClassFinder

        //  Create an InterceptorData for the webservice interceptor to the list of interceptorDatas for this method
        List<InterceptorData> interceptorDatas = new ArrayList<InterceptorData>(deploymentInfo.getMethodInterceptors(runMethod));
        {
            InterceptorData providerData = new InterceptorData(interceptor.getClass());
            ClassFinder finder = new ClassFinder(interceptor.getClass());
            providerData.getAroundInvoke().addAll(finder.findAnnotatedMethods(AroundInvoke.class));
            interceptorDatas.add(providerData);
        }

        InterceptorStack interceptorStack = new InterceptorStack(instance.bean, runMethod, Operation.BUSINESS_WS, interceptorDatas, interceptors);
        Object[] params = new Object[runMethod.getParameterTypes().length];
View Full Code Here

Examples of org.apache.openejb.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.openejb.finder.ClassFinder

                    for (InitMethod method : session.getInitMethod()) {
                        ignoredStatefulAnnotation("Init", bean, method.getBeanMethod().getMethodName(), session.getSessionType().getName());
                    }
                }
            } else {
                ClassFinder finder = new ClassFinder(ejbClass);

                for (Method method : finder.findAnnotatedMethods(PrePassivate.class)) {
                    ignoredStatefulAnnotation("PrePassivate", bean, method.getName(), bean.getClass().getSimpleName());
                }

                for (Method method : finder.findAnnotatedMethods(PostActivate.class)) {
                    ignoredStatefulAnnotation("PostActivate", bean, method.getName(), bean.getClass().getSimpleName());
                }

                for (Method method : finder.findAnnotatedMethods(Remove.class)) {
                    ignoredStatefulAnnotation("Remove", bean, method.getName(), bean.getClass().getSimpleName());
                }

                for (Method method : finder.findAnnotatedMethods(Init.class)) {
                    ignoredStatefulAnnotation("Init", bean, method.getName(), bean.getClass().getSimpleName());
                }
            }

            if (bean instanceof TimerConsumer) {
View Full Code Here

Examples of org.apache.tapestry.services.ClassFinder

        return namespace;
    }

    private ClassFinder newClassFinder(String packageList, String className, Class resultClass)
    {
        ClassFinder finder = newMock(ClassFinder.class);

        expect(finder.findClass(packageList, className)).andReturn(resultClass);

        return finder;
    }
View Full Code Here

Examples of org.apache.xbean.finder.ClassFinder

        // not including a jar that her app needs) then ClassFinder
        // will throw NoClassDefFoundError.  we want to indicate that
        // it's the user's error and provide a little context to help
        // her fix it.
        try {
            return new ClassFinder(classes);
        } catch (NoClassDefFoundError e) {
            throw new DeploymentException("Classloader for " + webApp.getId() + "can't find " + e.getMessage(), e);
        }
    }
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

        // skip ejb modules... they have alreayd been processed
        if (module.getType() == ConfigurationModuleType.EJB) {
            return;
        }

        ClassFinder classFinder = module.getClassFinder();
        AnnotatedApp annotatedApp = module.getAnnotatedApp();
        if (annotatedApp == null) {
            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();
                    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

        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

            }
        }
       
        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

Examples of org.apache.xbean.finder.ClassFinder

            return false;
        }

        try {
            URLClassLoader tempClassLoader = new URLClassLoader(new URL[]{moduleUrl}, Thread.currentThread().getContextClassLoader());
            final ClassFinder classFinder = new ClassFinder(tempClassLoader, moduleUrl);

            // DMB: getting this via reflection is a temporary fix.  Just want to avoid having to
            // make Geronimo dependent on an xbean snapshot right before we do the release.
            // afterwards we can clean this up.
            Map<String, List> annotated = AccessController.doPrivileged(new PrivilegedAction<Map<String, List>>() {
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.