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

com.github.kristofa.brave.ServerSpanThreadBinderImpl Maven / Gradle / Ivy

package com.github.kristofa.brave;

import org.apache.commons.lang3.Validate;

/**
 * {@link ServerSpanThreadBinder} implementation.
 * 
 * @author kristof
 */
class ServerSpanThreadBinderImpl implements ServerSpanThreadBinder {

    private final ServerSpanState serverSpanState;

    /**
     * Creates a new instance.
     * 
     * @param serverSpanState Server span state, should not be null
     */
    public ServerSpanThreadBinderImpl(final ServerSpanState serverSpanState) {
        Validate.notNull(serverSpanState);
        this.serverSpanState = serverSpanState;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public ServerSpan getCurrentServerSpan() {
        return serverSpanState.getCurrentServerSpan();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void setCurrentSpan(final ServerSpan span) {
        serverSpanState.setCurrentServerSpan(span);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy