Package org.apache.xbean.finder

Examples of org.apache.xbean.finder.AbstractFinder$InfoBuildingVisitor


        buildingContext.put(NamingBuilder.INJECTION_KEY, holder);

        WebApp webApp = webModule.getSpecDD();
        XmlObject geronimoWebApp = webModule.getVendorDD();

        AbstractFinder originalFinder = webModule.getClassFinder();
        ClassFinder classFinder = createOpenWebBeansClassFinder(webApp, webModule);
        webModule.setClassFinder(classFinder);
        namingBuilders.buildNaming(webApp, geronimoWebApp, webModule, buildingContext);
        webModule.setClassFinder(originalFinder);
       
View Full Code Here


        Set<String> listenerNames = new HashSet<String>();

        Map<String, Bundle> tldLocationBundleMap = getTldFiles(webApp, webModule);
        LinkedHashSet<Class<?>> classes = getListenerClasses(webApp, webModule, tldLocationBundleMap, listenerNames);
       
        AbstractFinder originalClassFinder = webModule.getClassFinder();
        ClassFinder classFinder = new ClassFinder(new ArrayList<Class<?>>(classes));
        webModule.setClassFinder(classFinder);
        namingBuilders.buildNaming(webApp, jettyWebApp, webModule, buildingContext);
        webModule.setClassFinder(originalClassFinder);
View Full Code Here

//        }
        if (!(specDD instanceof Lifecycle)) {
            return;
        }
        Lifecycle lifecycle = (Lifecycle) specDD;
        AbstractFinder classFinder = module.getClassFinder();
        //TODO Need to double check the LifecycleMethod Scanning, seems we also do it in the OpenEJB
        String componentType = null;
        if (specDD instanceof EnterpriseBean) {
            componentType = ((EnterpriseBean) specDD).getEjbClass();
        } else if (specDD instanceof Interceptor) {
            componentType = ((Interceptor) specDD).getInterceptorClass();
        } else if (specDD instanceof ApplicationClient) {
            componentType = ((ApplicationClient) specDD).getMainClass();
        }
        Map<String, LifecycleCallback> postConstructMap = mapLifecycleCallbacks(lifecycle.getPostConstruct(), componentType);
        Map<String, LifecycleCallback> preDestroyMap = mapLifecycleCallbacks(lifecycle.getPreDestroy(), componentType);
        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)) {
                    LifecycleCallback callback = new LifecycleCallback();
                    callback.setLifecycleCallbackClass(className);
                    callback.setLifecycleCallbackMethod(methodName);
                    lifecycle.getPostConstruct().add(callback);
                    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)) {
                    LifecycleCallback callback = new LifecycleCallback();
View Full Code Here

        buildingContext.put(NamingBuilder.INJECTION_KEY, holder);

        WebApp webApp = webModule.getSpecDD();
        XmlObject geronimoWebApp = webModule.getVendorDD();

        AbstractFinder originalFinder = webModule.getClassFinder();
        ClassFinder classFinder = createOpenWebBeansClassFinder(webApp, webModule);
        webModule.setClassFinder(classFinder);
        namingBuilders.buildNaming(webApp, geronimoWebApp, webModule, buildingContext);
        webModule.setClassFinder(originalFinder);
View Full Code Here

        Set<String> listenerNames = new HashSet<String>();

        Map<String, Bundle> tldLocationBundleMap = getTldFiles(webApp, webModule);
        LinkedHashSet<Class<?>> classes = getListenerClasses(webApp, webModule, tldLocationBundleMap, listenerNames);
       
        AbstractFinder originalClassFinder = webModule.getClassFinder();
        ClassFinder classFinder = new ClassFinder(new ArrayList<Class<?>>(classes));
        webModule.setClassFinder(classFinder);
        namingBuilders.buildNaming(webApp, jettyWebApp, webModule, buildingContext);
        webModule.setClassFinder(originalClassFinder);
View Full Code Here

    }

    private Map<String, Merger<?>> initMerger() throws Exception {
        final Map<String, Merger<?>> mergers = new HashMap<String, Merger<?>>();
        final ClassLoader cl = new URLClassLoader(new URL[] { getClass().getProtectionDomain().getCodeSource().getLocation() }, ClassLoader.getSystemClassLoader());
        final AbstractFinder finder = new ClassFinder(cl, true).link();
        final List<Class> foundMergers = finder.findSubclasses((Class) cl.loadClass(Merger.class.getName()));
       
        for (Class<? extends Merger> m : foundMergers) {
            try {
                // reload the class with the current classloader to avoid to miss some dependencies
                // excluded to scan faster
View Full Code Here

TOP

Related Classes of org.apache.xbean.finder.AbstractFinder$InfoBuildingVisitor

Copyright © 2018 www.massapicom. 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.