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());
}
Aggregations