camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r752465 - in /camel/trunk/camel-core/src/main/java/org/apache/camel: ./ component/bean/ component/file/ impl/ processor/ processor/aggregate/
Date Wed, 11 Mar 2009 15:18:39 GMT
Author: davsclaus
Date: Wed Mar 11 15:18:36 2009
New Revision: 752465

URL: http://svn.apache.org/viewvc?rev=752465&view=rev
Log:
Exchange.getException is Exception now instead of Throwable

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/Exchange.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInvocation.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConverter.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DeadLetterChannel.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/HandleFaultProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/TryProcessor.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/UseLatestAggregationStrategy.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/Exchange.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/Exchange.java?rev=752465&r1=752464&r2=752465&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/Exchange.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/Exchange.java Wed Mar 11 15:18:36
2009
@@ -192,14 +192,14 @@
      *
      * @return the exception (or null if no faults)
      */
-    Throwable getException();
+    Exception getException();
 
     /**
      * Sets the exception associated with this exchange
      *
      * @param e  the caused exception
      */
-    void setException(Throwable e);
+    void setException(Exception e);
 
     /**
      * Returns true if this exchange failed due to either an exception or fault

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInvocation.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInvocation.java?rev=752465&r1=752464&r2=752465&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInvocation.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/bean/BeanInvocation.java
Wed Mar 11 15:18:36 2009
@@ -80,7 +80,7 @@
             Object response = getMethod().invoke(pojo, getArgs());
             exchange.getOut().setBody(response);
         } catch (InvocationTargetException e) {
-            exchange.setException(e.getCause());
+            exchange.setException(ObjectHelper.wrapRuntimeCamelException(e.getCause()));
         } catch (Exception e) {
             throw ObjectHelper.wrapRuntimeCamelException(e);
         }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConverter.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConverter.java?rev=752465&r1=752464&r2=752465&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConverter.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConverter.java
Wed Mar 11 15:18:36 2009
@@ -33,6 +33,7 @@
     }
 
     @FallbackConverter
+    @SuppressWarnings("unchecked")
     public static Object convertTo(Class<?> type, Exchange exchange, Object value,
TypeConverterRegistry registry) {
         // use a fallback type converter so we can convert the embedded body if the value
is GenericFile
         if (GenericFile.class.isAssignableFrom(value.getClass())) {

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java?rev=752465&r1=752464&r2=752465&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java Wed Mar
11 15:18:36 2009
@@ -44,7 +44,7 @@
     private Message in;
     private Message out;
     private Message fault;
-    private Throwable exception;
+    private Exception exception;
     private String exchangeId;
     private UnitOfWork unitOfWork;
     private ExchangePattern pattern;
@@ -224,11 +224,11 @@
         configureMessage(out);
     }
 
-    public Throwable getException() {
+    public Exception getException() {
         return exception;
     }
 
-    public void setException(Throwable exception) {
+    public void setException(Exception exception) {
         this.exception = exception;
     }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DeadLetterChannel.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DeadLetterChannel.java?rev=752465&r1=752464&r2=752465&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DeadLetterChannel.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/DeadLetterChannel.java
Wed Mar 11 15:18:36 2009
@@ -411,7 +411,7 @@
                 LOG.debug("This exchange is not handled so its marked as failed: " + exchange);
             }
             // exception not handled, put exception back in the exchange
-            exchange.setException(exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Throwable.class));
+            exchange.setException(exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class));
         } else {
             if (LOG.isDebugEnabled()) {
                 LOG.debug("This exchange is handled so its marked as not failed: " + exchange);

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/HandleFaultProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/HandleFaultProcessor.java?rev=752465&r1=752464&r2=752465&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/HandleFaultProcessor.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/HandleFaultProcessor.java
Wed Mar 11 15:18:36 2009
@@ -52,8 +52,8 @@
                         final Object faultBody = faultMessage.getBody();
                         if (faultBody != null) {
                             faultMessage.setBody(null); // Reset it since we are handling
it.
-                            if (faultBody instanceof Throwable) {
-                                exchange.setException((Throwable)faultBody);
+                            if (faultBody instanceof Exception) {
+                                exchange.setException((Exception)faultBody);
                             } else {
                                 if (exchange.getException() == null) {                  
             
                                     exchange.setException(new CamelException("Message contains
fault of type "
@@ -78,8 +78,8 @@
             final Object faultBody = faultMessage.getBody();
             if (faultBody != null) {
                 faultMessage.setBody(null); // Reset it since we are handling it.
-                if (faultBody instanceof Throwable) {
-                    exchange.setException((Throwable)faultBody);
+                if (faultBody instanceof Exception) {
+                    exchange.setException((Exception)faultBody);
                 } else {
                     if (exchange.getException() == null) {
                         exchange.setException(new CamelException("Message contains fault
of type "

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/TryProcessor.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/TryProcessor.java?rev=752465&r1=752464&r2=752465&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/TryProcessor.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/TryProcessor.java Wed
Mar 11 15:18:36 2009
@@ -50,7 +50,7 @@
     }
 
     public void process(Exchange exchange) throws Exception {
-        Throwable e;
+        Exception e;
 
         // try processor first
         try {
@@ -110,7 +110,7 @@
 
     protected void processFinally(Exchange exchange) throws Exception {
         if (finallyProcessor != null) {
-            Throwable lastException = exchange.getException();
+            Exception lastException = exchange.getException();
             exchange.setException(null);
 
             // do not catch any exception here, let it propagate up

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/UseLatestAggregationStrategy.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/UseLatestAggregationStrategy.java?rev=752465&r1=752464&r2=752465&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/UseLatestAggregationStrategy.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/processor/aggregate/UseLatestAggregationStrategy.java
Wed Mar 11 15:18:36 2009
@@ -32,7 +32,7 @@
         return newExchange;
     }
     
-    protected Throwable checkException(Exchange oldExchange, Exchange newExchange) {
+    protected Exception checkException(Exchange oldExchange, Exchange newExchange) {
         return newExchange.getException() != null
                 ? newExchange.getException()
                 : oldExchange.getException();



Mime
View raw message