org.frameworkset.web.servlet.launcher.ApusicWebappClassLoader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bboss-mvc Show documentation
Show all versions of bboss-mvc Show documentation
bboss is a j2ee framework include aop/ioc,mvc,persistent,taglib,rpc,event ,bean-xml serializable and so on.http://www.bbossgroups.com
package org.frameworkset.web.servlet.launcher;
import java.io.File;
import java.lang.reflect.Method;
//import com.apusic.web.container.ReloadableClassLoader;
public class ApusicWebappClassLoader extends BaseAppServerClassLoader {
@Override
protected void addRepository(ClassLoader classLoader, String jarfile)
throws Exception {
Method method = classLoader.getClass().getDeclaredMethod("addFile", File.class);
// ReloadableClassLoader classLoader_ = (ReloadableClassLoader)classLoader;
method.invoke(classLoader, new File(jarfile));
// classLoader_.addFile(new File(jarfile));
System.out.println("load custom Jars from Location:" + jarfile);
}
public boolean validate(ClassLoader classLoader) {
try {
if(classLoader.getClass().getName().equals("com.apusic.web.container.ReloadableClassLoader"))
return true;
// ReloadableClassLoader classLoader_ = (ReloadableClassLoader)classLoader;
return false;
} catch (Exception e) {
return false;
}
}
}