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

[1/3] git commit: CAMEL-7182: Do not throw checked exception in camel-guice as not allowed for pre/post constructs.

Updated Branches:
  refs/heads/camel-2.11.x 0e5304ca4 -> c8e8e92dc
  refs/heads/camel-2.12.x 60011b979 -> bbd3d8d4f


CAMEL-7182: Do not throw checked exception in camel-guice as not allowed for pre/post constructs.


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

Branch: refs/heads/camel-2.11.x
Commit: c8e8e92dca255743a9dce382501a3a846b680014
Parents: 0e5304c
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Feb 8 09:05:45 2014 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Feb 8 09:07:23 2014 +0100

----------------------------------------------------------------------
 .../apache/camel/guice/GuiceCamelContext.java   | 28 ++++++++++++++------
 1 file changed, 20 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/c8e8e92d/components/camel-guice/src/main/java/org/apache/camel/guice/GuiceCamelContext.java
----------------------------------------------------------------------
diff --git a/components/camel-guice/src/main/java/org/apache/camel/guice/GuiceCamelContext.java b/components/camel-guice/src/main/java/org/apache/camel/guice/GuiceCamelContext.java
index bb2bf59..7059f0f 100644
--- a/components/camel-guice/src/main/java/org/apache/camel/guice/GuiceCamelContext.java
+++ b/components/camel-guice/src/main/java/org/apache/camel/guice/GuiceCamelContext.java
@@ -29,7 +29,6 @@ import com.google.inject.Inject;
 
 import org.apache.camel.ErrorHandlerFactory;
 import org.apache.camel.RoutesBuilder;
-import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.TypeConverter;
 import org.apache.camel.guice.impl.GuiceInjector;
 import org.apache.camel.guice.inject.Injectors;
@@ -41,6 +40,7 @@ import org.apache.camel.spi.InterceptStrategy;
 import org.apache.camel.spi.LanguageResolver;
 import org.apache.camel.spi.LifecycleStrategy;
 import org.apache.camel.spi.Registry;
