Package org.apache.geronimo.kernel.repository

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


                parentClassLoaders[iterator.previousIndex()] = configuration.childrenConfigurationClassLoader;
            }
        }

        // we need to propagate the non-overrideable classes from parents
        ClassLoadingRules classLoadingRules = environment.getClassLoadingRules();
        ClassLoadingRule nonOverrideableRule = classLoadingRules.getNonOverrideableRule();
        for (Configuration parent : classParents) {
            Environment parentEnvironment = parent.getEnvironment();
            ClassLoadingRules parentClassLoadingRules = parentEnvironment.getClassLoadingRules();
            ClassLoadingRule parentNonOverrideableRule = parentClassLoadingRules.getNonOverrideableRule();
            nonOverrideableRule.merge(parentNonOverrideableRule);
        }

        if (log.isDebugEnabled()) {
            StringBuffer buf = new StringBuffer("ClassLoader structure for configuration ").append(id).append("\n");
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

                }
            }

            environment.setSuppressDefaultEnvironment(environmentType.isSuppressDefaultEnvironment());

            ClassLoadingRules classLoadingRules = environment.getClassLoadingRules();
            classLoadingRules.setInverseClassLoading(environmentType.isInverseClassloading());

            if (environmentType.getHiddenClasses() != null) {
                ClassLoadingRule hiddenRule = classLoadingRules.getHiddenRule();
                List<String> filter = environmentType.getHiddenClasses().getFilter();
                hiddenRule.setClassPrefixes(new HashSet<String>(filter));
            }

            if (environmentType.getNonOverridableClasses() != null) {
                ClassLoadingRule nonOverrideableRule = classLoadingRules.getNonOverrideableRule();
                List<String> filter = environmentType.getNonOverridableClasses().getFilter();
                nonOverrideableRule.setClassPrefixes(new HashSet<String>(filter));
            }
        }
        if (!environment.isSuppressDefaultEnvironment()) {
View Full Code Here

        environmentType.setInverseClassloading(EmptyType.Factory.newInstance());
        environmentType.setHiddenClasses(newFilter("hidden"));
        environmentType.setNonOverridableClasses(newFilter("nonOverrideable"));
        environmentType.setPrivateClasses(newFilter("private"));
       
        ClassLoadingRules classLoadingRules = new ClassLoadingRules();
        ClassLoadingRulesUtil.configureRules(classLoadingRules, environmentType);
       
        assertTrue(classLoadingRules.isInverseClassLoading());
        assertPrefix(classLoadingRules.getHiddenRule(), "hidden");
        assertPrefix(classLoadingRules.getNonOverrideableRule(), "nonOverrideable");
        assertPrefix(classLoadingRules.getPrivateRule(), "private");
    }
View Full Code Here

                environment.setBundleActivator(additionalEnvironment.getBundleActivator());
            }
           
            environment.setSuppressDefaultEnvironment(environment.isSuppressDefaultEnvironment() || additionalEnvironment.isSuppressDefaultEnvironment());
           
            ClassLoadingRules classLoadingRules = environment.getClassLoadingRules();
            ClassLoadingRules additionalClassLoadingRules = additionalEnvironment.getClassLoadingRules();
            classLoadingRules.merge(additionalClassLoadingRules);
        }
    }
View Full Code Here

        }
        for (String requireBundle : environment.getRequireBundles()) {
            environmentType.addRequireBundle(requireBundle);
        }
       
        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

    public void setUp() throws Exception {
        super.setUp();
        URL url = new File(BASEDIR, "src/test/resources/deployables/cltest/").toURL();
        urls = new URL[]{url};

        classLoadingRules = new ClassLoadingRules();
        classLoadingRules.getHiddenRule().setClassPrefixes(HIDDEN );
        classLoadingRules.getNonOverrideableRule().setClassPrefixes(NON_OVERRIDABLE);
    }
View Full Code Here

                }
            }
           
            environment.setSuppressDefaultEnvironment(environmentType.isSuppressDefaultEnvironment());

            ClassLoadingRules classLoadingRules = environment.getClassLoadingRules();
            classLoadingRules.setInverseClassLoading(environmentType.isInverseClassloading());
           
            if (environmentType.getHiddenClasses() != null) {
                ClassLoadingRule hiddenRule = classLoadingRules.getHiddenRule();
                List<String> filter = environmentType.getHiddenClasses().getFilter();
                hiddenRule.setClassPrefixes(new HashSet<String>(filter));
            }
           
            if (environmentType.getNonOverridableClasses() != null) {
                ClassLoadingRule nonOverrideableRule = classLoadingRules.getNonOverrideableRule();
                List<String> filter = environmentType.getNonOverridableClasses().getFilter();
                nonOverrideableRule.setClassPrefixes(new HashSet<String>(filter));
            }
        }
        if (!environment.isSuppressDefaultEnvironment()) {
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.