public static Object remove(Object key) {
        Map<Object, Object> perThreadResources = RESOURCES.get();
        Object value = perThreadResources != null ? perThreadResources.remove(key) : null;

        if ((value != null) && LOGGER.isTraceEnabled()) {
            String msg = "Removed value of type [" + value.getClass().getName() + "] for key ["
                    + key + "]" + "from thread [" + Thread.currentThread().getName() + "]";
            LOGGER.trace(msg);
        }

        return value;
    }
Unbinds the value for the given <code>key</code> from the current
thread.

@param key The key identifying the value bound to the current thread.
@return the object unbound or <tt>null</tt> if there was nothing bound
under the specified <tt>key</tt> name.
core/src/main/java/org/apache/shiro/util/ThreadContext.java