[CAMEL-7218] Extracted OSGi-detection logic into utility class.