camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject camel git commit: CAMEL-9112: camel-script should not fail if script engine problem in OSGi. camel-script feature should not load groovy/jruby by default, use the camel-script-groovy / camel-script-jruby if you want to use them. Fixed the itest.
Date Sat, 26 Sep 2015 08:44:14 GMT
Repository: camel
Updated Branches:
  refs/heads/master 8e8f7aa4c -> 92dea7363


CAMEL-9112: camel-script should not fail if script engine problem in OSGi. camel-script feature
should not load groovy/jruby by default, use the camel-script-groovy / camel-script-jruby
if you want to use them. Fixed the itest.


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/92dea736
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/92dea736
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/92dea736

Branch: refs/heads/master
Commit: 92dea736345c239dd2f06da3406dc91b9b91f11a
Parents: 8e8f7aa
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Sat Sep 26 10:45:52 2015 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sat Sep 26 10:45:52 2015 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/script/osgi/Activator.java | 7 +++++--
 platforms/karaf/features/src/main/resources/features.xml      | 3 +++
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/92dea736/components/camel-script/src/main/java/org/apache/camel/script/osgi/Activator.java
----------------------------------------------------------------------
diff --git a/components/camel-script/src/main/java/org/apache/camel/script/osgi/Activator.java
b/components/camel-script/src/main/java/org/apache/camel/script/osgi/Activator.java
index 0e6bd66..c1ba1fc 100644
--- a/components/camel-script/src/main/java/org/apache/camel/script/osgi/Activator.java
+++ b/components/camel-script/src/main/java/org/apache/camel/script/osgi/Activator.java
@@ -27,6 +27,8 @@ import java.util.Enumeration;
 import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
 import java.util.concurrent.ConcurrentHashMap;
 import javax.script.ScriptEngine;
 import javax.script.ScriptEngineFactory;
@@ -112,7 +114,8 @@ public class Activator implements BundleActivator, BundleTrackerCustomizer,
Serv
     }
 
     private String[] getAvailableScriptNames() {
-        List<String> names = new ArrayList<String>();
+        // use a set to avoid duplicate names
+        Set<String> names = new TreeSet<String>(String.CASE_INSENSITIVE_ORDER);
         for (List<BundleScriptEngineResolver> list : resolvers.values()) {
             for (BundleScriptEngineResolver r : list) {
                 names.addAll(r.getScriptNames());
@@ -174,7 +177,7 @@ public class Activator implements BundleActivator, BundleTrackerCustomizer,
Serv
             configURL = (URL) e.nextElement();
         }
         if (configURL != null) {
-            LOG.info("Found ScriptEngineFactory in " + bundle.getSymbolicName());
+            LOG.info("Found ScriptEngineFactory in bundle: {}", bundle.getSymbolicName());
             resolvers.add(new BundleScriptEngineResolver(bundle, configURL));
         }
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/92dea736/platforms/karaf/features/src/main/resources/features.xml
----------------------------------------------------------------------
diff --git a/platforms/karaf/features/src/main/resources/features.xml b/platforms/karaf/features/src/main/resources/features.xml
index 36e8ca8..0509cad 100644
--- a/platforms/karaf/features/src/main/resources/features.xml
+++ b/platforms/karaf/features/src/main/resources/features.xml
@@ -1301,16 +1301,19 @@
     <bundle>mvn:org.apache.camel/camel-scr/${project.version}</bundle>
   </feature>
    <feature name='camel-script-jruby' version='${project.version}' resolver='(obr)' start-level='50'>
+    <feature version='${project.version}'>camel-script</feature>
     <bundle>mvn:com.google.code.scriptengines/scriptengines-jruby/${scriptengines-version}</bundle>
     <bundle dependency='true'>mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.scripting-api-1.0/${servicemix-specs-version}</bundle>
     <bundle dependency='true'>mvn:org.jruby/jruby-complete/${jruby-version}</bundle>
   </feature>
   <feature name='camel-script-javascript' version='${project.version}' resolver='(obr)'
start-level='50'>
+    <feature version='${project.version}'>camel-script</feature>
     <bundle>mvn:com.google.code.scriptengines/scriptengines-javascript/${scriptengines-version}</bundle>
     <bundle dependency='true'>mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.scripting-api-1.0/${servicemix-specs-version}</bundle>
     <bundle dependency='true'>mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.rhino/${rhino-bundle-version}</bundle>
   </feature>
   <feature name='camel-script-groovy' version='${project.version}' resolver='(obr)' start-level='50'>
+    <feature version='${project.version}'>camel-script</feature>
     <bundle>mvn:com.google.code.scriptengines/scriptengines-groovy/${scriptengines-version}</bundle>
     <bundle dependency='true'>mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.scripting-api-1.0/${servicemix-specs-version}</bundle>
     <bundle dependency='true'>mvn:org.codehaus.groovy/groovy-all/${groovy-version}</bundle>


Mime
View raw message