scijava/scijava-common — pull request #17 by dscho (2013-12-14 02:38:13+00:00)
Title: Allow filtering instances before they become singletons

The DefaultSingletonService used to instantiate all the plugins matching
the given type, but one might want to narrow down what becomes a
singleton even further, e.g. when ImageJ2 is looking for the current
platform: it wants to instantiate all plugins implementing the Platform
class, but then only keep the one that claims that it matches the
current platform.

Therefore, let's introduce the filterInstances(List) method that
returns the unmodified list of instances by default, but can be
overridden in subclasses.

Signed-off-by: Johannes Schindelin