protected Collection<T> allInstances(boolean callBeforeLookup) { if (callBeforeLookup) { reference.lookup.beforeLookup(reference.template); } Collection<T> s = getInstancesCache(); if (s != null) { return s; } Collection<Pair<T>> items = allItemsWithoutBeforeLookup(); ArrayList<T> list = new ArrayList<T>(items.size()); Iterator<Pair<T>> it = items.iterator(); while (it.hasNext()) { Pair<T> item = it.next(); T obj = item.getInstance(); if (reference.template.getType().isInstance(obj)) { list.add(obj); } } s = Collections.unmodifiableList(list); setInstancesCache(s); return s; }
public Collection allInstances () { reference.lookup.beforeLookup (reference.template); Collection s = getInstancesCache (); if (s != null) { return s; } Collection items = allItemsWithoutBeforeLookup (); s = new ArrayList (items.size ()); Iterator it = items.iterator (); while (it.hasNext ()) { Item item = (Item)it.next (); Object obj = item.getInstance (); if (obj != null) { s.add (obj); } } setInstancesCache (s); return s; }
public Collection<T> allInstances() { reference.lookup.beforeLookup(reference.template); Collection<T> s = getInstancesCache(); if (s != null) { return s; } Collection<Pair<T>> items = allItemsWithoutBeforeLookup(); ArrayList<T> list = new ArrayList<T>(items.size()); Iterator<Pair<T>> it = items.iterator(); while (it.hasNext()) { Pair<T> item = it.next(); T obj = item.getInstance(); if (reference.template.getType().isInstance(obj)) { list.add(obj); } } s = Collections.unmodifiableList(list); setInstancesCache(s); return s; }
protected Collection<T> allInstances(boolean callBeforeLookup) { if (callBeforeLookup) { reference.lookup.beforeLookup(reference.template); } Collection<T> s = getInstancesCache(); if (s != null) { return s; } Collection<Pair<T>> items = allItemsWithoutBeforeLookup(); ArrayList<T> list = new ArrayList<T>(items.size()); Iterator<Pair<T>> it = items.iterator(); while (it.hasNext()) { Pair<T> item = it.next(); T obj = item.getInstance(); if (reference.template.getType().isInstance(obj)) { list.add(obj); } } s = Collections.unmodifiableList(list); setInstancesCache(s); return s; }
public Collection allInstances () { reference.lookup.beforeLookup (reference.template); Collection s = getInstancesCache (); if (s != null) { return s; } Collection items = allItemsWithoutBeforeLookup (); s = new ArrayList (items.size ()); Iterator it = items.iterator (); while (it.hasNext ()) { Item item = (Item)it.next (); Object obj = item.getInstance (); if (obj != null) { s.add (obj); } } setInstancesCache (s); return s; }