Class<?> lookup(final PluginType pluginType) throws PluginSourceNotMatchException {
        final MavenPluginPaths pluginPaths = this.findPluginPaths(pluginType);
        final MavenPluginType mavenPluginType = pluginPaths.getPluginType();

        synchronized (this.cacheMap) {  // Synchronize between this.cacheMap.get() and this.cacheMap.put().
            final Class<?> pluginMainClass = this.cacheMap.get(mavenPluginType);
            if (pluginMainClass != null) {
                return pluginMainClass;
            }

            final Class<?> loadedPluginMainClass;
            try (final JarPluginLoader loader = JarPluginLoader.load(
                     pluginPaths.getPluginJarPath(),
                     pluginPaths.getPluginDependencyJarPaths(),
                     this.pluginClassLoaderFactory)) {
                loadedPluginMainClass = loader.getPluginMainClass();
            } catch (final InvalidJarPluginException ex) {
                throw new PluginSourceNotMatchException(ex);
            }

            logger.info("Loaded plugin {} ({})",
                        "embulk-" + this.category + "-" + mavenPluginType.getName(),
                        mavenPluginType.getFullName());

            this.cacheMap.put(mavenPluginType, loadedPluginMainClass);
            return loadedPluginMainClass;
        }
    }
Caches Maven-based plugin's loaded classes such as embulk-ruby's Embulk::PluginRegistry.

<p>See {@code /embulk-ruby/lib/embulk/plugin_registry.rb}.
embulk-core/src/main/java/org/embulk/plugin/maven/MavenPluginRegistry.java