static Optional<GobblinInstancePlugin> createPlugin(StandardGobblinInstanceDriver instance, GobblinInstancePluginFactory pluginFactory, List<Service> componentServices) { instance.getLog().info("Instantiating a plugin of type: " + pluginFactory); try { GobblinInstancePlugin plugin = pluginFactory.createPlugin(instance); componentServices.add(plugin); instance.getLog().info("Instantiated plugin: " + plugin); return Optional.of(plugin); } catch (RuntimeException e) { instance.getLog().warn("Failed to create plugin: " + e, e); } return Optional.absent(); }