Sha256: 0f6310f0dc0e98386878667776c25044ec82fb45bafe484f7d591c89fdbe2238

Contents?: true

Size: 1.03 KB

Versions: 4

Compression:

Stored size: 1.03 KB

Contents

package org.embulk.output.oracle;

import java.net.URL;
import java.net.URLClassLoader;
import java.util.List;

public class ChildFirstClassLoader
        extends URLClassLoader
{
    public ChildFirstClassLoader(List<URL> urls, ClassLoader parent)
    {
        super(urls.toArray(new URL[urls.size()]), parent);
    }

    @Override
    protected Class<?> loadClass(String name, boolean resolve)
            throws ClassNotFoundException
    {
        synchronized (getClassLoadingLock(name)) {
            Class<?> loadedClass = findLoadedClass(name);
            if (loadedClass != null) {
                return resolveClass(loadedClass, resolve);
            }

            try {
                return resolveClass(findClass(name), resolve);
            } catch (ClassNotFoundException ignored) {
            }

            return super.loadClass(name, resolve);
        }
    }

    private Class<?> resolveClass(Class<?> clazz, boolean resolve)
    {
        if (resolve) {
            resolveClass(clazz);
        }
        return clazz;
    }

}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
embulk-output-oracle-0.4.0 src/test/java/org/embulk/output/oracle/ChildFirstClassLoader.java
embulk-output-oracle-0.3.0 src/test/java/org/embulk/output/oracle/ChildFirstClassLoader.java
embulk-output-oracle-0.2.3 src/test/java/org/embulk/output/oracle/ChildFirstClassLoader.java
embulk-output-oracle-0.2.2 src/test/java/org/embulk/output/oracle/ChildFirstClassLoader.java