All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.wildfly.clustering.context.ThreadContextReference Maven / Gradle / Ivy

There is a newer version: 33.0.2.Final
Show newest version
/*
 * Copyright The WildFly Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package org.wildfly.clustering.context;

import java.util.function.BiConsumer;
import java.util.function.Function;

/**
 * Reference that can be associated with an arbitrary thread.
 * @author Paul Ferraro
 */
public interface ThreadContextReference extends ContextReference, Function, BiConsumer {

    @Override
    default void accept(C context) {
        this.accept(Thread.currentThread(), context);
    }

    @Override
    default C get() {
        return this.apply(Thread.currentThread());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy