@Test void testInstance() throws InterruptedException { final ComponentManager[] managers = new ComponentManager[60]; Thread[] th = new Thread[managers.length]; for (int ind = 0; ind < th.length; ind++) { final int indice = ind; th[ind] = new Thread(() -> { managers[indice] = ComponentManager.instance(); }); th[ind].start(); } for (int ind = 0; ind < th.length; ind++) { th[ind].join(); } Assertions.assertNotNull(managers[0]); for (int i = 1; i < managers.length; i++) { Assertions.assertSame(managers[0], managers[i], "manager " + i + " is another instance"); } }
public static ComponentManager instance() { return SingletonHolder.CONTEXTUAL_INSTANCE.get(); }
ComponentManager implements AutoCloseable { public static ComponentManager instance() { return SingletonHolder.CONTEXTUAL_INSTANCE.get(); } }
ComponentManager implements AutoCloseable { public static ComponentManager instance() { return SingletonHolder.CONTEXTUAL_INSTANCE.get(); } ComponentManager(final File m2);  ComponentManager(final File m2, final String dependenciesResource, final String jmxNamePattern);  ComponentManager(final Path m2);  ComponentManager(final Path m2, final String dependenciesResource, final String jmxNamePattern); }
ComponentManager implements AutoCloseable { public static ComponentManager instance() { return SingletonHolder.CONTEXTUAL_INSTANCE.get(); } ComponentManager(final File m2);  ComponentManager(final File m2, final String dependenciesResource, final String jmxNamePattern);  ComponentManager(final Path m2);  ComponentManager(final Path m2, final String dependenciesResource, final String jmxNamePattern); static ComponentManager instance(); static Path findM2(); void addCallerAsPlugin(); Stream<T> find(final Function<Container, Stream<T>> mapper); Optional<Object> createComponent(final String plugin, final String name, final ComponentType componentType,
            final int version, final Map<String, String> configuration); void autoDiscoverPlugins(final boolean callers, final boolean classpath); Optional<Mapper> findMapper(final String plugin, final String name, final int version,
            final Map<String, String> configuration); Optional<org.talend.sdk.component.runtime.output.Processor> findProcessor(final String plugin,
            final String name, final int version, final Map<String, String> configuration); boolean hasPlugin(final String plugin); Optional<Container> findPlugin(final String plugin); synchronized String addPlugin(final String pluginRootFile); String addWithLocationPlugin(final String location, final String pluginRootFile); void removePlugin(final String id); @Override void close(); List<String> availablePlugins(); }
ComponentManager implements AutoCloseable { public static ComponentManager instance() { return SingletonHolder.CONTEXTUAL_INSTANCE.get(); } ComponentManager(final File m2);  ComponentManager(final File m2, final String dependenciesResource, final String jmxNamePattern);  ComponentManager(final Path m2);  ComponentManager(final Path m2, final String dependenciesResource, final String jmxNamePattern); static ComponentManager instance(); static Path findM2(); void addCallerAsPlugin(); Stream<T> find(final Function<Container, Stream<T>> mapper); Optional<Object> createComponent(final String plugin, final String name, final ComponentType componentType,
            final int version, final Map<String, String> configuration); void autoDiscoverPlugins(final boolean callers, final boolean classpath); Optional<Mapper> findMapper(final String plugin, final String name, final int version,
            final Map<String, String> configuration); Optional<org.talend.sdk.component.runtime.output.Processor> findProcessor(final String plugin,
            final String name, final int version, final Map<String, String> configuration); boolean hasPlugin(final String plugin); Optional<Container> findPlugin(final String plugin); synchronized String addPlugin(final String pluginRootFile); String addWithLocationPlugin(final String location, final String pluginRootFile); void removePlugin(final String id); @Override void close(); List<String> availablePlugins();  }