Java Code Examples for org.apache.catalina.Container#setParentClassLoader()

The following examples show how to use org.apache.catalina.Container#setParentClassLoader() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CopyParentClassLoaderRule.java    From Tomcat8-Source-Read with MIT License 6 votes vote down vote up
/**
 * Handle the beginning of an XML element.
 *
 * @param attributes The attributes of this element
 *
 * @exception Exception if a processing error occurs
 */
@Override
public void begin(String namespace, String name, Attributes attributes)
    throws Exception {

    if (digester.getLogger().isDebugEnabled())
        digester.getLogger().debug("Copying parent class loader");
    Container child = (Container) digester.peek(0);
    Object parent = digester.peek(1);
    Method method =
        parent.getClass().getMethod("getParentClassLoader", new Class[0]);
    ClassLoader classLoader =
        (ClassLoader) method.invoke(parent, new Object[0]);
    child.setParentClassLoader(classLoader);

}
 
Example 2
Source File: CopyParentClassLoaderRule.java    From Tomcat7.0.67 with Apache License 2.0 6 votes vote down vote up
/**
 * Handle the beginning of an XML element.
 *
 * @param attributes The attributes of this element
 *
 * @exception Exception if a processing error occurs
 */
@Override
public void begin(String namespace, String name, Attributes attributes)
    throws Exception {

    if (digester.getLogger().isDebugEnabled())
        digester.getLogger().debug("Copying parent class loader");
    Container child = (Container) digester.peek(0);
    Object parent = digester.peek(1);
    Method method =
        parent.getClass().getMethod("getParentClassLoader", new Class[0]);
    ClassLoader classLoader =
        (ClassLoader) method.invoke(parent, new Object[0]);
    child.setParentClassLoader(classLoader);

}
 
Example 3
Source File: CopyParentClassLoaderRule.java    From tomcatsrc with Apache License 2.0 6 votes vote down vote up
/**
 * Handle the beginning of an XML element.
 *
 * @param attributes The attributes of this element
 *
 * @exception Exception if a processing error occurs
 */
@Override
public void begin(String namespace, String name, Attributes attributes)
    throws Exception {

    if (digester.getLogger().isDebugEnabled())
        digester.getLogger().debug("Copying parent class loader");
    Container child = (Container) digester.peek(0);
    Object parent = digester.peek(1);
    Method method =
        parent.getClass().getMethod("getParentClassLoader", new Class[0]);
    ClassLoader classLoader =
        (ClassLoader) method.invoke(parent, new Object[0]);
    child.setParentClassLoader(classLoader);

}
 
Example 4
Source File: Catalina.java    From Tomcat8-Source-Read with MIT License 5 votes vote down vote up
@Override
public void begin(String namespace, String name, Attributes attributes)
    throws Exception {

    if (digester.getLogger().isDebugEnabled()) {
        digester.getLogger().debug("Setting parent class loader");
    }

    Container top = (Container) digester.peek();
    top.setParentClassLoader(parentClassLoader);

}
 
Example 5
Source File: Catalina.java    From Tomcat7.0.67 with Apache License 2.0 5 votes vote down vote up
@Override
public void begin(String namespace, String name, Attributes attributes)
    throws Exception {

    if (digester.getLogger().isDebugEnabled()) {
        digester.getLogger().debug("Setting parent class loader");
    }

    Container top = (Container) digester.peek();
    top.setParentClassLoader(parentClassLoader);

}
 
Example 6
Source File: Catalina.java    From tomcatsrc with Apache License 2.0 5 votes vote down vote up
@Override
public void begin(String namespace, String name, Attributes attributes)
    throws Exception {

    if (digester.getLogger().isDebugEnabled()) {
        digester.getLogger().debug("Setting parent class loader");
    }

    Container top = (Container) digester.peek();
    top.setParentClassLoader(parentClassLoader);

}