+ boolean isSpringInstrumented = bundle.getEntryPaths(
+ "/META-INF/spring").hasMoreElements()
+ || bundle.getHeaders().get("Spring-Context") == null;
+ if (isSpringInstrumented) {
+ // Wait for Spring application context to be ready
+ String filter = "(Bundle-SymbolicName="
+ + bundle.getSymbolicName() + ")";
+ try {
+ bundlesManager.getServiceRefSynchronous(
+ ApplicationContext.class.getName(), filter);
+ } catch (Exception e) {
+ // stop if application context not found
+ bundle.stop();
+ throw e;
+ }
+ }
+ } catch (Exception e) {