Refine search
/** * Creates a new instance. * * @param name the name of this {@link TrustManagerFactory} */ protected SimpleTrustManagerFactory(String name) { super(CURRENT_SPI.get(), PROVIDER, name); CURRENT_SPI.get().init(this); CURRENT_SPI.remove(); if (name == null) { throw new NullPointerException("name"); } }
@Override public void run() { try { runnable.run(); } finally { FastThreadLocal.removeAll(); } }
/** * Set the value for the specified thread local map. The specified thread local map must be for the current thread. */ public final void set(InternalThreadLocalMap threadLocalMap, V value) { if (value != InternalThreadLocalMap.UNSET) { setKnownNotUnset(threadLocalMap, value); } else { remove(threadLocalMap); } }
/** * Set the value for the current thread. */ public final void set(V value) { if (value != InternalThreadLocalMap.UNSET) { InternalThreadLocalMap threadLocalMap = InternalThreadLocalMap.get(); if (setKnownNotUnset(threadLocalMap, value)) { registerCleaner(threadLocalMap); } } else { remove(); } }
final int threadLocalSize() { return threadLocal.get().size; }
public static void set(WebContext webContext) { WEB_CONTEXT_THREAD_LOCAL.set(webContext); }
/** * Removes all {@link FastThreadLocal} variables bound to the current thread. This operation is useful when you * are in a container environment, and you don't want to leave the thread local variables in the threads you do not * manage. */ public static void removeAll() { InternalThreadLocalMap threadLocalMap = InternalThreadLocalMap.getIfSet(); if (threadLocalMap == null) { return; } try { Object v = threadLocalMap.indexedVariable(variablesToRemoveIndex); if (v != null && v != InternalThreadLocalMap.UNSET) { @SuppressWarnings("unchecked") Set<FastThreadLocal<?>> variablesToRemove = (Set<FastThreadLocal<?>>) v; FastThreadLocal<?>[] variablesToRemoveArray = variablesToRemove.toArray(new FastThreadLocal[0]); for (FastThreadLocal<?> tlv: variablesToRemoveArray) { tlv.remove(threadLocalMap); } } } finally { InternalThreadLocalMap.remove(); } }
public static void clean() { WEB_CONTEXT_THREAD_LOCAL.remove(); blade = null; }
final int threadLocalCapacity() { return threadLocal.get().elements.length; }
long nioBufferSize = 0; int nioBufferCount = 0; final InternalThreadLocalMap threadLocalMap = InternalThreadLocalMap.get(); ByteBuffer[] nioBuffers = NIO_BUFFERS.get(threadLocalMap); Entry entry = flushedEntry; while (isFlushedEntry(entry) && entry.msg instanceof ByteBuf) { if (neededSpace > nioBuffers.length) { nioBuffers = expandNioBufferArray(nioBuffers, neededSpace, nioBufferCount); NIO_BUFFERS.set(threadLocalMap, nioBuffers);
/** * Set the value for the current thread. */ public final void set(V value) { if (value != InternalThreadLocalMap.UNSET) { InternalThreadLocalMap threadLocalMap = InternalThreadLocalMap.get(); if (setKnownNotUnset(threadLocalMap, value)) { registerCleaner(threadLocalMap); } } else { remove(); } }
public static void set(WebContext webContext) { WEB_CONTEXT_THREAD_LOCAL.set(webContext); }
/** * Removes all {@link FastThreadLocal} variables bound to the current thread. This operation is useful when you * are in a container environment, and you don't want to leave the thread local variables in the threads you do not * manage. */ public static void removeAll() { InternalThreadLocalMap threadLocalMap = InternalThreadLocalMap.getIfSet(); if (threadLocalMap == null) { return; } try { Object v = threadLocalMap.indexedVariable(variablesToRemoveIndex); if (v != null && v != InternalThreadLocalMap.UNSET) { @SuppressWarnings("unchecked") Set<FastThreadLocal<?>> variablesToRemove = (Set<FastThreadLocal<?>>) v; FastThreadLocal<?>[] variablesToRemoveArray = variablesToRemove.toArray(new FastThreadLocal[0]); for (FastThreadLocal<?> tlv: variablesToRemoveArray) { tlv.remove(threadLocalMap); } } } finally { InternalThreadLocalMap.remove(); } }