Package org.apache.geronimo.kernel.repository

Examples of org.apache.geronimo.kernel.repository.ClassLoadingRules


    public MultiParentClassLoader(Artifact id, URL[] urls) {
        super(urls);
        this.id = id;
       
        parents = new ClassLoader[]{ClassLoader.getSystemClassLoader()};
        classLoadingRules = new ClassLoadingRules();
        ClassLoaderRegistry.add(this);
    }
View Full Code Here


    public MultiParentClassLoader(Artifact id, URL[] urls, ClassLoader[] parents) {
        super(urls);
        this.id = id;
        this.parents = copyParents(parents);

        classLoadingRules = new ClassLoadingRules();
        ClassLoaderRegistry.add(this);
    }
View Full Code Here

    public MultiParentClassLoader(Artifact id, URL[] urls, ClassLoader[] parents, URLStreamHandlerFactory factory) {
        super(urls, null, factory);
        this.id = id;
        this.parents = copyParents(parents);
       
        classLoadingRules = new ClassLoadingRules();
        ClassLoaderRegistry.add(this);
    }
View Full Code Here

                environment.setConfigId(additionalEnvironment.getConfigId());
            }
            environment.addDependencies(additionalEnvironment.getDependencies());
            environment.setSuppressDefaultEnvironment(environment.isSuppressDefaultEnvironment() || additionalEnvironment.isSuppressDefaultEnvironment());
           
            ClassLoadingRules classLoadingRules = environment.getClassLoadingRules();
            ClassLoadingRules additionalClassLoadingRules = additionalEnvironment.getClassLoadingRules();
            classLoadingRules.merge(additionalClassLoadingRules);
        }
    }
View Full Code Here

        List dependencies = toDependencyTypes(environment.getDependencies());
        DependencyType[] dependencyTypes = (DependencyType[]) dependencies.toArray(new DependencyType[dependencies.size()]);
        DependenciesType dependenciesType = environmentType.addNewDependencies();
        dependenciesType.setDependencyArray(dependencyTypes);
       
        ClassLoadingRules classLoadingRules = environment.getClassLoadingRules();
        if (classLoadingRules.isInverseClassLoading()) {
            environmentType.addNewInverseClassloading();
        }
       
        if (environment.isSuppressDefaultEnvironment()) {
            environmentType.addNewSuppressDefaultEnvironment();
        }
       
        ClassLoadingRule classLoadingRule = classLoadingRules.getHiddenRule();
        environmentType.setHiddenClasses(toFilterType(classLoadingRule.getClassPrefixes()));
       
        classLoadingRule = classLoadingRules.getNonOverrideableRule();
        environmentType.setNonOverridableClasses(toFilterType(classLoadingRule.getClassPrefixes()));

        classLoadingRule = classLoadingRules.getPrivateRule();
        environmentType.setPrivateClasses(toFilterType(classLoadingRule.getClassPrefixes()));
       
        return environmentType;
    }
View Full Code Here

    private ChildrenConfigurationClassLoader classLoader;
    private ClassLoadingRules rules;

    @Override
    protected void setUp() throws Exception {
        rules = new ClassLoadingRules();
        privateResourceClass = ChildrenConfigurationClassLoaderTest.class.getName();
        privateResourceName = privateResourceClass.replace(".", "/") + ".class";

        classLoader = new ChildrenConfigurationClassLoader(ChildrenConfigurationClassLoaderTest.class.getClassLoader(), rules);
    }
View Full Code Here

        File myJar = createJarFile(1);
        ClassLoader cl = new MultiParentClassLoader(NAME, new URL[]{myJar.toURL()}, parentCl);
        Class clazz = cl.loadClass(CLASS_NAME);
        assertSame(parentCl, clazz.getClassLoader());

        ClassLoadingRules classLoadingRules = new ClassLoadingRules();
        classLoadingRules.setInverseClassLoading(true);
        cl = new MultiParentClassLoader(NAME, new URL[]{myJar.toURL()}, parentCl, classLoadingRules);
        clazz = cl.loadClass(CLASS_NAME);
        assertSame(cl, clazz.getClassLoader());
    }
View Full Code Here

        File myJar = createJarFile(1);
        ClassLoader cl = new MultiParentClassLoader(NAME, new URL[]{myJar.toURL()}, parentCl);
        Class clazz = cl.loadClass(CLASS_NAME);
        assertSame(parentCl, clazz.getClassLoader());

        ClassLoadingRules classLoadingRules = new ClassLoadingRules();
        ClassLoadingRule classLoadingRule = classLoadingRules.getHiddenRule();
        classLoadingRule.addClassPrefixes(Collections.singleton(CLASS_NAME));
        cl = new MultiParentClassLoader(NAME, new URL[]{myJar.toURL()}, parentCl, classLoadingRules);
        clazz = cl.loadClass(CLASS_NAME);
        assertSame(cl, clazz.getClassLoader());
    }
View Full Code Here

        File myJar = createJarFile(1);
        ClassLoader cl = new MultiParentClassLoader(NAME, new URL[]{myJar.toURL()}, parentCl);
        Class clazz = cl.loadClass(CLASS_NAME);
        assertSame(parentCl, clazz.getClassLoader());

        ClassLoadingRules classLoadingRules = new ClassLoadingRules();
        classLoadingRules.setInverseClassLoading(true);
        ClassLoadingRule classLoadingRule = classLoadingRules.getNonOverrideableRule();
        classLoadingRule.addClassPrefixes(Collections.singleton(CLASS_NAME));
        cl = new MultiParentClassLoader(NAME, new URL[]{myJar.toURL()}, parentCl, classLoadingRules);
        clazz = cl.loadClass(CLASS_NAME);
        assertSame(parentCl, clazz.getClassLoader());
    }
View Full Code Here

            //
            // Build the configuration class loader
            //
            configurationClassLoader = createConfigurationClasssLoader(parents, environment, classPath);
           
            ClassLoadingRules rules = environment.getClassLoadingRules();
            childrenConfigurationClassLoader = new ChildrenConfigurationClassLoader(configurationClassLoader, rules);

            //
            // Get all service parents in depth first order
            //
View Full Code Here

TOP

Related Classes of org.apache.geronimo.kernel.repository.ClassLoadingRules

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.