public void put(Object key, Object value) { processQueue(); map.put(key, new SoftValueReference(key, value, queue)); }
private void processQueue() { for (; ; ) { SoftValueReference ref = (SoftValueReference) queue.poll(); if (ref == null) { return; } Object key = ref.getKey(); if (concurrent) { try { atomicRemove.invoke(map, new Object[] { key, ref }); } catch (IllegalAccessException e) { throw new UndeclaredThrowableException(e); } catch (InvocationTargetException e) { throw new UndeclaredThrowableException(e); } } else if (map.get(key) == ref) { map.remove(key); } } }
private void processQueue() { for(;;) { SoftValueReference ref = (SoftValueReference)queue.poll(); if(ref == null) { return; } Object key = ref.getKey(); if(concurrent) { try { atomicRemove.invoke(map, new Object[] { key, ref }); } catch(IllegalAccessException e) { throw new UndeclaredThrowableException(e); } catch(InvocationTargetException e) { throw new UndeclaredThrowableException(e); } } else if(map.get(key) == ref) { map.remove(key); } } }
private void processQueue() { for (; ; ) { SoftValueReference ref = (SoftValueReference) queue.poll(); if (ref == null) { return; } Object key = ref.getKey(); if (concurrent) { try { atomicRemove.invoke(map, new Object[] { key, ref }); } catch (IllegalAccessException e) { throw new UndeclaredThrowableException(e); } catch (InvocationTargetException e) { throw new UndeclaredThrowableException(e); } } else if (map.get(key) == ref) { map.remove(key); } } }
private void processQueue() { for (; ; ) { SoftValueReference ref = (SoftValueReference) queue.poll(); if (ref == null) { return; } Object key = ref.getKey(); if (concurrent) { try { atomicRemove.invoke(map, new Object[] { key, ref }); } catch (IllegalAccessException e) { throw new UndeclaredThrowableException(e); } catch (InvocationTargetException e) { throw new UndeclaredThrowableException(e); } } else if (map.get(key) == ref) { map.remove(key); } } }
public void put(Object key, Object value) { processQueue(); map.put(key, new SoftValueReference(key, value, queue)); }
public void put(Object key, Object value) { processQueue(); map.put(key, new SoftValueReference(key, value, queue)); }
public void put(Object key, Object value) { processQueue(); map.put(key, new SoftValueReference(key, value, queue)); }