Sha256: da7064f50fd8839bdaebb19916651e4127fdebd6f527fffc57f6b0dac5577f02

Contents?: true

Size: 477 Bytes

Versions: 9

Compression:

Stored size: 477 Bytes

Contents

package org.embulk.plugin;

public class SetThreadContextClassLoader
        implements AutoCloseable
{
    private final ClassLoader original;

    public SetThreadContextClassLoader(ClassLoader classLoader)
    {
        this.original = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(classLoader);
    }

    @Override
    public void close()
    {
        Thread.currentThread().setContextClassLoader(original);
    }
}

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
embulk-0.4.2 embulk-core/src/main/java/org/embulk/plugin/SetThreadContextClassLoader.java
embulk-0.4.1 embulk-core/src/main/java/org/embulk/plugin/SetThreadContextClassLoader.java
embulk-0.4.0 embulk-core/src/main/java/org/embulk/plugin/SetThreadContextClassLoader.java
embulk-0.3.2 embulk-core/src/main/java/org/embulk/plugin/SetThreadContextClassLoader.java
embulk-0.3.1 embulk-core/src/main/java/org/embulk/plugin/SetThreadContextClassLoader.java
embulk-0.3.0 embulk-core/src/main/java/org/embulk/plugin/SetThreadContextClassLoader.java
embulk-0.2.1 embulk-core/src/main/java/org/embulk/plugin/SetThreadContextClassLoader.java
embulk-0.2.0 embulk-core/src/main/java/org/embulk/plugin/SetThreadContextClassLoader.java
embulk-0.1.0 embulk-core/src/main/java/org/embulk/plugin/SetThreadContextClassLoader.java