/** * Construct a {@link URLClassLoader} based on a canonical file location. * * @param location a canonical path location * @param parent {@link ClassLoader} to be used as parent for returned one. * @return a {@link URLClassLoader} * @throws java.io.IOException I/O * @throws java.net.MalformedURLException Invalid URL */ public static URLClassLoader createURLClassLoader(String location, ClassLoader parent) throws IOException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(parent); try { return createURLClassLoader(location); } finally { Thread.currentThread().setContextClassLoader(loader); } }
/** * Instantiates the given EventListener class. * * @return the new EventListener instance */ protected EventListener createEventListenerInstance(String eventListenerClassname) throws Exception { return (EventListener) ClassLoaderUtil.load(eventListenerClassname); }
urls[i] = new URL(path); urlClassloader = createClassLoaderWithSecCheck(urls, cl);
urls[i] = new URL(path); urlClassloader = createClassLoaderWithSecCheck(urls, cl);
/** * Instantiates the given EventListener class. * * @return the new EventListener instance */ protected EventListener createEventListenerInstance(String eventListenerClassname) throws Exception { return (EventListener) ClassLoaderUtil.load(eventListenerClassname); }
urls[i] = new URL(path); urlClassloader = createClassLoaderWithSecCheck(urls, cl);
/** * Construct a {@link URLClassLoader} based on a canonical file location. * * @param location a canonical path location * @param parent {@link ClassLoader} to be used as parent for returned one. * @return a {@link URLClassLoader} * @throws java.io.IOException I/O * @throws java.net.MalformedURLException Invalid URL */ public static URLClassLoader createURLClassLoader(String location, ClassLoader parent) throws IOException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(parent); try { return createURLClassLoader(location); } finally { Thread.currentThread().setContextClassLoader(loader); } }
/** * Instantiates the given EventListener class. * * @return the new EventListener instance */ protected EventListener createEventListenerInstance(String eventListenerClassname) throws Exception { return (EventListener) ClassLoaderUtil.load(eventListenerClassname); }
urls[i] = new URL(path); urlClassloader = createClassLoaderWithSecCheck(urls, cl);
/** * Construct a {@link URLClassLoader} based on a canonical file location. * * @param location a canonical path location * @param parent {@link ClassLoader} to be used as parent for returned one. * @return a {@link URLClassLoader} * @throws java.io.IOException I/O * @throws java.net.MalformedURLException Invalid URL */ public static URLClassLoader createURLClassLoader(String location, ClassLoader parent) throws IOException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(parent); try { return createURLClassLoader(location); } finally { Thread.currentThread().setContextClassLoader(loader); } }
/** * Instantiates the given EventListener class. * * @return the new EventListener instance */ protected EventListener createEventListenerInstance(String eventListenerClassname) throws Exception { return (EventListener) ClassLoaderUtil.load(eventListenerClassname); }
urls[i] = new URL(path); urlClassloader = createClassLoaderWithSecCheck(urls, cl);
/** * Construct a {@link URLClassLoader} based on a canonical file location. * * @param location a canonical path location * @param parent {@link ClassLoader} to be used as parent for returned one. * @return a {@link URLClassLoader} * @throws java.io.IOException I/O * @throws java.net.MalformedURLException Invalid URL */ public static URLClassLoader createURLClassLoader(String location, ClassLoader parent) throws IOException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(parent); try { return createURLClassLoader(location); } finally { Thread.currentThread().setContextClassLoader(loader); } }
/** * Instantiates the given EventListener class. * * @return the new EventListener instance */ protected EventListener createEventListenerInstance(String eventListenerClassname) throws Exception { return (EventListener) ClassLoaderUtil.load(eventListenerClassname); }
urls[i] = new URL(path); urlClassloader = createClassLoaderWithSecCheck(urls, cl);
/** * Construct a {@link URLClassLoader} based on a canonical file location. * * @param location a canonical path location * @param parent {@link ClassLoader} to be used as parent for returned one. * @return a {@link URLClassLoader} * @throws java.io.IOException I/O * @throws java.net.MalformedURLException Invalid URL */ public static URLClassLoader createURLClassLoader(String location, ClassLoader parent) throws IOException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(parent); try { return createURLClassLoader(location); } finally { Thread.currentThread().setContextClassLoader(loader); } }
/** * Instantiates the given EventListener class. * * @return the new EventListener instance */ protected EventListener createEventListenerInstance(String eventListenerClassname) throws Exception { return (EventListener) ClassLoaderUtil.load(eventListenerClassname); }
urls[i] = new URL(path); urlClassloader = createClassLoaderWithSecCheck(urls, cl);
/** * Construct a {@link URLClassLoader} based on a canonical file location. * * @param location a canonical path location * @param parent {@link ClassLoader} to be used as parent for returned one. * @return a {@link URLClassLoader} * @throws java.io.IOException I/O * @throws java.net.MalformedURLException Invalid URL */ public static URLClassLoader createURLClassLoader(String location, ClassLoader parent) throws IOException { ClassLoader loader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(parent); try { return createURLClassLoader(location); } finally { Thread.currentThread().setContextClassLoader(loader); } }
/** * Load a class using the current {link Thread#getContextClassLoader} * @param clazzName The name of the class you want to load. * @return an instance of clazzname */ public static Object load(String clazzName) { return load(clazzName, Thread.currentThread().getContextClassLoader()); }