Search in sources :

Example 26 with Loader

use of org.apache.catalina.Loader in project Payara by payara.

the class CreateLoaderRule method begin.

public void begin(Attributes attributes) throws Exception {
    // Look up the required parent class loader
    Container container = (Container) digester.peek();
    ClassLoader parentClassLoader = container.getParentClassLoader();
    // Instantiate a new Loader implementation object
    String className = loaderClass;
    if (attributeName != null) {
        String value = attributes.getValue(attributeName);
        if (value != null)
            className = value;
    }
    Class<?> clazz = Class.forName(className);
    Class[] types = { ClassLoader.class };
    Object[] args = { parentClassLoader };
    Constructor constructor = clazz.getDeclaredConstructor(types);
    Loader loader = (Loader) constructor.newInstance(args);
    // Push the new loader onto the stack
    digester.push(loader);
    if (digester.getDebug() >= 1)
        digester.log("new " + loader.getClass().getName());
}
Also used : Container(org.apache.catalina.Container) Constructor(java.lang.reflect.Constructor) Loader(org.apache.catalina.Loader)

Aggregations

Loader (org.apache.catalina.Loader)26 WebappLoader (org.apache.catalina.loader.WebappLoader)13 LifecycleException (org.apache.catalina.LifecycleException)10 IOException (java.io.IOException)9 Container (org.apache.catalina.Container)6 File (java.io.File)5 ObjectInputStream (java.io.ObjectInputStream)5 MalformedURLException (java.net.MalformedURLException)5 Lifecycle (org.apache.catalina.Lifecycle)5 Manager (org.apache.catalina.Manager)5 NamingException (javax.naming.NamingException)4 ServletException (javax.servlet.ServletException)4 Realm (org.apache.catalina.Realm)4 WebResourceRoot (org.apache.catalina.WebResourceRoot)4 StandardManager (org.apache.catalina.session.StandardManager)4 CustomObjectInputStream (org.apache.catalina.util.CustomObjectInputStream)4 DeploymentLoader (org.apache.openejb.config.DeploymentLoader)4 InstanceManager (org.apache.tomcat.InstanceManager)4 BufferedInputStream (java.io.BufferedInputStream)3 FileInputStream (java.io.FileInputStream)3