/** * Put service keyed by spi & classLoader. * * @param classLoader The {@link EnvironmentCache} key * @param spiName The SPI class name * @param service The SPI object reference */ private static synchronized void put(ClassLoader classLoader, String spiName, Object service) { if (service != null) { Map<String, Object> spis = EnvironmentCache.get(classLoader); if (spis == null) { spis = new HashMap<String, Object>(EnvironmentCache.smallHashSize); EnvironmentCache.put(classLoader, spis); } spis.put(spiName, service); } }