/** * Reset the SimpAttributes for the current thread. */ public static void resetAttributes() { attributesHolder.remove(); }
/** * Reset the JodaTimeContext for the current thread. */ public static void resetJodaTimeContext() { jodaTimeContextHolder.remove(); }
/** * Remove any user credentials for this proxy from the current thread. * Statically specified user credentials apply again afterwards. * @see #setCredentialsForCurrentThread */ public void removeCredentialsFromCurrentThread() { this.threadBoundCredentials.remove(); }
/** * Remove any ConnectionSpec for this proxy from the current thread. * A statically specified ConnectionSpec applies again afterwards. * @see #setConnectionSpecForCurrentThread */ public void removeConnectionSpecFromCurrentThread() { this.threadBoundSpec.remove(); }
/** * Remove any user credentials for this proxy from the current thread. * Statically specified user credentials apply again afterwards. * @see #setCredentialsForCurrentThread */ public void removeCredentialsFromCurrentThread() { this.threadBoundCredentials.remove(); }
/** * Reset the DateTimeContext for the current thread. */ public static void resetDateTimeContext() { dateTimeContextHolder.remove(); }
/** * Clear the entire transaction synchronization state for the current thread: * registered synchronizations as well as the various transaction characteristics. * @see #clearSynchronization() * @see #setCurrentTransactionName * @see #setCurrentTransactionReadOnly * @see #setCurrentTransactionIsolationLevel * @see #setActualTransactionActive */ public static void clear() { synchronizations.remove(); currentTransactionName.remove(); currentTransactionReadOnly.remove(); currentTransactionIsolationLevel.remove(); actualTransactionActive.remove(); }
/** * 清除数据源 */ public static void clearDataSource() { CONTEXT_HOLDER.remove(); }
public static void destroy() { slowThreadLocalMap.remove(); }
/** * Set the name of the currently proxied bean instance. * @param beanName the name of the bean, or {@code null} to reset it */ static void setCurrentProxiedBeanName(@Nullable String beanName) { if (beanName != null) { currentProxiedBeanName.set(beanName); } else { currentProxiedBeanName.remove(); } }
@Nullable static TransactionContext removeCurrentTransactionContext() { TransactionContext transactionContext = currentTransactionContext.get(); currentTransactionContext.remove(); return transactionContext; }
/** * Deactivate transaction synchronization for the current thread. * Called by the transaction manager on transaction cleanup. * @throws IllegalStateException if synchronization is not active */ public static void clearSynchronization() throws IllegalStateException { if (!isSynchronizationActive()) { throw new IllegalStateException("Cannot deactivate transaction synchronization - not active"); } logger.trace("Clearing transaction synchronization"); synchronizations.remove(); }
public static void remove() { Thread thread = Thread.currentThread(); if (thread instanceof InternalThread) { ((InternalThread) thread).setThreadLocalMap(null); } else { slowThreadLocalMap.remove(); } }
public static void remove() { Thread thread = Thread.currentThread(); if (thread instanceof InternalThread) { ((InternalThread) thread).setThreadLocalMap(null); } else { slowThreadLocalMap.remove(); } }
public static void remove() { Thread thread = Thread.currentThread(); if (thread instanceof FastThreadLocalThread) { ((FastThreadLocalThread) thread).setThreadLocalMap(null); } else { slowThreadLocalMap.remove(); } }
/** * Dispose of targets if necessary; clear ThreadLocal. * @see #destroyPrototypeInstance */ @Override public void destroy() { logger.debug("Destroying ThreadLocalTargetSource bindings"); synchronized (this.targetSet) { for (Object target : this.targetSet) { destroyPrototypeInstance(target); } this.targetSet.clear(); } // Clear ThreadLocal, just in case. this.targetInThread.remove(); }
public final void tearDown() throws IOException { if (!fileThreadLocal.get().delete()) { logger.warning("Unable to delete file: " + fileThreadLocal.get()); } fileThreadLocal.remove(); } }
public final void tearDown() throws IOException { try { java.nio.file.Files.delete(fileThreadLocal.get()); } catch (IOException e) { logger.log(Level.WARNING, "Unable to delete file: " + fileThreadLocal.get(), e); } fileThreadLocal.remove(); } }