/** * Method that will clear up any cached type definitions that may * be cached by this {@link TypeFactory} instance. * This method should not be commonly used, that is, only use it * if you know there is a problem with retention of type definitions; * the most likely (and currently only known) problem is retention * of {@link Class} instances via {@link JavaType} reference. * * @since 2.4.1 */ public void clearCache() { _typeCache.clear(); }
public V put(K key, V value) { if (_map.size() >= _maxEntries) { // double-locking, yes, but safe here; trying to avoid "clear storms" synchronized (this) { if (_map.size() >= _maxEntries) { clear(); } } } return _map.put(key, value); }
/** * @since 2.5 */ public V putIfAbsent(K key, V value) { // not 100% optimal semantically, but better from correctness (never exceeds // defined maximum) and close enough all in all: if (_map.size() >= _maxEntries) { synchronized (this) { if (_map.size() >= _maxEntries) { clear(); } } } return _map.putIfAbsent(key, value); }
/** * Method that will clear up any cached type definitions that may * be cached by this {@link TypeFactory} instance. * This method should not be commonly used, that is, only use it * if you know there is a problem with retention of type definitions; * the most likely (and currently only known) problem is retention * of {@link Class} instances via {@link JavaType} reference. * * @since 2.4.1 */ public void clearCache() { _typeCache.clear(); }
/** * Method that will clear up any cached type definitions that may * be cached by this {@link TypeFactory} instance. * This method should not be commonly used, that is, only use it * if you know there is a problem with retention of type definitions; * the most likely (and currently only known) problem is retention * of {@link Class} instances via {@link JavaType} reference. * * @since 2.4.1 */ public void clearCache() { _typeCache.clear(); }
/** * Method that will clear up any cached type definitions that may * be cached by this {@link TypeFactory} instance. * This method should not be commonly used, that is, only use it * if you know there is a problem with retention of type definitions; * the most likely (and currently only known) problem is retention * of {@link Class} instances via {@link JavaType} reference. * * @since 2.4.1 */ public void clearCache() { _typeCache.clear(); }
/** * Method that will clear up any cached type definitions that may * be cached by this {@link TypeFactory} instance. * This method should not be commonly used, that is, only use it * if you know there is a problem with retention of type definitions; * the most likely (and currently only known) problem is retention * of {@link Class} instances via {@link JavaType} reference. * * @since 2.4.1 */ public void clearCache() { _typeCache.clear(); }
public V put(K key, V value) { if (_map.size() >= _maxEntries) { // double-locking, yes, but safe here; trying to avoid "clear storms" synchronized (this) { if (_map.size() >= _maxEntries) { clear(); } } } return _map.put(key, value); }
public V put(K key, V value) { if (_map.size() >= _maxEntries) { // double-locking, yes, but safe here; trying to avoid "clear storms" synchronized (this) { if (_map.size() >= _maxEntries) { clear(); } } } return _map.put(key, value); }
public V put(K key, V value) { if (_map.size() >= _maxEntries) { // double-locking, yes, but safe here; trying to avoid "clear storms" synchronized (this) { if (_map.size() >= _maxEntries) { clear(); } } } return _map.put(key, value); }
public V put(K key, V value) { if (_map.size() >= _maxEntries) { // double-locking, yes, but safe here; trying to avoid "clear storms" synchronized (this) { if (_map.size() >= _maxEntries) { clear(); } } } return _map.put(key, value); }
/** * @since 2.5 */ public V putIfAbsent(K key, V value) { // not 100% optimal semantically, but better from correctness (never exceeds // defined maximum) and close enough all in all: if (_map.size() >= _maxEntries) { synchronized (this) { if (_map.size() >= _maxEntries) { clear(); } } } return _map.putIfAbsent(key, value); }
/** * @since 2.5 */ public V putIfAbsent(K key, V value) { // not 100% optimal semantically, but better from correctness (never exceeds // defined maximum) and close enough all in all: if (_map.size() >= _maxEntries) { synchronized (this) { if (_map.size() >= _maxEntries) { clear(); } } } return _map.putIfAbsent(key, value); }
/** * @since 2.5 */ public V putIfAbsent(K key, V value) { // not 100% optimal semantically, but better from correctness (never exceeds // defined maximum) and close enough all in all: if (_map.size() >= _maxEntries) { synchronized (this) { if (_map.size() >= _maxEntries) { clear(); } } } return _map.putIfAbsent(key, value); }
/** * @since 2.5 */ public V putIfAbsent(K key, V value) { // not 100% optimal semantically, but better from correctness (never exceeds // defined maximum) and close enough all in all: if (_map.size() >= _maxEntries) { synchronized (this) { if (_map.size() >= _maxEntries) { clear(); } } } return _map.putIfAbsent(key, value); }