You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2014/02/20 09:13:08 UTC

git commit: CAMEL-7218 Updated the activator class name to be the camel-core one

Repository: camel
Updated Branches:
  refs/heads/master 2e0ced97f -> 2db5fbf7a


CAMEL-7218 Updated the activator class name to be the camel-core one


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

Branch: refs/heads/master
Commit: 2db5fbf7a3bec00de819e7f426286d61eb6732ea
Parents: 2e0ced9
Author: Willem Jiang <wi...@gmail.com>
Authored: Thu Feb 20 16:04:39 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Thu Feb 20 16:12:40 2014 +0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/camel/util/PlatformHelper.java      | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/2db5fbf7/camel-core/src/main/java/org/apache/camel/util/PlatformHelper.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/util/PlatformHelper.java b/camel-core/src/main/java/org/apache/camel/util/PlatformHelper.java
index 258248c..f7c40f5 100644
--- a/camel-core/src/main/java/org/apache/camel/util/PlatformHelper.java
+++ b/camel-core/src/main/java/org/apache/camel/util/PlatformHelper.java
@@ -44,7 +44,7 @@ public final class PlatformHelper {
         try {
             // Try to load the BundleActivator first
             Class.forName("org.osgi.framework.BundleActivator");
-            Class<?> activatorClass = classLoader.loadClass("org.apache.camel.osgi.Activator");
+            Class<?> activatorClass = classLoader.loadClass("org.apache.camel.impl.osgi.Activator");
             Method getBundleMethod = activatorClass.getDeclaredMethod("getBundle");
             Object bundle = getBundleMethod.invoke(null);
             return bundle != null;
@@ -55,7 +55,7 @@ public final class PlatformHelper {
     }
 
     public static boolean isInOsgiEnvironment() {
-        return isInOsgiEnvironment(currentThread().getContextClassLoader());
+        return isInOsgiEnvironment(PlatformHelper.class.getClassLoader());
     }
 
 }


Re: git commit: CAMEL-7218 Updated the activator class name to be the camel-core one

Posted by Henryk Konsek <he...@gmail.com>.
Hi Willem,

> I will dig the integration test fail issue.

The issue is that Camel Core activator doesn't provide static BundleContext.

Please check out my latest commit
(a42a2ca9542bfb83cf010168aeb8fd82f7b197bf). I changed the
implementation to use OSGi FrameworkUtil instead of classloading
magic.

What do you think about it?

Cheers.

PS I tested it against BeanValidatorTest and it works fine.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com

Re: git commit: CAMEL-7218 Updated the activator class name to be the camel-core one

Posted by Henryk Konsek <he...@gmail.com>.
Hi Willem,

> -            Class<?> activatorClass = classLoader.loadClass("org.apache.camel.osgi.Activator");
> +            Class<?> activatorClass = classLoader.loadClass("org.apache.camel.impl.osgi.Activator");

Actually switching from org.apache.camel.osgi.Activator to
org.apache.camel.impl.osgi.Activator broke the isInOsgiEnvironment
functionality. Try to execute BeanValidatorTest integration test in
order to verify this. Why exactly would you like to switch to impl
class?

Cheers.

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com