Sha256: f41b14eb24175a09d94f455c0e741034ad8228460a62683da9f440dca159aa10

Contents?: true

Size: 1.07 KB

Versions: 2

Compression:

Stored size: 1.07 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

2 entries across 2 versions & 1 rubygems

Version Path
embulk-output-oracle-0.4.1 src/test/java/org/embulk/output/oracle/ChildFirstClassLoader.java
embulk-output-oracle-0.2.4 src/test/java/org/embulk/output/oracle/ChildFirstClassLoader.java