Examples of MultiParentClassLoader


Examples of org.apache.axis2.classloader.MultiParentClassLoader

            serviceTCCL = serviceTCCL.trim().toLowerCase();

            if (serviceTCCL.equals(Constants.TCCL_COMPOSITE)) {
                final ClassLoader loader = (ClassLoader) AccessController.doPrivileged(new PrivilegedAction() {
                    public Object run() {
                        return new MultiParentClassLoader(new URL[]{},
                                new ClassLoader[]{
                                        msgContext.getAxisService().getClassLoader(),
                                        contextClassLoader
                                });
                    }
View Full Code Here

Examples of org.apache.axis2.util.MultiParentClassLoader

        if (serviceTCCL != null) {
            serviceTCCL = serviceTCCL.trim().toLowerCase();


            if (serviceTCCL.equals(Constants.TCCL_COMPOSITE)) {
                Thread.currentThread().setContextClassLoader(new MultiParentClassLoader(new URL[]{}, new ClassLoader[]{
                        msgContext.getAxisService().getClassLoader(),
                        contextClassLoader,
                }));
            } else if (serviceTCCL.equals(Constants.TCCL_SERVICE)) {
                Thread.currentThread().setContextClassLoader(
View Full Code Here

Examples of org.apache.geronimo.kernel.config.MultiParentClassLoader

    /**
     * Tries to load a javax.* class that's not available from the
     * parent ClassLoader.  This should work.
     */
    public void testFalseNonexistantJavaxClass() {
        cl = new MultiParentClassLoader(configId, urls, getClass().getClassLoader(), false, HIDDEN, NON_OVERRIDABLE);
        try {
            cl.loadClass("javax.foo.Foo");
        } catch(ClassNotFoundException e) {
            fail("Should be able to load a javax.* class that is not defined by my parent CL");
        }
View Full Code Here

Examples of org.apache.geronimo.kernel.config.MultiParentClassLoader

    /**
     * Tries to load a javax.* class that's not available from the
     * parent ClassLoader.  This should work.
     */
    public void testTrueNonexistantJavaxClass() {
        cl = new MultiParentClassLoader(configId, urls, getClass().getClassLoader(), true, HIDDEN, NON_OVERRIDABLE);
        try {
            cl.loadClass("javax.foo.Foo");
        } catch(ClassNotFoundException e) {
            fail("Should be able to load a javax.* class that is not defined by my parent CL");
        }
View Full Code Here

Examples of org.apache.geronimo.kernel.config.MultiParentClassLoader

     * Tries to load a javax.* class that is avialable from the parent ClassLoader,
     * when there's a different definition available from this ClassLoader too.
     * This should always load the parent's copy.
     */
    public void testFalseExistantJavaxClass() {
        cl = new MultiParentClassLoader(configId, urls, getClass().getClassLoader(), false, HIDDEN, NON_OVERRIDABLE);
        try {
            Class cls = cl.loadClass("javax.servlet.Servlet");
            assertTrue("Loaded wrong class first; expected to find parent CL's copy of javax.servlet.Servlet",cls.getDeclaredMethods().length > 0);
        } catch(ClassNotFoundException e) {
            fail("Problem with test; expecting to have javax.servlet.* on the ClassPath");
View Full Code Here

Examples of org.apache.geronimo.kernel.config.MultiParentClassLoader

     * Tries to load a javax.* class that is avialable from the parent ClassLoader,
     * when there's a different definition available from this ClassLoader too.
     * This should always load the parent's copy.
     */
    public void testTrueExistantJavaxClass() {
        cl = new MultiParentClassLoader(configId, urls, getClass().getClassLoader(), true, HIDDEN, NON_OVERRIDABLE);
        try {
            Class cls = cl.loadClass("javax.servlet.Servlet");
            assertTrue("Loaded wrong class first; expected to find parent CL's copy of javax.servlet.Servlet",cls.getDeclaredMethods().length > 0);
        } catch(ClassNotFoundException e) {
            fail("Problem with test; expecting to have javax.servlet.* on the ClassPath");
View Full Code Here

Examples of org.apache.geronimo.kernel.config.MultiParentClassLoader

     * ClassLoader.  This should load the parent's copy when
     * contextPriorityClassLoader is set to false (as here) and the child's
     * copy when the contextPriorityClassLoader is set to true.
     */
    public void xtestFalseExistantNonJavaxClass() {
        cl = new MultiParentClassLoader(configId, urls, getClass().getClassLoader(), false, HIDDEN, NON_OVERRIDABLE);
        try {
            Class cls = cl.loadClass("mx4j.MBeanDescription");
            assertTrue("Should not have overriden parent CL definition of class mx4j.MBeanDescription", cls.getDeclaredMethods().length > 0);
        } catch(ClassNotFoundException e) {
            fail("Problem with test; expecting to have mx4j.* on the ClassPath");
View Full Code Here

Examples of org.apache.geronimo.kernel.config.MultiParentClassLoader

     * ClassLoader.  This should load the parent's copy when
     * contextPriorityClassLoader is set to false and the child's copy when
     * the contextPriorityClassLoader is set to true (as here).
     */
    public void xtestTrueExistantNonJavaxClass() {
        cl = new MultiParentClassLoader(configId, urls, getClass().getClassLoader(), true, HIDDEN, NON_OVERRIDABLE);
        try {
            Class cls = cl.loadClass("mx4j.MBeanDescription");
            assertTrue("Should be able to override a class that is not in java.*, javax.*, etc.", cls.getDeclaredMethods().length == 0);
        } catch(ClassNotFoundException e) {
            fail("Problem with test; expecting to have mx4j.* on the ClassPath");
View Full Code Here

Examples of org.apache.geronimo.kernel.config.MultiParentClassLoader

    /**
     * Tries to load a javax.* class that's not available from the
     * parent ClassLoader.  This should work.
     */
    public void testFalseNonexistantJavaxResource() {
        cl = new MultiParentClassLoader(configId, urls, getClass().getClassLoader(), false, HIDDEN, NON_OVERRIDABLE);
        URL url = cl.getResource("javax/foo/Foo.class");
        if(url == null) {
            fail("Should be able to load a javax.* class that is not defined by my parent CL");
        }
        assertEquals(url.getProtocol(), "file");
View Full Code Here

Examples of org.apache.geronimo.kernel.config.MultiParentClassLoader

    /**
     * Tries to load a javax.* class that's not available from the
     * parent ClassLoader.  This should work.
     */
    public void testTrueNonexistantJavaxResource() {
        cl = new MultiParentClassLoader(configId, urls, getClass().getClassLoader(), true, HIDDEN, NON_OVERRIDABLE);
        URL url = cl.getResource("javax/foo/Foo.class");
        if(url == null) {
            fail("Should be able to load a javax.* class that is not defined by my parent CL");
        }
        assertEquals(url.getProtocol(), "file");
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.