atlasmap-attic / atlasmap-runtime

AtlasMap runtime engine and design time services
http://atlasmap.io
Other
3 stars 8 forks source link

OSGi compatibility tasks #21

Open mattrpav opened 7 years ago

mattrpav commented 7 years ago
mattrpav commented 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

mattrpav commented 7 years ago

This task would need to be completed for Fuse 7