Author: snjeza
Date: 2011-08-25 18:49:21 -0400 (Thu, 25 Aug 2011)
New Revision: 34329
Added:
trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/.project
trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/build.properties
trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/feature.properties
trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/feature.xml
trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/license.html
trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/pom.xml
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/.classpath
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/.project
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/.settings/
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/.settings/org.eclipse.jdt.core.prefs
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/META-INF/
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/META-INF/MANIFEST.MF
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/about.html
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/about.ini
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/about.mappings
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/about.properties
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/build.properties
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/jboss_about.png
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/plugin.properties
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/plugin.xml
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/pom.xml
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/src/
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/src/org/
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/src/org/jboss/
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/src/org/jboss/tools/
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/src/org/jboss/tools/runtime/
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/src/org/jboss/tools/runtime/esb/
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/src/org/jboss/tools/runtime/esb/detector/
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/src/org/jboss/tools/runtime/esb/detector/RuntimeEsbActivator.java
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/src/org/jboss/tools/runtime/handlers/
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/src/org/jboss/tools/runtime/handlers/EsbHandler.java
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/JBossASHandler.java
trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/RuntimeCoreActivator.java
trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/AbstractRuntimeDetector.java
trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/IRuntimeDetector.java
Log:
JBIDE-8919 Recognize and define ESB Runtime from SOA-P product
Added: trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/.project
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/.project
(rev 0)
+++
trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/.project 2011-08-25
22:49:21 UTC (rev 34329)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.runtime.esb.detector.feature</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.pde.FeatureBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.FeatureNature</nature>
+ </natures>
+</projectDescription>
Added:
trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/build.properties
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/build.properties
(rev 0)
+++
trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/build.properties 2011-08-25
22:49:21 UTC (rev 34329)
@@ -0,0 +1,3 @@
+bin.includes = feature.xml,\
+ license.html,\
+ feature.properties
Added:
trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/feature.properties
===================================================================
---
trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/feature.properties
(rev 0)
+++
trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/feature.properties 2011-08-25
22:49:21 UTC (rev 34329)
@@ -0,0 +1,55 @@
+###############################################################################
+# Copyright (c) 2009-2011 Red Hat, Inc. and others.
+# All rights reserved. This program and the accompanying materials
+# are 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:
+# JBoss by Red Hat - Initial implementation.
+##############################################################################
+# feature.properties
+# contains externalized strings for feature.xml
+# "%foo" in feature.xml corresponds to the key "foo" in this file
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file should be translated.
+
+# "featureName" property - name of the feature
+featureName=JBoss Runtime ESB Detector
+
+# "providerName" property - name of the company that provides the feature
+providerName=JBoss by Red Hat
+
+# "updateSiteName" property - label for the update/discovery sites
+updateSiteName=JBoss Developer Studio Updates
+JBossToolsUpdatesSiteName=JBoss Tools Updates
+
+# "description" property - description of the feature
+description=JBoss Runtime ESB Detector
+
+# "copyright" property - text of the "Feature Update Copyright"
+copyright=Copyright (c) 2008-2011 Red Hat, Inc. and others.\nAll rights reserved. This
program and the accompanying materials\n
+are made available under the terms of the Eclipse Public License v1.0\n\
+which accompanies this distribution, and is available at\n\
+http\://www.eclipse.org/legal/epl-v10.html\n\
+\n\
+Contributors\:\n\
+JBoss by Red Hat - Initial implementation.\n
+ ############### end of copyright property ####################################
+
+# "licenseURL" property - URL of the "Feature License"
+# do not translate value - just change to point to a locale-specific HTML page
+licenseURL=license.html
+
+# START NON-TRANSLATABLE
+# "license" property - text of the "Feature Update License"
+# should be plain text version of license agreement pointed to be "licenseURL"
+license=Red Hat, Inc. licenses these features and plugins to you under \
+certain open source licenses (or aggregations of such licenses), which \
+in a particular case may include the Eclipse Public License, the GNU \
+Lesser General Public License, and/or certain other open source \
+licenses. For precise licensing details, consult the corresponding \
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive, \
+Raleigh NC 27606 USA.
+# END NON-TRANSLATABLE
+########### end of license property ##########################################
Added: trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/feature.xml
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/feature.xml
(rev 0)
+++
trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/feature.xml 2011-08-25
22:49:21 UTC (rev 34329)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feature
+ id="org.jboss.tools.runtime.esb.detector.feature"
+ label="%featureName"
+ version="1.0.0.qualifier"
+ provider-name="%providerName"
+ plugin="org.jboss.tools.runtime.esb.detector">
+
+ <description>
+ %description
+ </description>
+
+ <copyright>
+ %copyright
+ </copyright>
+
+ <license url="%licenseURL">
+ %license
+ </license>
+
+ <plugin
+ id="org.jboss.tools.runtime.esb.detector"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
+</feature>
Added: trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/license.html
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/license.html
(rev 0)
+++
trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/license.html 2011-08-25
22:49:21 UTC (rev 34329)
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+
+<body>
+<p>Red Hat, Inc. licenses these features and plugins to you under
+certain open source licenses (or aggregations of such licenses), which
+in a particular case may include the Eclipse Public License, the GNU
+Lesser General Public License, and/or certain other open source
+licenses. For precise licensing details, consult the corresponding
+source code, or contact Red Hat Legal Affairs, 1801 Varsity Drive,
+Raleigh NC 27606 USA.
+</p>
+</body>
+</html>
\ No newline at end of file
Added: trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/pom.xml
===================================================================
--- trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/pom.xml
(rev 0)
+++ trunk/runtime/features/org.jboss.tools.runtime.esb.detector.feature/pom.xml 2011-08-25
22:49:21 UTC (rev 34329)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.runtime</groupId>
+ <artifactId>features</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.runtime.features</groupId>
+ <artifactId>org.jboss.tools.runtime.esb.detector.feature</artifactId>
+
+ <packaging>eclipse-feature</packaging>
+</project>
\ No newline at end of file
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/JBossASHandler.java
===================================================================
---
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/JBossASHandler.java 2011-08-25
22:46:27 UTC (rev 34328)
+++
trunk/runtime/plugins/org.jboss.tools.runtime.as.detector/src/org/jboss/tools/runtime/handlers/JBossASHandler.java 2011-08-25
22:49:21 UTC (rev 34329)
@@ -67,6 +67,7 @@
private static final int JBOSS_AS7_INDEX = 8;
private static String[] hasIncludedRuntimes = new String[] {SOA_P, EAP, EPP, EWP,
SOA_P_STD};
private static final String DROOLS = "DROOLS"; // NON-NLS-1$
+ private static final String ESB = "ESB"; //$NON-NLS-1$
public void initializeRuntimes(List<ServerDefinition> serverDefinitions) {
// FIXME
@@ -434,27 +435,69 @@
serverDefinitions.addAll(definitions);
}
if (SOA_P.equals(type) || SOA_P_STD.equals(type)) {
- Bundle drools = Platform.getBundle("org.drools.eclipse");
- Bundle droolsDetector = Platform
- .getBundle("org.jboss.tools.runtime.drools.detector");
- if (drools != null && droolsDetector != null) {
- File droolsRoot = serverDefinition.getLocation();
- if (droolsRoot.isDirectory()) {
- String name = "Drools - " + serverDefinition.getName();
- ServerDefinition droolsDefinition = new ServerDefinition(
- name, serverDefinition.getVersion(), DROOLS,
- droolsRoot);
- droolsDefinition.setParent(serverDefinition);
- serverDefinition.getIncludedServerDefinitions().add(
- droolsDefinition);
- }
- }
+ addDrools(serverDefinition);
+ addEsb(serverDefinition);
}
} finally {
setEnabled(saved);
}
}
+ private void addDrools(ServerDefinition serverDefinition) {
+ if (serverDefinition == null) {
+ return;
+ }
+ Bundle drools = Platform.getBundle("org.drools.eclipse");
+ Bundle droolsDetector = Platform
+ .getBundle("org.jboss.tools.runtime.drools.detector");
+ if (drools != null && droolsDetector != null) {
+ File droolsRoot = serverDefinition.getLocation();
+ if (droolsRoot.isDirectory()) {
+ String name = "Drools - " + serverDefinition.getName();
+ ServerDefinition droolsDefinition = new ServerDefinition(
+ name, serverDefinition.getVersion(), DROOLS,
+ droolsRoot);
+ droolsDefinition.setParent(serverDefinition);
+ serverDefinition.getIncludedServerDefinitions().add(
+ droolsDefinition);
+ }
+ }
+ }
+
+ private void addEsb(ServerDefinition serverDefinition) {
+ if (serverDefinition == null) {
+ return;
+ }
+ Bundle esb = Platform.getBundle("org.jboss.tools.esb.project.core");
+ Bundle esbDetectorPlugin = Platform
+ .getBundle("org.jboss.tools.runtime.esb.detector");
+ if (esb != null && esbDetectorPlugin != null) {
+ String type = serverDefinition.getType();
+ File esbRoot;
+ if (SOA_P.equals(type)) {
+ esbRoot = serverDefinition.getLocation();
+ } else {
+ esbRoot = new File(serverDefinition.getLocation(), "jboss-esb");
//$NON-NLS-1$
+ }
+ if (esbRoot.isDirectory()) {
+ String name = "ESB - " + serverDefinition.getName();
+ String version="";
+ ServerDefinition esbDefinition = new ServerDefinition(
+ name, version, ESB,
+ esbRoot);
+ IRuntimeDetector esbDetector = RuntimeCoreActivator.getEsbDetector();
+ if (esbDetector != null) {
+ version = esbDetector.getVersion(esbDefinition);
+ esbDefinition.setVersion(version);
+ }
+
+ esbDefinition.setParent(serverDefinition);
+ serverDefinition.getIncludedServerDefinitions().add(
+ esbDefinition);
+ }
+ }
+ }
+
private boolean hasIncludedRuntimes(String type) {
for (String t:hasIncludedRuntimes) {
if (t.equals(type)) {
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/RuntimeCoreActivator.java
===================================================================
---
trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/RuntimeCoreActivator.java 2011-08-25
22:46:27 UTC (rev 34328)
+++
trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/RuntimeCoreActivator.java 2011-08-25
22:49:21 UTC (rev 34329)
@@ -41,6 +41,8 @@
// The plug-in ID
public static final String PLUGIN_ID = "org.jboss.tools.runtime.core";
//$NON-NLS-1$
+
+ private static final String ESB_DETECTOR_ID =
"org.jboss.tools.runtime.handlers.EsbHandler"; //$NON-NLS-1$
private static final String RUNTIME_DETECTOR_EXTENSION_ID =
"org.jboss.tools.runtime.core.runtimeDetectors";
@@ -60,6 +62,8 @@
private static Set<IRuntimeDetector> runtimeDetectors;
+ private static IRuntimeDetector esbDetector;
+
// The shared instance
private static RuntimeCoreActivator plugin;
@@ -206,9 +210,20 @@
private static IEclipsePreferences getPreferences() {
if (prefs == null) {
- prefs = new ConfigurationScope().getNode(PLUGIN_ID);
+ prefs = ConfigurationScope.INSTANCE.getNode(PLUGIN_ID);
}
return prefs;
}
+
+ public static IRuntimeDetector getEsbDetector() {
+ if (esbDetector == null) {
+ for (IRuntimeDetector detector:getDeclaredRuntimeDetectors()) {
+ if (ESB_DETECTOR_ID.equals(detector.getId())) {
+ esbDetector = detector;
+ }
+ }
+ }
+ return esbDetector;
+ }
}
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/AbstractRuntimeDetector.java
===================================================================
---
trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/AbstractRuntimeDetector.java 2011-08-25
22:46:27 UTC (rev 34328)
+++
trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/AbstractRuntimeDetector.java 2011-08-25
22:49:21 UTC (rev 34329)
@@ -137,4 +137,12 @@
public void setValid(boolean valid) {
this.valid = valid;
}
+
+ @Override
+ public String getVersion(ServerDefinition serverDefinition) {
+ if (serverDefinition != null) {
+ return serverDefinition.getVersion();
+ }
+ return null;
+ }
}
Modified:
trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/IRuntimeDetector.java
===================================================================
---
trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/IRuntimeDetector.java 2011-08-25
22:46:27 UTC (rev 34328)
+++
trunk/runtime/plugins/org.jboss.tools.runtime.core/src/org/jboss/tools/runtime/core/model/IRuntimeDetector.java 2011-08-25
22:49:21 UTC (rev 34329)
@@ -51,4 +51,6 @@
boolean isValid();
void setValid(boolean valid);
+
+ String getVersion(ServerDefinition serverDefinition);
}
Added: trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/.classpath
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/.classpath
(rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/.classpath 2011-08-25
22:49:21 UTC (rev 34329)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/.project
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/.project
(rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/.project 2011-08-25
22:49:21 UTC (rev 34329)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.runtime.esb.detector</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added:
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/.settings/org.eclipse.jdt.core.prefs 2011-08-25
22:49:21 UTC (rev 34329)
@@ -0,0 +1,8 @@
+#Thu Aug 25 03:56:51 CEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/META-INF/MANIFEST.MF
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/META-INF/MANIFEST.MF
(rev 0)
+++
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/META-INF/MANIFEST.MF 2011-08-25
22:49:21 UTC (rev 34329)
@@ -0,0 +1,14 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %BundleName
+Bundle-SymbolicName: org.jboss.tools.runtime.esb.detector;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.runtime.esb.detector.RuntimeEsbActivator
+Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
+ org.eclipse.core.runtime;bundle-version="3.7.0",
+ org.jboss.tools.esb.project.core,
+ org.jboss.tools.runtime.core
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Bundle-Localization: plugin
+Bundle-Vendor: %BundleVendor
Added: trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/about.html
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/about.html
(rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/about.html 2011-08-25
22:49:21 UTC (rev 34329)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1" />
+<title>JBoss Runtime Detection</title>
+<style type="text/css" media="screen">
+<!--
+ body {
+ font-family: Sans-serif, Arial, Helvetica;
+ }
+
+-->
+</style>
+</head>
+<body>
+<h1>JBoss Runtime ESB Detector</h1>
+
+<p>
+This plugin is part of the JBoss Tools developed by the <a
href="http://www.jboss.com">JBoss Inc.</a>
+</p>
+
+<p>Information about this plugin is available at <a
href="http://www.jboss.org/tools">JBoss Tools project
page</a></p>
+
+<p>
+This software is distributed under the terms of the Eclipse Public License - v 1.0
+(see <a
href="www.eclipse.org/legal/epl-v10.html">Eclipse Public License
- Version 1.0</a>).
+</p>
+</body>
+</html>
\ No newline at end of file
Added: trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/about.ini
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/about.ini
(rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/about.ini 2011-08-25
22:49:21 UTC (rev 34329)
@@ -0,0 +1,27 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+# test
+# Property "aboutText" contains blurb for "About" dialog
(translated)
+aboutText=%blurb
+
+# Property "windowImage" contains path to window icon (16x16)
+# needed for primary features only
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=jboss_about.png
+
+# Property "aboutImage" contains path to product image (500x330 or 115x164)
+# needed for primary features only
+
+# Property "appName" contains name of the application (not translated)
+# needed for primary features only
+
+# Property "welcomePerspective" contains the id of the perspective in which
the
+# welcome page is to be opened.
+# optional
+
+
+
Added: trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/about.mappings
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/about.mappings
(rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/about.mappings 2011-08-25
22:49:21 UTC (rev 34329)
@@ -0,0 +1,5 @@
+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
Added: trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/about.properties
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/about.properties
(rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/about.properties 2011-08-25
22:49:21 UTC (rev 34329)
@@ -0,0 +1,2 @@
+blurb=JBoss Runtime ESB Detector\n\nVersion\: {featureVersion}\n\n(c) Copyright JBoss by
Red Hat, contributors and others 2004 - 2011. All rights reserved.\nVisit
http\://jboss.org/tools
+
Added: trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/build.properties
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/build.properties
(rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/build.properties 2011-08-25
22:49:21 UTC (rev 34329)
@@ -0,0 +1,11 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ about.html,\
+ about.ini,\
+ about.mappings,\
+ about.properties,\
+ jboss_about.png
Added: trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/jboss_about.png
===================================================================
(Binary files differ)
Property changes on:
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/jboss_about.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/plugin.properties
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/plugin.properties
(rev 0)
+++
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/plugin.properties 2011-08-25
22:49:21 UTC (rev 34329)
@@ -0,0 +1,3 @@
+#Properties file for org.jboss.tools.runtime.esb.detector
+BundleVendor = JBoss by Red Hat
+BundleName = JBoss Runtime ESB Detector
Added: trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/plugin.xml
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/plugin.xml
(rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/plugin.xml 2011-08-25
22:49:21 UTC (rev 34329)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+ <extension
+ point="org.jboss.tools.runtime.core.runtimeDetectors">
+ <runtimeDetector
+ id="org.jboss.tools.runtime.handlers.EsbHandler"
+ name="Esb"
+ class="org.jboss.tools.runtime.handlers.EsbHandler"
+ preferenceId="org.jboss.tools.esb.project.runtime.preference"
+ priority="500"/>
+ </extension>
+</plugin>
Added: trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/pom.xml
===================================================================
--- trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/pom.xml
(rev 0)
+++ trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/pom.xml 2011-08-25 22:49:21
UTC (rev 34329)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.jboss.tools.runtime</groupId>
+ <artifactId>plugins</artifactId>
+ <version>1.3.0-SNAPSHOT</version>
+ </parent>
+ <groupId>org.jboss.tools.runtime.plugins</groupId>
+ <artifactId>org.jboss.tools.runtime.esb.detector</artifactId>
+
+ <packaging>eclipse-plugin</packaging>
+</project>
\ No newline at end of file
Added:
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/src/org/jboss/tools/runtime/esb/detector/RuntimeEsbActivator.java
===================================================================
---
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/src/org/jboss/tools/runtime/esb/detector/RuntimeEsbActivator.java
(rev 0)
+++
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/src/org/jboss/tools/runtime/esb/detector/RuntimeEsbActivator.java 2011-08-25
22:49:21 UTC (rev 34329)
@@ -0,0 +1,50 @@
+package org.jboss.tools.runtime.esb.detector;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class RuntimeEsbActivator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.runtime.esb.detector";
//$NON-NLS-1$
+
+ // The shared instance
+ private static RuntimeEsbActivator plugin;
+
+ /**
+ * The constructor
+ */
+ public RuntimeEsbActivator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static RuntimeEsbActivator getDefault() {
+ return plugin;
+ }
+
+}
Added:
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/src/org/jboss/tools/runtime/handlers/EsbHandler.java
===================================================================
---
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/src/org/jboss/tools/runtime/handlers/EsbHandler.java
(rev 0)
+++
trunk/runtime/plugins/org.jboss.tools.runtime.esb.detector/src/org/jboss/tools/runtime/handlers/EsbHandler.java 2011-08-25
22:49:21 UTC (rev 34329)
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.runtime.handlers;
+
+import java.io.File;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.jboss.tools.esb.core.runtime.JBossESBRuntime;
+import org.jboss.tools.esb.core.runtime.JBossRuntimeManager;
+import org.jboss.tools.runtime.core.model.AbstractRuntimeDetector;
+import org.jboss.tools.runtime.core.model.ServerDefinition;
+
+public class EsbHandler extends AbstractRuntimeDetector {
+
+ private static final String DEFAULT_CONFIGURATION = "default";
+ private static final String ESB = "ESB"; //$NON-NLS-1$
+
+ public void initializeRuntimes(List<ServerDefinition> serverDefinitions) {
+ for (ServerDefinition serverDefinition : serverDefinitions) {
+ String type = serverDefinition.getType();
+ if (serverDefinition.isEnabled() && !esbExists(serverDefinition)) {
+ if (ESB.equals(type)) {
+ JBossESBRuntime runtime = new JBossESBRuntime();
+ runtime.setName("ESB - " + serverDefinition.getName()); //$NON-NLS-1$
+ runtime.setHomeDir(serverDefinition.getLocation()
+ .getAbsolutePath());
+ runtime.setConfiguration(DEFAULT_CONFIGURATION);
+ runtime.setVersion(serverDefinition.getVersion());
+ JBossRuntimeManager.getInstance().addRuntime(runtime);
+ }
+ }
+ initializeRuntimes(serverDefinition.getIncludedServerDefinitions());
+ }
+ }
+
+ /**
+ * @param serverDefinition
+ * @return
+ */
+ private static boolean esbExists(ServerDefinition serverDefinition) {
+ JBossESBRuntime[] runtimes = JBossRuntimeManager.getInstance().getRuntimes();
+ for (JBossESBRuntime runtime:runtimes) {
+ String location = runtime.getHomeDir();
+ if (location != null &&
location.equals(serverDefinition.getLocation().getAbsolutePath())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public ServerDefinition getServerDefinition(File root,
+ IProgressMonitor monitor) {
+ if (monitor.isCanceled() || root == null) {
+ return null;
+ }
+ // standalone ESB runtime
+ return null;
+ }
+
+ @Override
+ public boolean exists(ServerDefinition serverDefinition) {
+ if (serverDefinition == null || serverDefinition.getLocation() == null) {
+ return false;
+ }
+ return esbExists(serverDefinition);
+ }
+
+ @Override
+ public String getVersion(ServerDefinition serverDefinition) {
+ if (serverDefinition == null || serverDefinition.getLocation() == null) {
+ return null;
+ }
+ return
JBossRuntimeManager.getInstance().getVersion(serverDefinition.getLocation().getAbsolutePath(),
DEFAULT_CONFIGURATION);
+ }
+}