Class ClassServiceLoader


  • public final class ClassServiceLoader
    extends java.lang.Object

    A simplified version of the ServiceLoader in the JDK. Does not lazy load stuff from the resources file, and it returns classes instead of instances to better jive with Guice.

    Cache of loaded values uses soft references and timeouts to response to memory pressures. Likely, the services are only loaded on startup, so keeping the cache read to go for the entire application is wasteful.

    Since:
    1.2
    Version:
    4.0.3
    Author:
    Michael Grove
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <S> java.lang.Iterable<java.lang.Class<? extends S>> classesOf​(java.lang.Class<S> theClass)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClassServiceLoader

        public ClassServiceLoader()
    • Method Detail

      • classesOf

        public static <S> java.lang.Iterable<java.lang.Class<? extends S>> classesOf​(java.lang.Class<S> theClass)