[jbosstools-commits] JBoss Tools SVN: r39286 - branches/jbosstools-3.3.0.Beta1/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Mon Mar 5 09:14:15 EST 2012
Author: snjeza
Date: 2012-03-05 09:14:14 -0500 (Mon, 05 Mar 2012)
New Revision: 39286
Modified:
branches/jbosstools-3.3.0.Beta1/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java
Log:
JBDS-2048 Runtime detection: Location not added to the paths list
Modified: branches/jbosstools-3.3.0.Beta1/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java
===================================================================
--- branches/jbosstools-3.3.0.Beta1/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java 2012-03-05 14:12:23 UTC (rev 39285)
+++ branches/jbosstools-3.3.0.Beta1/runtime/plugins/org.jboss.tools.runtime.ui/src/org/jboss/tools/runtime/ui/JBossRuntimeStartup.java 2012-03-05 14:14:14 UTC (rev 39286)
@@ -34,10 +34,8 @@
import org.jboss.tools.runtime.core.JBossRuntimeLocator;
import org.jboss.tools.runtime.core.RuntimeCoreActivator;
import org.jboss.tools.runtime.core.model.IRuntimeDetector;
-import org.jboss.tools.runtime.core.model.RuntimePath;
import org.jboss.tools.runtime.core.model.RuntimeDefinition;
-import org.jboss.tools.runtime.ui.RuntimeUIActivator;
-import org.osgi.framework.Bundle;
+import org.jboss.tools.runtime.core.model.RuntimePath;
public class JBossRuntimeStartup {
@@ -48,38 +46,40 @@
private static final String LOCATIONS_FILE_CONFIGURATION = "../../studio/" + LOCATIONS_FILE_NAME; //$NON-NLS-1$
public static void initializeRuntimes(IProgressMonitor monitor) {
- if (isJBDS()) {
- final Set<RuntimePath> runtimePaths = new HashSet<RuntimePath>();
- parseRuntimeLocationsFile(runtimePaths);
- try {
- String configuration = getConfiguration();
- File directory = new File(configuration, JBOSS_EAP_HOME);
- if (directory.isDirectory()) {
- RuntimePath runtimePath = new RuntimePath(directory.getAbsolutePath());
- runtimePaths.add(runtimePath);
- }
- } catch (IOException e) {
- RuntimeUIActivator.log(e);
- }
-
- JBossRuntimeLocator locator = new JBossRuntimeLocator();
- for (RuntimePath runtimePath : runtimePaths) {
+ JBossRuntimeLocator locator = new JBossRuntimeLocator();
+ try {
+ String configuration = getConfiguration();
+ File directory = new File(configuration, JBOSS_EAP_HOME);
+ if (directory.isDirectory()) {
+ RuntimePath runtimePath = new RuntimePath(
+ directory.getAbsolutePath());
List<RuntimeDefinition> serverDefinitions = locator
.searchForRuntimes(runtimePath.getPath(), monitor);
runtimePath.getServerDefinitions().clear();
for (RuntimeDefinition serverDefinition : serverDefinitions) {
serverDefinition.setRuntimePath(runtimePath);
}
- runtimePath.getServerDefinitions().addAll(serverDefinitions);
initializeRuntimes(serverDefinitions);
}
- if (runtimePaths.size() > 0) {
- RuntimeUIActivator.getDefault().getRuntimePaths().addAll(runtimePaths);
- RuntimeUIActivator.getDefault().saveRuntimePaths();
- }
-
-
+ } catch (IOException e) {
+ RuntimeUIActivator.log(e);
}
+ final Set<RuntimePath> runtimePaths = new HashSet<RuntimePath>();
+ parseRuntimeLocationsFile(runtimePaths);
+ for (RuntimePath runtimePath : runtimePaths) {
+ List<RuntimeDefinition> serverDefinitions = locator
+ .searchForRuntimes(runtimePath.getPath(), monitor);
+ runtimePath.getServerDefinitions().clear();
+ for (RuntimeDefinition serverDefinition : serverDefinitions) {
+ serverDefinition.setRuntimePath(runtimePath);
+ }
+ runtimePath.getServerDefinitions().addAll(serverDefinitions);
+ }
+ if (runtimePaths.size() > 0) {
+ RuntimeUIActivator.getDefault().getRuntimePaths()
+ .addAll(runtimePaths);
+ RuntimeUIActivator.getDefault().saveRuntimePaths();
+ }
}
public static void initializeRuntimes(List<RuntimeDefinition> serverDefinitions) {
@@ -91,13 +91,6 @@
}
refreshCommonNavigator();
}
-
-
- private static boolean isJBDS() {
- Bundle jbdsProduct = Platform.getBundle("com.jboss.jbds.product");
- //return jbdsProduct != null;
- return true;
- }
private static void refreshCommonNavigator() {
// https://jira.jboss.org/jira/browse/JBDS-1091
More information about the jbosstools-commits
mailing list