Open mattrpav opened 7 years ago
A couple routine(s) to detect running within OSGi:
Option A:
public static boolean detectOsgi() throws Exception { try { First.class.getClassLoader().loadClass("org.osgi.framework.BundleReference"); return true; } catch (Exception e) { // fail.. not in OSGi System.out.println("\n\n\t\t No OSGi detected: " + e.getMessage()); } return false; }
Option B:
this.getClass().getClassLoader() instanceof org.osgi.framework.BundleReference
This task would need to be completed for Fuse 7