camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r775486 - /camel/trunk/camel-core/src/main/java/org/apache/camel/
Date Sat, 16 May 2009 15:23:51 GMT
Author: davsclaus
Date: Sat May 16 15:23:49 2009
New Revision: 775486

URL: http://svn.apache.org/viewvc?rev=775486&view=rev
Log:
CAMEL-1615: Marked fields as transient for objects not being serializable in Camel exceptions.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/CamelExchangeException.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/ExpectedBodyTypeException.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/ExpressionEvaluationException.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToCreateConsumerException.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToCreateProducerException.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/InvalidPayloadException.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/InvalidPayloadRuntimeException.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/NoSuchEndpointException.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/NoSuchHeaderException.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/NoSuchPropertyException.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/NoTypeConversionAvailableException.java
    camel/trunk/camel-core/src/main/java/org/apache/camel/RuntimeExchangeException.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/CamelExchangeException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/CamelExchangeException.java?rev=775486&r1=775485&r2=775486&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/CamelExchangeException.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/CamelExchangeException.java Sat
May 16 15:23:49 2009
@@ -23,7 +23,8 @@
  */
 public class CamelExchangeException extends CamelException {
     private static final long serialVersionUID = -8721487431101572630L;
-    private final Exchange exchange;
+    // exchange is not guaranted to be serializable so we set it as transient
+    private final transient Exchange exchange;
 
     public CamelExchangeException(String message, Exchange exchange) {
         super(createMessage(message, exchange));

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/ExpectedBodyTypeException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/ExpectedBodyTypeException.java?rev=775486&r1=775485&r2=775486&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/ExpectedBodyTypeException.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/ExpectedBodyTypeException.java Sat
May 16 15:23:49 2009
@@ -22,8 +22,8 @@
  * @version $Revision$
  */
 public class ExpectedBodyTypeException extends RuntimeCamelException {
-    private final Exchange exchange;
-    private final Class expectedBodyType;
+    private final transient Exchange exchange;
+    private final transient Class expectedBodyType;
 
     public ExpectedBodyTypeException(Exchange exchange, Class expectedBodyType) {
         super("Could not extract IN message body as type: " + expectedBodyType + " body is:
"

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/ExpressionEvaluationException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/ExpressionEvaluationException.java?rev=775486&r1=775485&r2=775486&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/ExpressionEvaluationException.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/ExpressionEvaluationException.java
Sat May 16 15:23:49 2009
@@ -25,8 +25,8 @@
 
     private static final long serialVersionUID = 2939802714638174540L;
     
-    private final Expression expression;
-    private final Exchange exchange;
+    private final transient Expression expression;
+    private final transient Exchange exchange;
 
     public ExpressionEvaluationException(Expression expression, Exchange exchange, Throwable
cause) {
         super(cause);

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToCreateConsumerException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToCreateConsumerException.java?rev=775486&r1=775485&r2=775486&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToCreateConsumerException.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToCreateConsumerException.java
Sat May 16 15:23:49 2009
@@ -22,14 +22,14 @@
  * @version $Revision$
  */
 public class FailedToCreateConsumerException extends RuntimeCamelException {
-    private final Endpoint endpoint;
+    private final String uri;
 
     public FailedToCreateConsumerException(Endpoint endpoint, Throwable cause) {
         super("Failed to create Consumer for endpoint: " + endpoint + ". Reason: " + cause,
cause);
-        this.endpoint = endpoint;
+        this.uri = endpoint.getEndpointUri();
     }
 
-    public Endpoint getEndpoint() {
-        return endpoint;
+    public String getUri() {
+        return uri;
     }
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToCreateProducerException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToCreateProducerException.java?rev=775486&r1=775485&r2=775486&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToCreateProducerException.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/FailedToCreateProducerException.java
Sat May 16 15:23:49 2009
@@ -22,14 +22,14 @@
  * @version $Revision$
  */
 public class FailedToCreateProducerException extends RuntimeCamelException {
-    private final Endpoint endpoint;
+    private final String uri;
 
     public FailedToCreateProducerException(Endpoint endpoint, Throwable cause) {
         super("Failed to create Producer for endpoint: " + endpoint + ". Reason: " + cause,
cause);
-        this.endpoint = endpoint;
+        this.uri = endpoint.getEndpointUri();
     }
 
-    public Endpoint getEndpoint() {
-        return endpoint;
+    public String getUri() {
+        return uri;
     }
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/InvalidPayloadException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/InvalidPayloadException.java?rev=775486&r1=775485&r2=775486&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/InvalidPayloadException.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/InvalidPayloadException.java Sat
May 16 15:23:49 2009
@@ -22,7 +22,7 @@
  * @version $Revision$
  */
 public class InvalidPayloadException extends CamelExchangeException {
-    private final Class<?> type;
+    private final transient Class<?> type;
 
     public InvalidPayloadException(Exchange exchange, Class<?> type) {
         this(exchange, type, exchange.getIn());

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/InvalidPayloadRuntimeException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/InvalidPayloadRuntimeException.java?rev=775486&r1=775485&r2=775486&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/InvalidPayloadRuntimeException.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/InvalidPayloadRuntimeException.java
Sat May 16 15:23:49 2009
@@ -22,7 +22,7 @@
  * @version $Revision$
  */
 public class InvalidPayloadRuntimeException extends RuntimeExchangeException {
-    private final Class<?> type;
+    private final transient Class<?> type;
 
     public InvalidPayloadRuntimeException(Exchange exchange, Class<?> type) {
         this(exchange, type, exchange.getIn());

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/NoSuchEndpointException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/NoSuchEndpointException.java?rev=775486&r1=775485&r2=775486&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/NoSuchEndpointException.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/NoSuchEndpointException.java Sat
May 16 15:23:49 2009
@@ -31,7 +31,6 @@
     public NoSuchEndpointException(String uri) {
         super("No endpoint could be found for: " + uri
               + ", please check your classpath contains the needed camel component jar.");
-
         this.uri = uri;
     }
 

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/NoSuchHeaderException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/NoSuchHeaderException.java?rev=775486&r1=775485&r2=775486&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/NoSuchHeaderException.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/NoSuchHeaderException.java Sat May
16 15:23:49 2009
@@ -27,7 +27,7 @@
 public class NoSuchHeaderException extends CamelExchangeException {
     private static final long serialVersionUID = -8721487431101572630L;
     private final String headerName;
-    private final Class<?> type;
+    private final transient Class<?> type;
 
     public NoSuchHeaderException(Exchange exchange, String headerName, Class<?> type)
{
         super("No '" + headerName + "' header available of type: " + type.getName()
@@ -53,6 +53,6 @@
         if (value == null) {
             return "";
         }
-        return " but has value: " + value + " of type: " + value.getClass().getName();
+        return " but has value: " + value + " of type: " + value.getClass().getCanonicalName();
     }
 }
\ No newline at end of file

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/NoSuchPropertyException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/NoSuchPropertyException.java?rev=775486&r1=775485&r2=775486&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/NoSuchPropertyException.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/NoSuchPropertyException.java Sat
May 16 15:23:49 2009
@@ -27,7 +27,7 @@
 public class NoSuchPropertyException extends CamelExchangeException {
     private static final long serialVersionUID = -8721487431101572630L;
     private final String propertyName;
-    private final Class<?> type;
+    private final transient Class<?> type;
 
     public NoSuchPropertyException(Exchange exchange, String propertyName, Class<?>
type) {
         super("No '" + propertyName + "' property available of type: " + type.getName()
@@ -53,6 +53,6 @@
         if (value == null) {
             return "";
         }
-        return " but has value: " + value + " of type: " + value.getClass().getName();
+        return " but has value: " + value + " of type: " + value.getClass().getCanonicalName();
     }
 }

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/NoTypeConversionAvailableException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/NoTypeConversionAvailableException.java?rev=775486&r1=775485&r2=775486&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/NoTypeConversionAvailableException.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/NoTypeConversionAvailableException.java
Sat May 16 15:23:49 2009
@@ -22,8 +22,8 @@
  * @version $Revision$
  */
 public class NoTypeConversionAvailableException extends CamelException {
-    private final Object value;
-    private final Class type;
+    private final transient Object value;
+    private final transient Class type;
 
     public NoTypeConversionAvailableException(Object value, Class type) {
         super(createMessage(value, type));

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/RuntimeExchangeException.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/RuntimeExchangeException.java?rev=775486&r1=775485&r2=775486&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/RuntimeExchangeException.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/RuntimeExchangeException.java Sat
May 16 15:23:49 2009
@@ -23,7 +23,7 @@
  */
 public class RuntimeExchangeException extends RuntimeCamelException {
     private static final long serialVersionUID = -8721487431101572630L;
-    private final Exchange exchange;
+    private transient final Exchange exchange;
 
     public RuntimeExchangeException(String message, Exchange exchange) {
         super(createMessage(message, exchange));



Mime
View raw message