in core/camel-core-osgi/src/main/java/org/apache/camel/core/osgi/impl/Activator.java [218:237]
protected void registerLanguages(Bundle bundle, List<BaseService> resolvers) {
if (canSee(bundle, Language.class)) {
Map<String, String> languages = new HashMap<>();
for (Enumeration<?> e = bundle.getEntryPaths(META_INF_LANGUAGE); e != null && e.hasMoreElements();) {
String path = (String) e.nextElement();
LOG.debug("Found entry: {} in bundle {}", path, bundle.getSymbolicName());
String name = path.substring(path.lastIndexOf("/") + 1);
languages.put(name, path);
}
if (!languages.isEmpty()) {
resolvers.add(new BundleLanguageResolver(bundle, languages));
}
for (Enumeration<?> e = bundle.getEntryPaths(META_INF_LANGUAGE_RESOLVER); e != null && e.hasMoreElements();) {
String path = (String) e.nextElement();
LOG.debug("Found entry: {} in bundle {}", path, bundle.getSymbolicName());
String name = path.substring(path.lastIndexOf("/") + 1);
resolvers.add(new BundleMetaLanguageResolver(bundle, name, path));
}
}
}