Sha256: 330305459492364ea5491c2ab375f1e2ca6afa0b2a8ddf1045b15dcf2ae00d05

Contents?: true

Size: 518 Bytes

Versions: 74

Compression:

Stored size: 518 Bytes

Contents

package org.embulk.exec;

import static java.util.Locale.ENGLISH;

public class SetCurrentThreadName
        implements AutoCloseable
{
    private final String original;

    public SetCurrentThreadName(String name)
    {
        this.original = Thread.currentThread().getName();
        Thread thread = Thread.currentThread();
        thread.setName(String.format(ENGLISH, "%04d:", thread.getId()) + name);
    }

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

Version data entries

74 entries across 74 versions & 1 rubygems

Version Path
embulk-0.8.39 embulk-core/src/main/java/org/embulk/exec/SetCurrentThreadName.java
embulk-0.8.39-java embulk-core/src/main/java/org/embulk/exec/SetCurrentThreadName.java
embulk-0.8.38 embulk-core/src/main/java/org/embulk/exec/SetCurrentThreadName.java
embulk-0.8.38-java embulk-core/src/main/java/org/embulk/exec/SetCurrentThreadName.java
embulk-0.8.37 embulk-core/src/main/java/org/embulk/exec/SetCurrentThreadName.java
embulk-0.8.37-java embulk-core/src/main/java/org/embulk/exec/SetCurrentThreadName.java
embulk-0.8.36 embulk-core/src/main/java/org/embulk/exec/SetCurrentThreadName.java
embulk-0.8.36-java embulk-core/src/main/java/org/embulk/exec/SetCurrentThreadName.java
embulk-0.8.35 embulk-core/src/main/java/org/embulk/exec/SetCurrentThreadName.java
embulk-0.8.35-java embulk-core/src/main/java/org/embulk/exec/SetCurrentThreadName.java
embulk-0.8.34 embulk-core/src/main/java/org/embulk/exec/SetCurrentThreadName.java
embulk-0.8.34-java embulk-core/src/main/java/org/embulk/exec/SetCurrentThreadName.java
embulk-0.8.33 embulk-core/src/main/java/org/embulk/exec/SetCurrentThreadName.java
embulk-0.8.33-java embulk-core/src/main/java/org/embulk/exec/SetCurrentThreadName.java
embulk-0.8.32 embulk-core/src/main/java/org/embulk/exec/SetCurrentThreadName.java
embulk-0.8.32-java embulk-core/src/main/java/org/embulk/exec/SetCurrentThreadName.java
embulk-0.8.31 embulk-core/src/main/java/org/embulk/exec/SetCurrentThreadName.java
embulk-0.8.31-java embulk-core/src/main/java/org/embulk/exec/SetCurrentThreadName.java
embulk-0.8.30 embulk-core/src/main/java/org/embulk/exec/SetCurrentThreadName.java
embulk-0.8.30-java embulk-core/src/main/java/org/embulk/exec/SetCurrentThreadName.java