Examples of JarFileClassLoader


Examples of org.apache.geronimo.kernel.classloader.JarFileClassLoader

            useJarFileClassLoader = System.getProperty("os.name").startsWith("Windows");
        } else {
            useJarFileClassLoader = Boolean.getBoolean("Xorg.apache.geronimo.JarFileClassLoader");
        }
        if (useJarFileClassLoader) {
            return new JarFileClassLoader(environment.getConfigId(),
                    urls,
                    parentClassLoaders,
                    environment.isInverseClassLoading(),
                    hiddenClasses,
                    nonOverridableClasses);
View Full Code Here

Examples of org.apache.geronimo.kernel.classloader.JarFileClassLoader

                    parentClassLoaders,
                    environment.isInverseClassLoading(),
                    hiddenClasses,
                    nonOverridableClasses);
        } else {
            return new JarFileClassLoader(environment.getConfigId(),
                    urls,
                    parentClassLoaders,
                    environment.isInverseClassLoading(),
                    hiddenClasses,
                    nonOverridableClasses);
View Full Code Here

Examples of org.apache.xbean.classloader.JarFileClassLoader

                }
            } else {
                try {
                    URL[] urls = getDefaultLocations();
                    ClassLoader parentLoader = getParentClassLoader(applicationContext);
                    classLoader = new JarFileClassLoader(applicationContext.getDisplayName(), urls, parentLoader);
                    // assign the class loader to the xml reader and the
                    // application context
                } catch (Exception e) {
                    throw new FatalBeanException("Unable to create default classloader for SU", e);
                }
View Full Code Here

Examples of org.apache.xbean.classloader.JarFileClassLoader

                if (componentMBean == null) {
                    throw new IllegalStateException("No such component: " + componentMBean);
                }
                parents.add(componentMBean.getComponent().getClass().getClassLoader());
            }
            classLoader = new JarFileClassLoader(applicationContext.getDisplayName(),
                                                 urls,
                                                 parents.toArray(new ClassLoader[parents.size()]),
                                                 inverse,
                                                 hidden.toArray(new String[hidden.size()]),
                                                 nonOverridable.toArray(new String[nonOverridable.size()]));
View Full Code Here

Examples of org.apache.xbean.classloader.JarFileClassLoader

        return invoke("wsimport", jars, os, arguments);
    }

    private boolean invoke(String toolName, URL[] jars, OutputStream os, String[] arguments) throws Exception {
        ClassLoader oldClassLoader = null;
        JarFileClassLoader loader = new JarFileClassLoader(null, jars, ClassLoader.getSystemClassLoader(), false, HIDDEN_CLASSES, new String[0]);
        if (overrideContextClassLoader) {
            oldClassLoader = Thread.currentThread().getContextClassLoader();
            Thread.currentThread().setContextClassLoader(loader);
        }
        try {
            return invoke(toolName, loader, os, arguments);
        } finally {
            if (overrideContextClassLoader) {
                Thread.currentThread().setContextClassLoader(oldClassLoader);
            }
            try {
                loader.destroy();
            } catch (Exception e) {
            }
        }
    }
View Full Code Here

Examples of org.apache.xbean.classloader.JarFileClassLoader

                }
            }
        }

        URL[] urls = urlList.toArray(new URL[urlList.size()]);
        JarFileClassLoader tempClassLoader = null;
        try {
            tempClassLoader = new JarFileClassLoader(null, 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) {
                    logger.warn("Fail to search Web Service in jar [" + url + "]", e);
                }
            }
            return classes;
        } finally {
            if (tempClassLoader != null) {
                tempClassLoader.destroy();
            }
            if (tmpDir != null) {
                FileUtils.recursiveDelete(tmpDir);
            }
        }
View Full Code Here

Examples of org.apache.xbean.classloader.JarFileClassLoader

        return invoke("wsimport", jars, os, arguments);
    }

    private boolean invoke(String toolName, URL[] jars, OutputStream os, String[] arguments) throws Exception {
        ClassLoader oldClassLoader = null;
        JarFileClassLoader loader = new JarFileClassLoader(null, jars, ClassLoader.getSystemClassLoader(), false, HIDDEN_CLASSES, new String[0]);
        if (overrideContextClassLoader) {
            oldClassLoader = Thread.currentThread().getContextClassLoader();
            Thread.currentThread().setContextClassLoader(loader);
        }
        try {
            return invoke(toolName, loader, os, arguments);
        } finally {
            if (overrideContextClassLoader) {
                Thread.currentThread().setContextClassLoader(oldClassLoader);
            }
            try {
                loader.destroy();
            } catch (Exception e) {
            }
        }
    }
View Full Code Here

Examples of org.apache.xbean.classloader.JarFileClassLoader

                urls[i] = file.toURL();
            } catch (MalformedURLException e) {
                throw new IllegalArgumentException(classPathNames[i], e);
            }
        }
        return new JarFileClassLoader(
                        getName(),
                        urls,
                        parent,
                        !parentFirst,
                        new String[0],
View Full Code Here

Examples of org.apache.xbean.classloader.JarFileClassLoader

                }
            } else {
                try {
                    URL[] urls = getDefaultLocations();
                    ClassLoader parentLoader = getParentClassLoader(applicationContext);
                    classLoader = new JarFileClassLoader(applicationContext.getDisplayName(), urls, parentLoader);
                    // assign the class loader to the xml reader and the
                    // application context
                } catch (Exception e) {
                    throw new FatalBeanException("Unable to create default classloader for SU", e);
                }
View Full Code Here

Examples of org.apache.xbean.classloader.JarFileClassLoader

            }

            // create the classloader
            List<ClassLoader> parents = new ArrayList<ClassLoader>();
            parents.add(getParentClassLoader(applicationContext));
            classLoader = new JarFileClassLoader(applicationContext.getDisplayName(),
                                                 urls,
                                                 parents.toArray(new ClassLoader[parents.size()]),
                                                 inverse,
                                                 hidden.toArray(new String[hidden.size()]),
                                                 nonOverridable.toArray(new String[nonOverridable.size()]));
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.