/** * Returns a list of all loaded sources. The sources are returned in the order as they have been * loaded by the languages. * * @return an unmodifiable list of sources * @since 0.17 * @deprecated not very flexible, polls all sources without any notification about changes. */ @Deprecated public List<Source> getLoadedSources() { final List<Source> sources = new ArrayList<>(); EventBinding<?> binding = env.getInstrumenter().attachLoadSourceListener(SourceFilter.ANY, new LoadSourceListener() { public void onLoad(LoadSourceEvent event) { sources.add(event.getSource()); } }, true); binding.dispose(); return Collections.unmodifiableList(sources); }