Package org.apache.geronimo.kernel.repository

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


       
        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


       
        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

            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()) {
            EnvironmentBuilder.mergeEnvironments(environment, defaultEnvironment);
        }
View Full Code Here

    protected Enumeration<URL> internalfindResources(String name) throws IOException {
        return super.findResources(name);
    }

    private boolean isNonOverridableResource(String name) {
        ClassLoadingRule nonOverrideableRule = classLoadingRules.getNonOverrideableRule();
        return nonOverrideableRule.isFilteredResource(name);
    }
View Full Code Here

        ClassLoadingRule nonOverrideableRule = classLoadingRules.getNonOverrideableRule();
        return nonOverrideableRule.isFilteredResource(name);
    }

    private boolean isHiddenResource(String name) {
        ClassLoadingRule hiddenRule = classLoadingRules.getHiddenRule();
        return hiddenRule.isFilteredResource(name);
    }
View Full Code Here

       // To avoid yet another CNFE we'll simply return null and let the caller handle appropriately.
      return null;
    }

    private boolean isNonOverridableClass(String name) {
        ClassLoadingRule nonOverrideableRule = classLoadingRules.getNonOverrideableRule();
        return nonOverrideableRule.isFilteredClass(name);
    }
View Full Code Here

        ClassLoadingRule nonOverrideableRule = classLoadingRules.getNonOverrideableRule();
        return nonOverrideableRule.isFilteredClass(name);
    }

    private boolean isHiddenClass(String name) {
        ClassLoadingRule hiddenRule = classLoadingRules.getHiddenRule();
        return hiddenRule.isFilteredClass(name);
    }
View Full Code Here

            }
        }

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

        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

        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

TOP

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

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.