private static void loadExtensionBundles(ConfigServerImpl cs,ConfigImpl config,Document doc,Log log){
  Element parent=getChildByName(doc.getDocumentElement(),"extensions");
  Element[] children=getChildren(parent,"rhextension");
  String strBundles;
  Map<String,BundleDefinition> extensionBundles=new HashMap<String,BundleDefinition>();
  List<RHExtension> extensions=new ArrayList<RHExtension>();
  for (  Element child : children) {
    RHExtension rhe;
    try {
      rhe=new RHExtension(config,child);
      if (rhe.getStartBundles())       rhe.deployBundles();
      extensions.add(rhe);
    }
 catch (    Exception e) {
      log.error("load-extension",e);
      continue;
    }
    BundleInfo[] bfs=rhe.getBundles();
    BundleInfo bf;
    BundleDefinition bd;
    for (int i=0; i < bfs.length; i++) {
      bf=bfs[i];
      extensionBundles.put(bf.getSymbolicName() + "|" + bf.getVersionAsString(),bd=bf.toBundleDefinition());
      try {
        if (rhe.getStartBundles()) {
          Bundle b=bd.getBundle(config);
          OSGiUtil.startIfNecessary(b);
        }
      }
 catch (      BundleException e) {
        log.error("OSGi",e);
      }
    }
  }
  config.setExtensions(extensions.toArray(new RHExtension[extensions.size()]));
  config.setExtensionBundleDefintions(extensionBundles);
}

private static void loadExtensionBundles ( ConfigServerImpl cs , ConfigImpl config , Document doc , Log log ) { Element parent = getChildByName ( doc . getDocumentElement ( ) , "extensions" ) ; Element [ ] children = getChildren ( parent , "rhextension" ) ; String strBundles ; Map < String , BundleDefinition > extensionBundles = new HashMap < String , BundleDefinition > ( ) ; List < RHExtension > extensions = new ArrayList < RHExtension > ( ) ; for ( Element child : children ) { RHExtension rhe ; try { rhe = new RHExtension ( config , child ) ; if ( rhe . getStartBundles ( ) ) rhe . deployBundles ( ) ; extensions . add ( rhe ) ; } catch ( Exception e ) { log . error ( "load-extension" , e ) ; continue ; } BundleInfo [ ] bfs = rhe . getBundles ( ) ; BundleInfo bf ; BundleDefinition bd ; for ( int i = 0 ; i < bfs . length ; i ++ ) { bf = bfs [ i ] ; extensionBundles . put ( bf . getSymbolicName ( ) + "|" + bf . getVersionAsString ( ) , bd = bf . toBundleDefinition ( ) ) ; try { if ( rhe . getStartBundles ( ) ) { Bundle b = bd . getBundle ( config ) ; OSGiUtil . startIfNecessary ( b ) ; } } catch ( BundleException e ) { log . error ( "OSGi" , e ) ; } } } config . setExtensions ( extensions . toArray ( new RHExtension [ extensions . size ( ) ] ) ) ; config . setExtensionBundleDefintions ( extensionBundles ) ; }
loads the bundles defined in the extensions
