public void initializeRuntimes(List<RuntimeDefinition> runtimeDefinitions) {
   for (RuntimeDefinition runtimeDefinition : runtimeDefinitions) {
     String type = runtimeDefinition.getType();
     if (runtimeDefinition.isEnabled() && !esbExists(runtimeDefinition)) {
       if (ESB.equals(type)) {
         JBossESBRuntime runtime = new JBossESBRuntime();
         if (!runtimeDefinition.getName().startsWith(ESB_PREFIX))
           runtime.setName(ESB_PREFIX + runtimeDefinition.getName());
         runtime.setHomeDir(runtimeDefinition.getLocation().getAbsolutePath());
         runtime.setConfiguration(DEFAULT_CONFIGURATION);
         runtime.setVersion(runtimeDefinition.getVersion());
         JBossRuntimeManager.getInstance().addRuntime(runtime);
       }
     }
     initializeRuntimes(runtimeDefinition.getIncludedRuntimeDefinitions());
   }
 }
 private static File getLocation(RuntimeDefinition runtimeDefinitions) {
   String type = runtimeDefinitions.getType();
   String version = runtimeDefinitions.getVersion();
   if ("EAP".equals(type)
       && version != null
       && version.startsWith("6")) { // $NON-NLS-1$ //$NON-NLS-2$
     return runtimeDefinitions.getLocation();
   }
   if ("SOA_P".equals(type)
       || "EAP".equals(type)
       || "EPP".equals(type)) { // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
     return new File(runtimeDefinitions.getLocation(), "jboss-as"); // $NON-NLS-1$
   }
   if ("SOA_P_STD".equals(type)) { // $NON-NLS-1$
     return new File(runtimeDefinitions.getLocation(), "jboss-esb"); // $NON-NLS-1$				
   }
   if ("EWP".equals(type)) { // $NON-NLS-1$
     return new File(runtimeDefinitions.getLocation(), "jboss-as-web"); // $NON-NLS-1$
   }
   if ("AS".equals(type) || "EAP_STD".equals(type)) { // $NON-NLS-1$//$NON-NLS-2$
     return runtimeDefinitions.getLocation();
   }
   return null;
 }
 @Override
 public String getVersion(RuntimeDefinition runtimeDefinition) {
   return runtimeDefinition.getVersion();
 }