Author: snjeza
Date: 2012-04-18 04:56:04 -0400 (Wed, 18 Apr 2012)
New Revision: 40272
Added:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_411.java
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
Log:
JBDS-2094 - JBDS Beta3 supports JBoss ESB runtime versions up to version 4.10, but 4.11
shipped last week
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2012-04-18 08:09:48 UTC
(rev 40271)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2012-04-18 08:56:04 UTC
(rev 40272)
@@ -157,6 +157,24 @@
</and>
</constraint>
</project-facet-version>
+ <project-facet-version
+ facet="jst.jboss.esb"
+ version="4.11">
+ <group-member
+ id="modules">
+ </group-member>
+ <constraint>
+ <and>
+ <conflicts
+ group="modules">
+ </conflicts>
+ <requires
+ facet="jst.java"
+ version="[5.0">
+ </requires>
+ </and>
+ </constraint>
+ </project-facet-version>
<action
facet="jst.jboss.esb"
id="jst.jboss.esb.install"
@@ -186,7 +204,7 @@
<supported>
<facet
id="jst.jboss.esb"
- version="4.2,4.3,4.4,4.5,4.6,4.7,4.9,4.10">
+ version="4.2,4.3,4.4,4.5,4.6,4.7,4.9,4.10,4.11">
</facet>
<runtime-component
id="org.jboss.ide.eclipse.as.runtime.component"
@@ -196,7 +214,7 @@
<supported>
<facet
id="jst.jboss.esb"
- version="4.2,4.3,4.4,4.5,4.6,4.7,4.9,4.10">
+ version="4.2,4.3,4.4,4.5,4.6,4.7,4.9,4.10,4.11">
</facet>
<runtime-component
id="org.jboss.ide.eclipse.eap.runtime.component"
@@ -239,7 +257,7 @@
projects="true">
<moduleType
types="jst.jboss.esb"
- versions="4.2,4.3,4.4,4.5,4.6,4.7,4.9,4.10">
+ versions="4.2,4.3,4.4,4.5,4.6,4.7,4.9,4.10,4.11">
</moduleType>
</moduleFactory>
</extension>
@@ -355,6 +373,23 @@
id="org.jboss.ide.eclipse.as.runtime.60">
</supportedRuntimeType>
</Resolver>
+ <Resolver
+ class="org.jboss.tools.esb.core.runtime.ESBRuntimeResolver_411"
+ esbVersion="4.11"
+ name="ESB runtime resolver">
+ <supportedRuntimeType
+ id="org.jboss.ide.eclipse.as.runtime.eap.51">
+ </supportedRuntimeType>
+ <supportedRuntimeType
+ id="org.jboss.ide.eclipse.as.runtime.50">
+ </supportedRuntimeType>
+ <supportedRuntimeType
+ id="org.jboss.ide.eclipse.as.runtime.51">
+ </supportedRuntimeType>
+ <supportedRuntimeType
+ id="org.jboss.ide.eclipse.as.runtime.60">
+ </supportedRuntimeType>
+ </Resolver>
</extension>
</plugin>
Added:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_411.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_411.java
(rev 0)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_411.java 2012-04-18
08:56:04 UTC (rev 40272)
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.esb.core.runtime;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
+
+public class ESBRuntimeResolver_411 extends AbstractESBRuntimeResolver implements
+ IESBRuntimeResolver {
+
+ private final static String JUDDI_CLIENT_JAR_313 = "juddi-client-3.1.3.jar";
+
+ public boolean isValidESBRuntime(String location, String version, String
configuration){
+ List<String> jarNames = new ArrayList<String>();
+
+ for(File file : getAllRuntimeJars(location, configuration)){
+ jarNames.add(file.getName());
+ }
+
+ return jarNames.contains(ROSETTA_JAR) &&
+ (jarNames.contains(JUDDI_CLIENT_JAR_313));
+ }
+
+
+ public List<IPath> getJarDirectories(String runtimeLocation, String configuration)
{
+ List<IPath> directories = super.getJarDirectories(runtimeLocation,
configuration);
+ IPath rtHome = new Path(runtimeLocation);
+ IPath soapDeployPath = rtHome.append(SOAP_AS_LOCATION)
+ .append(IJBossRuntimeResourceConstants.SERVER).append(configuration)
+ .append(IJBossRuntimeResourceConstants.DEPLOYERS)
+ .append("esb.deployer").append("lib");
+
+ IPath deployPath = rtHome
+ .append(IJBossRuntimeResourceConstants.SERVER).append(configuration)
+ .append(IJBossRuntimeResourceConstants.DEPLOYERS)
+ .append("esb.deployer").append("lib");
+ directories.add(soapDeployPath);
+ directories.add(deployPath);
+
+ return directories;
+ }
+
+
+}
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java 2012-04-18
08:09:48 UTC (rev 40271)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java 2012-04-18
08:56:04 UTC (rev 40272)
@@ -497,7 +497,7 @@
else if(version.equals("4.3.0")) {
version = "4.4";
}
- else if(version.length() > 3){
+ else if(version.length() > 3 && ! (version.charAt(version.length()-1) >=
'0' && version.charAt(version.length()-1) < '9') ){
version = version.substring(0,3);
}
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java 2012-04-18
08:09:48 UTC (rev 40271)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java 2012-04-18
08:56:04 UTC (rev 40272)
@@ -15,6 +15,7 @@
import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -631,9 +632,50 @@
for(IProjectFacetVersion version: esbfacet.getVersions()){
versions.add(version.getVersionString());
}
+ //versions.add("");
+ Comparator<String> comparator = new Comparator<String>() {
+
+ public int compare(String o1, String o2) {
+ if (o1 == null || o2 == null) {
+ return 0;
+ }
+ String[] split1 = o1.split("\\.");
+ String[] split2 = o2.split("\\.");
+ if (split1.length != 2 || split2.length != 2) {
+ return o1.compareTo(o2);
+ }
+ int o11;
+ int o12;
+ int o21;
+ int o22;
+ try {
+ o11 = new Integer(split1[0]);
+ o12 = new Integer(split1[1]);
+ o21 = new Integer(split2[0]);
+ o22 = new Integer(split2[1]);
+ } catch (NumberFormatException e) {
+ return o1.compareTo(o2);
+ }
+
+ if (o11 > o21) {
+ return 1;
+ }
+ if (o11 < o21) {
+ return -1;
+ }
+ if (o12 > o22) {
+ return 1;
+ }
+ if (o12 < o22) {
+ return -1;
+ }
+ return 0;
+ }
+
+ };
+ Collections.sort(versions, comparator);
versions.add("");
- Collections.sort(versions);
- Collections.reverse(versions);
+ //Collections.reverse(versions);
return versions;
}
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2012-04-18
08:09:48 UTC (rev 40271)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2012-04-18
08:56:04 UTC (rev 40272)
@@ -639,6 +639,9 @@
if(versionNumber >= 4.9 || versionNumber == 4.10){
cmVersions.add("1.3.0"); //$NON-NLS-1$
}
+ if(versionNumber == 4.11){
+ cmVersions.add("1.3.1"); //$NON-NLS-1$
+ }
int index = cmVersions.getItemCount() - 1;
String convigVersionName = cmVersions.getItem(index);
cmVersions.select(index);