io.bitsensor.plugins.shaded.org.springframework.amqp.rabbit.connection.SimpleResourceHolder Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2014-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.bitsensor.plugins.shaded.io.bitsensor.plugins.shaded.org.springframework.amqp.rabbit.connection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import io.bitsensor.plugins.shaded.org.apache.commons.logging.Log;
import io.bitsensor.plugins.shaded.org.apache.commons.logging.LogFactory;
import io.bitsensor.plugins.shaded.org.springframework.core.NamedThreadLocal;
import io.bitsensor.plugins.shaded.org.springframework.util.Assert;
/**
* Central helper that manages resources per thread to be used by resource management code.
*
* Supports one resource per key without overwriting, that is, a resource needs
* to be removed before a new one can be set for the same key.
*
*
Resource management code should check for thread-bound resources via {@link #has(Object)}.
*
*
This helper isn't designed for transaction synchronization cases.
* Use {@code TransactionSynchronizationManager} and {@code ResourceHolder} instead.
*
* @author Artem Bilan
* @since 1.3
*/
public final class SimpleResourceHolder {
private static final Log logger = LogFactory.getLog(SimpleResourceHolder.class);
private static final ThreadLocal