+import org.apache.camel.util.ObjectHelper;
 
 /**
  * The default CamelContext implementation for working with Guice.
@@ -60,20 +60,32 @@ public class GuiceCamelContext extends DefaultCamelContext {
 
     @PostConstruct
     @Override
-    public void start() throws Exception {
-        super.start();
+    public void start() {
+        try {
+            super.start();
+        } catch (Exception e) {
+            throw ObjectHelper.wrapRuntimeCamelException(e);
+        }
     }
 
     @PreDestroy
     @Override
-    public void stop() throws Exception {
-        super.stop();
+    public void stop() {
+        try {
+            super.stop();
+        } catch (Exception e) {
+            throw ObjectHelper.wrapRuntimeCamelException(e);
+        }
     }
 
     @Inject
-    public void setRouteBuilders(Set<RoutesBuilder> routeBuilders) throws Exception {
+    public void setRouteBuilders(Set<RoutesBuilder> routeBuilders) {
         for (RoutesBuilder builder : routeBuilders) {
-            addRoutes(builder);
+            try {
+                addRoutes(builder);
+            } catch (Exception e) {
+                throw ObjectHelper.wrapRuntimeCamelException(e);
+            }
         }
     }
 
@@ -157,7 +169,7 @@ public class GuiceCamelContext extends DefaultCamelContext {
                 return injector.getInstance(Context.class);
             }
         } catch (Exception e) {
-            throw new RuntimeCamelException(e);
+            throw ObjectHelper.wrapRuntimeCamelException(e);
         }
     }
 


[2/3] git commit: Added @UriParams for camel-twitter

Posted by da...@apache.org.
Added @UriParams for camel-twitter


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

Branch: refs/heads/camel-2.12.x
Commit: 2fb8652a9eaed1179e93a7b994111de4b58e3d5a
Parents: 60011b9
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Feb 8 08:23:40 2014 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Feb 8 09:07:37 2014 +0100

----------------------------------------------------------------------
 .../org/apache/camel/component/twitter/TwitterConfiguration.java | 2 ++
 .../apache/camel/component/twitter/TwitterEndpointDirect.java    | 4 ++++
 .../org/apache/camel/component/twitter/TwitterEndpointEvent.java | 4 ++++
 .../apache/camel/component/twitter/TwitterEndpointPolling.java   | 4 ++++
 4 files changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/2fb8652a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java
index 19e6b20..e693daa 100644
--- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java
+++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterConfiguration.java
@@ -21,6 +21,7 @@ import java.text.SimpleDateFormat;
 import java.util.Date;
 
 import org.apache.camel.spi.UriParam;
+import org.apache.camel.spi.UriParams;
 import twitter4j.Twitter;
 import twitter4j.TwitterFactory;
 import twitter4j.TwitterStream;
@@ -28,6 +29,7 @@ import twitter4j.TwitterStreamFactory;
 import twitter4j.conf.Configuration;
 import twitter4j.conf.ConfigurationBuilder;
 
+@UriParams
 public class TwitterConfiguration {
 
     /**

http://git-wip-us.apache.org/repos/asf/camel/blob/2fb8652a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointDirect.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointDirect.java b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointDirect.java
index 0e4d0c9..e1be501 100644
--- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointDirect.java
+++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointDirect.java
@@ -54,6 +54,10 @@ public class TwitterEndpointDirect extends DirectEndpoint implements TwitterEndp
         return properties;
     }
 
+    public void setProperties(TwitterConfiguration properties) {
+        this.properties = properties;
+    }
+
     @Override
     public EndpointType getEndpointType() {
         return EndpointType.DIRECT;

http://git-wip-us.apache.org/repos/asf/camel/blob/2fb8652a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointEvent.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointEvent.java b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointEvent.java
index fb0fbc5..6d7d009 100644
--- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointEvent.java
+++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointEvent.java
@@ -48,6 +48,10 @@ public class TwitterEndpointEvent extends DirectEndpoint implements TwitterEndpo
         return properties;
     }
 
+    public void setProperties(TwitterConfiguration properties) {
+        this.properties = properties;
+    }
+
     @Override
     public EndpointType getEndpointType() {
         return EndpointType.EVENT;

http://git-wip-us.apache.org/repos/asf/camel/blob/2fb8652a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java
----------------------------------------------------------------------
diff --git a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java
index 5db48dd..7fec7b6 100644
--- a/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java
+++ b/components/camel-twitter/src/main/java/org/apache/camel/component/twitter/TwitterEndpointPolling.java
@@ -59,6 +59,10 @@ public class TwitterEndpointPolling extends DefaultPollingEndpoint implements Tw
         return properties;
     }
 
+    public void setProperties(TwitterConfiguration properties) {
+        this.properties = properties;
+    }
+
     @Override
     public EndpointType getEndpointType() {
         return EndpointType.POLLING;


[3/3] git commit: CAMEL-7182: Do not throw checked exception in camel-guice as not allowed for pre/post constructs.

Posted by da...@apache.org.
CAMEL-7182: Do not throw checked exception in camel-guice as not allowed for pre/post constructs.


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

Branch: refs/heads/camel-2.12.x
Commit: bbd3d8d4f098d56e50881f9a340b1be61c8e0911
Parents: 2fb8652
Author: Claus Ibsen <da...@apache.org>
Authored: Sat Feb 8 09:05:45 2014 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sat Feb 8 09:07:38 2014 +0100

----------------------------------------------------------------------
 .../apache/camel/guice/GuiceCamelContext.java   | 28 ++++++++++++++------
 1 file changed, 20 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/bbd3d8d4/components/camel-guice/src/main/java/org/apache/camel/guice/GuiceCamelContext.java
----------------------------------------------------------------------
diff --git a/components/camel-guice/src/main/java/org/apache/camel/guice/GuiceCamelContext.java b/components/camel-guice/src/main/java/org/apache/camel/guice/GuiceCamelContext.java
index bb2bf59..7059f0f 100644
--- a/components/camel-guice/src/main/java/org/apache/camel/guice/GuiceCamelContext.java
+++ b/components/camel-guice/src/main/java/org/apache/camel/guice/GuiceCamelContext.java
@@ -29,7 +29,6 @@ import com.google.inject.Inject;
 
 import org.apache.camel.ErrorHandlerFactory;
 import org.apache.camel.RoutesBuilder;
-import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.TypeConverter;
 import org.apache.camel.guice.impl.GuiceInjector;
 import org.apache.camel.guice.inject.Injectors;
@@ -41,6 +40,7 @@ import org.apache.camel.spi.InterceptStrategy;
 import org.apache.camel.spi.LanguageResolver;
 import org.apache.camel.spi.LifecycleStrategy;
 import org.apache.camel.spi.Registry;
+import org.apache.camel.util.ObjectHelper;
 
 /**
  * The default CamelContext implementation for working with Guice.
@@ -60,20 +60,32 @@ public class GuiceCamelContext extends DefaultCamelContext {
 
     @PostConstruct
     @Override
-    public void start() throws Exception {
-        super.start();
+    public void start() {
+        try {
+            super.start();
+        } catch (Exception e) {
+            throw ObjectHelper.wrapRuntimeCamelException(e);
+        }
     }
 
     @PreDestroy
     @Override
-    public void stop() throws Exception {
-        super.stop();
+    public void stop() {
+        try {
+            super.stop();
+        } catch (Exception e) {
+            throw ObjectHelper.wrapRuntimeCamelException(e);
+        }
     }
 
     @Inject
-    public void setRouteBuilders(Set<RoutesBuilder> routeBuilders) throws Exception {
+    public void setRouteBuilders(Set<RoutesBuilder> routeBuilders) {
         for (RoutesBuilder builder : routeBuilders) {
-            addRoutes(builder);
+            try {
+                addRoutes(builder);
+            } catch (Exception e) {
+                throw ObjectHelper.wrapRuntimeCamelException(e);
+            }
         }
     }
 
@@ -157,7 +169,7 @@ public class GuiceCamelContext extends DefaultCamelContext {
                 return injector.getInstance(Context.class);
             }
         } catch (Exception e) {
-            throw new RuntimeCamelException(e);
+            throw ObjectHelper.wrapRuntimeCamelException(e);
         }
     }