/** * Retrieve a processor that was previously put() in this keeper. The id is the value returned * from put(). If there is no processor by that id, or it has been garbage collected, null is * returned. */ public Object retrieve(int id) { Object o = null; if (this.useWeakRefs) { final WeakReference<?> ref = (WeakReference<?>) this.map.get(id); if (ref != null) { o = ref.get(); if (o == null) { // Clean up this.map.remove(id, ref); } } } else { o = this.map.get(id); } // System.out.println("ProcessorKeeper.retrieve(" + int + ") returning " + processor); return o; }