scijava/scijava-common — pull request #2 by hinerm (2013-03-18 20:56:38+00:00)
Title: Added lazy service loading mechanism

Adds the capacity to mark services as lazy so they won't be loaded during context construction, but can be loaded on demand later.

To test:

This is easiest to see with a Service implementation that will fail when loaded .. e.g. https://github.com/hinerm/bioformats/blob/scifio-master/components/scifio/src/loci/formats/services/LuraWaveServiceImpl.java .. but any service will work as long as it's not a parameter of another class (as parameters will be loaded before the parent class, regardless of whether they are lazy or not)

1. Verify the service fails or loads as appropriate when "new Context()" is invoked.
2. add "lazy=true" to the service's Plugin annotation
3. repeat (1) and verify there's no error or success message for the service
4. test that context.getService(service.class) causes the same output as before setting lazy to true.