You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ch...@apache.org on 2007/08/07 23:33:12 UTC

svn commit: r563665 [5/11] - in /activemq/camel/trunk: camel-core/src/main/java/org/apache/camel/converter/jaxp/ camel-core/src/test/java/org/apache/camel/processor/ components/camel-activemq/src/main/java/org/apache/camel/component/activemq/ component...

Modified: activemq/camel/trunk/components/camel-jing/src/test/java/org/apache/camel/component/validator/jing/RNCRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jing/src/test/java/org/apache/camel/component/validator/jing/RNCRouteTest.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jing/src/test/java/org/apache/camel/component/validator/jing/RNCRouteTest.java (original)
+++ activemq/camel/trunk/components/camel-jing/src/test/java/org/apache/camel/component/validator/jing/RNCRouteTest.java Tue Aug  7 14:33:00 2007
@@ -1,5 +1,4 @@
 /**
- *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,

Modified: activemq/camel/trunk/components/camel-jing/src/test/java/org/apache/camel/component/validator/jing/RNGRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jing/src/test/java/org/apache/camel/component/validator/jing/RNGRouteTest.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jing/src/test/java/org/apache/camel/component/validator/jing/RNGRouteTest.java (original)
+++ activemq/camel/trunk/components/camel-jing/src/test/java/org/apache/camel/component/validator/jing/RNGRouteTest.java Tue Aug  7 14:33:00 2007
@@ -1,5 +1,4 @@
 /**
- *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/ConsumerType.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/ConsumerType.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/ConsumerType.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/ConsumerType.java Tue Aug  7 14:33:00 2007
@@ -1,4 +1,4 @@
-/*
+/**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java Tue Aug  7 14:33:00 2007
@@ -1,5 +1,4 @@
 /**
- *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -28,12 +27,13 @@
 import org.apache.commons.logging.LogFactory;
 
 /**
- * A JMS {@link MessageListener} which can be used to delegate processing to a Camel endpoint.
- *
+ * A JMS {@link MessageListener} which can be used to delegate processing to a
+ * Camel endpoint.
+ * 
  * @version $Revision$
  */
 public class EndpointMessageListener<E extends Exchange> implements MessageListener {
-    private static final transient Log log = LogFactory.getLog(EndpointMessageListener.class);
+    private static final transient Log LOG = LogFactory.getLog(EndpointMessageListener.class);
     private Endpoint<E> endpoint;
     private Processor processor;
     private JmsBinding binding;
@@ -45,16 +45,16 @@
 
     public void onMessage(Message message) {
         try {
-			
-        	if (log.isDebugEnabled()) {
-			    log.debug(endpoint + " receiving JMS message: " + message);
-			}
-			JmsExchange exchange = createExchange(message);
-			processor.process((E) exchange);
-			
-		} catch (Exception e) {
-			throw new RuntimeCamelException(e);
-		}
+
+            if (LOG.isDebugEnabled()) {
+                LOG.debug(endpoint + " receiving JMS message: " + message);
+            }
+            JmsExchange exchange = createExchange(message);
+            processor.process((E)exchange);
+
+        } catch (Exception e) {
+            throw new RuntimeCamelException(e);
+        }
     }
 
     public JmsExchange createExchange(Message message) {
@@ -62,7 +62,7 @@
     }
 
     // Properties
-    //-------------------------------------------------------------------------
+    // -------------------------------------------------------------------------
     public JmsBinding getBinding() {
         if (binding == null) {
             binding = new JmsBinding();
@@ -71,8 +71,9 @@
     }
 
     /**
-     * Sets the binding used to convert from a Camel message to and from a JMS message
-     *
+     * Sets the binding used to convert from a Camel message to and from a JMS
+     * message
+     * 
      * @param binding the binding to use
      */
     public void setBinding(JmsBinding binding) {

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java Tue Aug  7 14:33:00 2007
@@ -1,5 +1,4 @@
 /**
- *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,7 +16,11 @@
  */
 package org.apache.camel.component.jms;
 
-import org.apache.camel.Exchange;
+import java.io.Serializable;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
 
 import javax.jms.BytesMessage;
 import javax.jms.JMSException;
@@ -27,54 +30,46 @@
 import javax.jms.Session;
 import javax.jms.StreamMessage;
 import javax.jms.TextMessage;
-import java.io.Serializable;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
+
+import org.apache.camel.Exchange;
 
 /**
- * A Strategy used to convert between a Camel {@JmsExchange} and {@JmsMessage} to and from a
- * JMS {@link Message}
- *
+ * A Strategy used to convert between a Camel {@JmsExchange} and {@JmsMessage}
+ * to and from a JMS {@link Message}
+ * 
  * @version $Revision$
  */
 public class JmsBinding {
     /**
      * Extracts the body from the JMS message
-     *
+     * 
      * @param exchange
      * @param message
      */
     public Object extractBodyFromJms(JmsExchange exchange, Message message) {
         try {
             if (message instanceof ObjectMessage) {
-                ObjectMessage objectMessage = (ObjectMessage) message;
+                ObjectMessage objectMessage = (ObjectMessage)message;
                 return objectMessage.getObject();
-            }
-            else if (message instanceof TextMessage) {
-                TextMessage textMessage = (TextMessage) message;
+            } else if (message instanceof TextMessage) {
+                TextMessage textMessage = (TextMessage)message;
                 return textMessage.getText();
-            }
-            else if (message instanceof MapMessage) {
-                return createMapFromMapMessage((MapMessage) message);
-            }
-            else if (message instanceof BytesMessage || message instanceof StreamMessage) {
+            } else if (message instanceof MapMessage) {
+                return createMapFromMapMessage((MapMessage)message);
+            } else if (message instanceof BytesMessage || message instanceof StreamMessage) {
                 // TODO we need a decoder to be able to process the message
                 return message;
-            }
-            else {
+            } else {
                 return null;
             }
-        }
-        catch (JMSException e) {
+        } catch (JMSException e) {
             throw new RuntimeJmsException("Failed to extract body due to: " + e + ". Message: " + message, e);
         }
     }
 
     /**
      * Creates a JMS message from the Camel exchange and message
-     *
+     * 
      * @param session the JMS session used to create the message
      * @return a newly created JMS Message instance containing the
      * @throws JMSException if the message could not be created
@@ -102,12 +97,10 @@
 
     protected Message createJmsMessage(Object body, Session session) throws JMSException {
         if (body instanceof String) {
-            return session.createTextMessage((String) body);
-        }
-        else if (body instanceof Serializable) {
-            return session.createObjectMessage((Serializable) body);
-        }
-        else {
+            return session.createTextMessage((String)body);
+        } else if (body instanceof Serializable) {
+            return session.createObjectMessage((Serializable)body);
+        } else {
             return session.createMessage();
         }
     }

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsComponent.java Tue Aug  7 14:33:00 2007
@@ -1,5 +1,4 @@
 /**
- *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,24 +16,27 @@
  */
 package org.apache.camel.component.jms;
 
+import java.util.Map;
+
+import javax.jms.ConnectionFactory;
+import javax.jms.ExceptionListener;
+import javax.jms.Session;
+
 import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
 import org.apache.camel.impl.DefaultComponent;
 import org.apache.camel.util.IntrospectionSupport;
-import static org.apache.camel.util.ObjectHelper.removeStartingCharacters;
+
 import org.springframework.core.task.TaskExecutor;
 import org.springframework.jms.listener.serversession.ServerSessionFactory;
 import org.springframework.jms.support.converter.MessageConverter;
 import org.springframework.transaction.PlatformTransactionManager;
 
-import javax.jms.ConnectionFactory;
-import javax.jms.ExceptionListener;
-import javax.jms.Session;
-import java.util.Map;
+import static org.apache.camel.util.ObjectHelper.removeStartingCharacters;
 
 /**
  * A <a href="http://activemq.apache.org/jms.html">JMS Component</a>
- *
+ * 
  * @version $Revision:520964 $
  */
 public class JmsComponent extends DefaultComponent<JmsExchange> {
@@ -43,6 +45,17 @@
 
     private JmsConfiguration configuration;
 
+    public JmsComponent() {
+    }
+
+    public JmsComponent(JmsConfiguration configuration) {
+        this.configuration = configuration;
+    }
+
+    public JmsComponent(CamelContext context) {
+        super(context);
+    }
+    
     /**
      * Static builder method
      */
@@ -72,7 +85,7 @@
         template.setAcknowledgementMode(Session.CLIENT_ACKNOWLEDGE);
         return jmsComponent(template);
     }
-    
+
     /**
      * Static builder method
      */
@@ -88,22 +101,11 @@
         return jmsComponent(template);
     }
 
-	public static JmsComponent jmsComponentTransacted(ConnectionFactory connectionFactory, PlatformTransactionManager transactionManager) {
+    public static JmsComponent jmsComponentTransacted(ConnectionFactory connectionFactory, PlatformTransactionManager transactionManager) {
         JmsConfiguration template = new JmsConfiguration(connectionFactory);
         template.setTransactionManager(transactionManager);
         template.setTransacted(true);
         return jmsComponent(template);
-	}
-
-    public JmsComponent() {
-    }
-
-    public JmsComponent(JmsConfiguration configuration) {
-        this.configuration = configuration;
-    }
-
-    public JmsComponent(CamelContext context) {
-        super(context);
     }
 
     @Override
@@ -113,18 +115,18 @@
         if (remaining.startsWith(QUEUE_PREFIX)) {
             pubSubDomain = false;
             remaining = removeStartingCharacters(remaining.substring(QUEUE_PREFIX.length()), '/');
-        }
-        else if (remaining.startsWith(TOPIC_PREFIX)) {
+        } else if (remaining.startsWith(TOPIC_PREFIX)) {
             pubSubDomain = true;
             remaining = removeStartingCharacters(remaining.substring(TOPIC_PREFIX.length()), '/');
         }
 
         final String subject = convertPathToActualDestination(remaining);
 
-        // lets make sure we copy the configuration as each endpoint can customize its own version
+        // lets make sure we copy the configuration as each endpoint can
+        // customize its own version
         JmsEndpoint endpoint = new JmsEndpoint(uri, this, subject, pubSubDomain, getConfiguration().copy());
 
-        String selector = (String) parameters.remove("selector");
+        String selector = (String)parameters.remove("selector");
         if (selector != null) {
             endpoint.setSelector(selector);
         }
@@ -141,14 +143,13 @@
 
     /**
      * Sets the JMS configuration
-     *
+     * 
      * @param configuration the configuration to use by default for endpoints
      */
     public void setConfiguration(JmsConfiguration configuration) {
         this.configuration = configuration;
     }
 
-
     public void setAcceptMessagesWhileStopping(boolean acceptMessagesWhileStopping) {
         getConfiguration().setAcceptMessagesWhileStopping(acceptMessagesWhileStopping);
     }
@@ -286,8 +287,8 @@
     }
 
     /**
-     * A strategy method allowing the URI destination to be translated into the actual JMS destination name
-     * (say by looking up in JNDI or something)
+     * A strategy method allowing the URI destination to be translated into the
+     * actual JMS destination name (say by looking up in JNDI or something)
      */
     protected String convertPathToActualDestination(String path) {
         return path;
@@ -295,8 +296,9 @@
 
     /**
      * Factory method to create the default configuration instance
-     *
-     * @return a newly created configuration object which can then be further customized
+     * 
+     * @return a newly created configuration object which can then be further
+     *         customized
      */
     protected JmsConfiguration createConfiguration() {
         return new JmsConfiguration();

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConfiguration.java Tue Aug  7 14:33:00 2007
@@ -1,5 +1,4 @@
 /**
- *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,8 +16,12 @@
  */
 package org.apache.camel.component.jms;
 
+import javax.jms.ConnectionFactory;
+import javax.jms.ExceptionListener;
+
 import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.util.ObjectHelper;
+
 import org.springframework.core.task.TaskExecutor;
 import org.springframework.jms.core.JmsOperations;
 import org.springframework.jms.core.JmsTemplate;
@@ -34,9 +37,6 @@
 import org.springframework.jms.support.converter.MessageConverter;
 import org.springframework.transaction.PlatformTransactionManager;
 
-import javax.jms.ConnectionFactory;
-import javax.jms.ExceptionListener;
-
 /**
  * @version $Revision$
  */
@@ -72,8 +72,8 @@
     private int idleTaskExecutionLimit = 1;
     private int maxConcurrentConsumers = 1;
     // JmsTemplate only
-    private boolean useVersion102 = false;
-    private boolean explicitQosEnabled = false;
+    private boolean useVersion102;
+    private boolean explicitQosEnabled;
     private boolean deliveryPersistent = true;
     private long timeToLive = -1;
     private MessageConverter messageConverter;
@@ -98,18 +98,15 @@
      */
     public JmsConfiguration copy() {
         try {
-            return (JmsConfiguration) clone();
-        }
-        catch (CloneNotSupportedException e) {
+            return (JmsConfiguration)clone();
+        } catch (CloneNotSupportedException e) {
             throw new RuntimeCamelException(e);
         }
     }
 
     public JmsOperations createJmsOperations(boolean pubSubDomain, String destination) {
         ConnectionFactory factory = getTemplateConnectionFactory();
-        JmsTemplate template = useVersion102
-                ? new JmsTemplate102(factory, pubSubDomain)
-                : new JmsTemplate(factory);
+        JmsTemplate template = useVersion102 ? new JmsTemplate102(factory, pubSubDomain) : new JmsTemplate(factory);
         template.setPubSubDomain(pubSubDomain);
         template.setDefaultDestinationName(destination);
 
@@ -133,11 +130,11 @@
 
         template.setSessionTransacted(transacted);
 
-        // This is here for completeness, but the template should not get used for receiving messages.
+        // This is here for completeness, but the template should not get used
+        // for receiving messages.
         if (acknowledgementMode >= 0) {
             template.setSessionAcknowledgeMode(acknowledgementMode);
-        }
-        else if (acknowledgementModeName != null) {
+        } else if (acknowledgementModeName != null) {
             template.setSessionAcknowledgeModeName(acknowledgementModeName);
         }
         return template;
@@ -162,7 +159,8 @@
             container.setDurableSubscriptionName(durableSubscriptionName);
         }
 
-        // lets default to durable subscription if the subscriber name and client ID are specified (as there's
+        // lets default to durable subscription if the subscriber name and
+        // client ID are specified (as there's
         // no reason to specify them if not! :)
         if (durableSubscriptionName != null && clientId != null) {
             container.setSubscriptionDurable(true);
@@ -178,26 +176,24 @@
 
         if (acknowledgementMode >= 0) {
             container.setSessionAcknowledgeMode(acknowledgementMode);
-        }
-        else if (acknowledgementModeName != null) {
+        } else if (acknowledgementModeName != null) {
             container.setSessionAcknowledgeModeName(acknowledgementModeName);
         }
 
         if (container instanceof DefaultMessageListenerContainer) {
             // this includes DefaultMessageListenerContainer102
-            DefaultMessageListenerContainer listenerContainer = (DefaultMessageListenerContainer) container;
+            DefaultMessageListenerContainer listenerContainer = (DefaultMessageListenerContainer)container;
             if (concurrentConsumers >= 0) {
                 listenerContainer.setConcurrentConsumers(concurrentConsumers);
             }
 
             if (cacheLevel >= 0) {
                 listenerContainer.setCacheLevel(cacheLevel);
-            }
-            else if (cacheLevelName != null) {
+            } else if (cacheLevelName != null) {
                 listenerContainer.setCacheLevelName(cacheLevelName);
-            }
-            else {
-                // Default to CACHE_CONSUMER unless specified.  This works best with most JMS providers.
+            } else {
+                // Default to CACHE_CONSUMER unless specified. This works best
+                // with most JMS providers.
                 listenerContainer.setCacheLevel(DefaultMessageListenerContainer.CACHE_CONSUMER);
             }
 
@@ -229,20 +225,18 @@
             if (transactionTimeout >= 0) {
                 listenerContainer.setTransactionTimeout(transactionTimeout);
             }
-        }
-        else if (container instanceof ServerSessionMessageListenerContainer) {
+        } else if (container instanceof ServerSessionMessageListenerContainer) {
             // this includes ServerSessionMessageListenerContainer102
-            ServerSessionMessageListenerContainer listenerContainer = (ServerSessionMessageListenerContainer) container;
+            ServerSessionMessageListenerContainer listenerContainer = (ServerSessionMessageListenerContainer)container;
             if (maxMessagesPerTask >= 0) {
                 listenerContainer.setMaxMessagesPerTask(maxMessagesPerTask);
             }
             if (serverSessionFactory != null) {
                 listenerContainer.setServerSessionFactory(serverSessionFactory);
             }
-        }
-        else if (container instanceof SimpleMessageListenerContainer) {
+        } else if (container instanceof SimpleMessageListenerContainer) {
             // this includes SimpleMessageListenerContainer102
-            SimpleMessageListenerContainer listenerContainer = (SimpleMessageListenerContainer) container;
+            SimpleMessageListenerContainer listenerContainer = (SimpleMessageListenerContainer)container;
             if (concurrentConsumers >= 0) {
                 listenerContainer.setConcurrentConsumers(concurrentConsumers);
             }
@@ -254,7 +248,7 @@
     }
 
     // Properties
-    //-------------------------------------------------------------------------
+    // -------------------------------------------------------------------------
     public ConnectionFactory getConnectionFactory() {
         if (connectionFactory == null) {
             connectionFactory = createConnectionFactory();
@@ -263,10 +257,11 @@
     }
 
     /**
-     * Sets the default connection factory to be used if a connection factory is not specified
-     * for either {@link #setTemplateConnectionFactory(ConnectionFactory)} or
+     * Sets the default connection factory to be used if a connection factory is
+     * not specified for either
+     * {@link #setTemplateConnectionFactory(ConnectionFactory)} or
      * {@link #setListenerConnectionFactory(ConnectionFactory)}
-     *
+     * 
      * @param connectionFactory the default connection factory to use
      */
     public void setConnectionFactory(ConnectionFactory connectionFactory) {
@@ -281,9 +276,11 @@
     }
 
     /**
-     * Sets the connection factory to be used for consuming messages via the {@link #createMessageListenerContainer()}
-     *
-     * @param listenerConnectionFactory the connection factory to use for consuming messages
+     * Sets the connection factory to be used for consuming messages via the
+     * {@link #createMessageListenerContainer()}
+     * 
+     * @param listenerConnectionFactory the connection factory to use for
+     *                consuming messages
      */
     public void setListenerConnectionFactory(ConnectionFactory listenerConnectionFactory) {
         this.listenerConnectionFactory = listenerConnectionFactory;
@@ -297,10 +294,11 @@
     }
 
     /**
-     * Sets the connection factory to be used for sending messages via the {@link JmsTemplate} via
-     * {@link #createJmsOperations(boolean, String)}
-     *
-     * @param templateConnectionFactory the connection factory for sending messages
+     * Sets the connection factory to be used for sending messages via the
+     * {@link JmsTemplate} via {@link #createJmsOperations(boolean, String)}
+     * 
+     * @param templateConnectionFactory the connection factory for sending
+     *                messages
      */
     public void setTemplateConnectionFactory(ConnectionFactory templateConnectionFactory) {
         this.templateConnectionFactory = templateConnectionFactory;
@@ -573,23 +571,24 @@
     }
 
     // Implementation methods
-    //-------------------------------------------------------------------------
+    // -------------------------------------------------------------------------
     protected AbstractMessageListenerContainer chooseMessageListenerContainerImplementation() {
         // TODO we could allow a spring container to auto-inject these objects?
         switch (consumerType) {
-            case Simple:
-                return isUseVersion102() ? new SimpleMessageListenerContainer102() : new SimpleMessageListenerContainer();
-            case ServerSessionPool:
-                return isUseVersion102() ? new ServerSessionMessageListenerContainer102() : new ServerSessionMessageListenerContainer();
-            case Default:
-                return isUseVersion102() ? new DefaultMessageListenerContainer102() : new DefaultMessageListenerContainer();
-            default:
-                throw new IllegalArgumentException("Unknown consumer type: " + consumerType);
+        case Simple:
+            return isUseVersion102() ? new SimpleMessageListenerContainer102() : new SimpleMessageListenerContainer();
+        case ServerSessionPool:
+            return isUseVersion102() ? new ServerSessionMessageListenerContainer102() : new ServerSessionMessageListenerContainer();
+        case Default:
+            return isUseVersion102() ? new DefaultMessageListenerContainer102() : new DefaultMessageListenerContainer();
+        default:
+            throw new IllegalArgumentException("Unknown consumer type: " + consumerType);
         }
     }
 
     /**
-     * Factory method which allows derived classes to customize the lazy creation
+     * Factory method which allows derived classes to customize the lazy
+     * creation
      */
     protected ConnectionFactory createConnectionFactory() {
         ObjectHelper.notNull(connectionFactory, "connectionFactory");
@@ -597,14 +596,16 @@
     }
 
     /**
-     * Factory method which allows derived classes to customize the lazy creation
+     * Factory method which allows derived classes to customize the lazy
+     * creation
      */
     protected ConnectionFactory createListenerConnectionFactory() {
         return getConnectionFactory();
     }
 
     /**
-     * Factory method which allows derived classes to customize the lazy creation
+     * Factory method which allows derived classes to customize the lazy
+     * creation
      */
     protected ConnectionFactory createTemplateConnectionFactory() {
         return getConnectionFactory();

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConsumer.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConsumer.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConsumer.java Tue Aug  7 14:33:00 2007
@@ -1,5 +1,4 @@
 /**
- *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,12 +16,12 @@
  */
 package org.apache.camel.component.jms;
 
-import org.apache.camel.Consumer;
+import javax.jms.MessageListener;
+
 import org.apache.camel.Processor;
 import org.apache.camel.impl.DefaultConsumer;
-import org.springframework.jms.listener.AbstractMessageListenerContainer;
 
-import javax.jms.MessageListener;
+import org.springframework.jms.listener.AbstractMessageListenerContainer;
 
 /**
  * A {@link Consumer} which uses Spring's {@link AbstractMessageListenerContainer} implementations to consume JMS messages

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java Tue Aug  7 14:33:00 2007
@@ -1,4 +1,4 @@
-/*
+/**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -18,17 +18,18 @@
 
 import javax.jms.Message;
 
-import org.apache.camel.Processor;
 import org.apache.camel.PollingConsumer;
+import org.apache.camel.Processor;
 import org.apache.camel.impl.DefaultEndpoint;
+
 import org.springframework.jms.core.JmsOperations;
 import org.springframework.jms.core.JmsTemplate;
 import org.springframework.jms.listener.AbstractMessageListenerContainer;
 
 /**
  * A <a href="http://activemq.apache.org/jms.html">JMS Endpoint</a>
- *
-  * @version $Revision:520964 $
+ * 
+ * @version $Revision:520964 $
  */
 public class JmsEndpoint extends DefaultEndpoint<JmsExchange> {
     private JmsBinding binding;
@@ -54,7 +55,7 @@
      */
     public JmsProducer createProducer(JmsOperations template) throws Exception {
         if (template instanceof JmsTemplate) {
-            JmsTemplate jmsTemplate = (JmsTemplate) template;
+            JmsTemplate jmsTemplate = (JmsTemplate)template;
             jmsTemplate.setPubSubDomain(pubSubDomain);
             jmsTemplate.setDefaultDestinationName(destination);
         }
@@ -68,7 +69,7 @@
 
     /**
      * Creates a consumer using the given processor and listener container
-     *
+     * 
      * @param processor the processor to use to process the messages
      * @param listenerContainer the listener container
      * @return a newly created consumer
@@ -98,7 +99,7 @@
     }
 
     // Properties
-    //-------------------------------------------------------------------------
+    // -------------------------------------------------------------------------
     public JmsBinding getBinding() {
         if (binding == null) {
             binding = new JmsBinding();
@@ -107,8 +108,9 @@
     }
 
     /**
-     * Sets the binding used to convert from a Camel message to and from a JMS message
-     *
+     * Sets the binding used to convert from a Camel message to and from a JMS
+     * message
+     * 
      * @param binding the binding to use
      */
     public void setBinding(JmsBinding binding) {
@@ -134,10 +136,9 @@
         this.selector = selector;
     }
 
-	public boolean isSingleton() {
-		return false;
-	}
-
+    public boolean isSingleton() {
+        return false;
+    }
 
     protected JmsOperations createJmsOperations() {
         return configuration.createJmsOperations(pubSubDomain, destination);

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsExchange.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsExchange.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsExchange.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsExchange.java Tue Aug  7 14:33:00 2007
@@ -1,4 +1,4 @@
-/*
+/**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -16,12 +16,11 @@
  */
 package org.apache.camel.component.jms;
 
+import javax.jms.Message;
+
 import org.apache.camel.CamelContext;
 import org.apache.camel.Exchange;
-import org.apache.camel.Endpoint;
 import org.apache.camel.impl.DefaultExchange;
-
-import javax.jms.Message;
 
 /**
  * Represents an {@ilnk Exchange} for working with JMS messages while exposing the inbound and outbound JMS {@link Message}

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsIOConverter.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsIOConverter.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsIOConverter.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsIOConverter.java Tue Aug  7 14:33:00 2007
@@ -1,5 +1,4 @@
 /**
- *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -22,6 +21,7 @@
 import java.io.ObjectOutputStream;
 import java.nio.ByteBuffer;
 import java.util.Enumeration;
+
 import javax.jms.BytesMessage;
 import javax.jms.MapMessage;
 import javax.jms.Message;
@@ -29,19 +29,23 @@
 import javax.jms.ObjectMessage;
 import javax.jms.StreamMessage;
 import javax.jms.TextMessage;
+
 import org.apache.camel.Converter;
 import org.apache.camel.converter.NIOConverter;
 
-
 /**
- * Some simple payload conversions to I/O 
- * <a href="http://activemq.apache.org/camel/type-converter.html">Type Converters</a>
- *
+ * Some simple payload conversions to I/O <a
+ * href="http://activemq.apache.org/camel/type-converter.html">Type Converters</a>
+ * 
  * @version $Revision: 533630 $
  */
 
 @Converter
-public class JmsIOConverter{
+public final class JmsIOConverter {
+    
+    private JmsIOConverter() {        
+    }
+    
     /**
      * @param message
      * @return a ByteBuffer
@@ -49,7 +53,7 @@
      */
     @Converter
     public static ByteBuffer toByteBuffer(final Message message) throws Exception {
-   
+
         if (message instanceof TextMessage) {
             final String text = ((TextMessage)message).getText();
             return NIOConverter.toByteBuffer(text);
@@ -58,9 +62,9 @@
             final BytesMessage bmsg = (BytesMessage)message;
             final int len = (int)bmsg.getBodyLength();
             final byte[] data = new byte[len];
-            bmsg.readBytes(data,len);
+            bmsg.readBytes(data, len);
             return NIOConverter.toByteBuffer(data);
-            
+
         }
         if (message instanceof StreamMessage) {
             final StreamMessage msg = (StreamMessage)message;
@@ -69,10 +73,10 @@
             try {
                 while (true) {
                     final Object obj = msg.readObject();
-                    writeData(dataOut,obj);
+                    writeData(dataOut, obj);
                 }
-            }catch(MessageEOFException e) {
-                //we have no other way of knowing the end of the message
+            } catch (MessageEOFException e) {
+                // we have no other way of knowing the end of the message
             }
             dataOut.close();
             return NIOConverter.toByteBuffer(bytesOut.toByteArray());
@@ -83,7 +87,7 @@
             final DataOutputStream dataOut = new DataOutputStream(bytesOut);
             for (final Enumeration en = msg.getMapNames(); en.hasMoreElements();) {
                 final Object obj = msg.getObject(en.nextElement().toString());
-                writeData(dataOut,obj);
+                writeData(dataOut, obj);
             }
             dataOut.close();
             return NIOConverter.toByteBuffer(bytesOut.toByteArray());
@@ -91,40 +95,39 @@
         if (message instanceof ObjectMessage) {
             ObjectMessage objMessage = (ObjectMessage)message;
             Object object = objMessage.getObject();
-            ByteArrayOutputStream bytesOut=new ByteArrayOutputStream();
-            ObjectOutputStream objectOut=new ObjectOutputStream(bytesOut);
+            ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
+            ObjectOutputStream objectOut = new ObjectOutputStream(bytesOut);
             objectOut.writeObject(object);
             objectOut.close();
             return NIOConverter.toByteBuffer(bytesOut.toByteArray());
         }
         return null;
-       
+
     }
+
     private static void writeData(DataOutputStream dataOut, Object data) throws Exception {
-        
-        
+
         if (data instanceof byte[]) {
             dataOut.write((byte[])data);
-        }else if (data instanceof String) {
+        } else if (data instanceof String) {
             dataOut.writeUTF(data.toString());
-        }
-        else if (data instanceof Double) {
+        } else if (data instanceof Double) {
             dataOut.writeDouble(((Double)data).doubleValue());
-        }else if (data instanceof Float) {
+        } else if (data instanceof Float) {
             dataOut.writeFloat(((Float)data).floatValue());
-        }else if (data instanceof Long) {
+        } else if (data instanceof Long) {
             dataOut.writeLong(((Long)data).longValue());
-        }else if (data instanceof Integer) {
+        } else if (data instanceof Integer) {
             dataOut.writeInt(((Integer)data).intValue());
-        }else if (data instanceof Short) {
+        } else if (data instanceof Short) {
             dataOut.writeShort(((Short)data).shortValue());
-        }else if (data instanceof Character) {
+        } else if (data instanceof Character) {
             dataOut.writeChar(((Character)data).charValue());
-        }else if (data instanceof Byte) {
+        } else if (data instanceof Byte) {
             dataOut.writeByte(((Byte)data).byteValue());
-        }else if (data instanceof Boolean) {
+        } else if (data instanceof Boolean) {
             dataOut.writeBoolean(((Boolean)data).booleanValue());
         }
-              
+
     }
 }

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsMessage.java Tue Aug  7 14:33:00 2007
@@ -1,5 +1,4 @@
 /**
- *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,27 +16,27 @@
  */
 package org.apache.camel.component.jms;
 
-import java.beans.DesignMode;
 import java.io.File;
 import java.util.Enumeration;
 import java.util.Map;
+
 import javax.jms.Destination;
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.Queue;
-import javax.jms.TemporaryTopic;
 import javax.jms.Topic;
+
 import org.apache.camel.impl.DefaultMessage;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 /**
  * Represents a {@link org.apache.camel.Message} for working with JMS
- *
+ * 
  * @version $Revision:520964 $
  */
 public class JmsMessage extends DefaultMessage {
-    private static final transient Log log = LogFactory.getLog(JmsMessage.class);
+    private static final transient Log LOG = LogFactory.getLog(JmsMessage.class);
     private Message jmsMessage;
 
     public JmsMessage() {
@@ -51,30 +50,28 @@
     public String toString() {
         if (jmsMessage != null) {
             return "JmsMessage: " + jmsMessage;
-        }
-        else {
+        } else {
             return "JmsMessage: " + getBody();
         }
     }
 
-       
     /**
      * Returns the underlying JMS message
-     *
+     * 
      * @return the underlying JMS message
      */
     public Message getJmsMessage() {
         return jmsMessage;
     }
 
-    public void setJmsMessage(Message jmsMessage){
-        this.jmsMessage=jmsMessage;
-        try{
-            String id=getDestinationAsString(jmsMessage.getJMSDestination());
-            id+=getSanitizedString(jmsMessage.getJMSMessageID());
+    public void setJmsMessage(Message jmsMessage) {
+        this.jmsMessage = jmsMessage;
+        try {
+            String id = getDestinationAsString(jmsMessage.getJMSDestination());
+            id += getSanitizedString(jmsMessage.getJMSMessageID());
             setMessageId(id);
-        }catch(JMSException e){
-            log.error("Failed to get message id from message "+jmsMessage,e);
+        } catch (JMSException e) {
+            LOG.error("Failed to get message id from message " + jmsMessage, e);
         }
     }
 
@@ -83,8 +80,7 @@
         if (jmsMessage != null) {
             try {
                 answer = jmsMessage.getObjectProperty(name);
-            }
-            catch (JMSException e) {
+            } catch (JMSException e) {
                 throw new MessagePropertyAccessException(name, e);
             }
         }
@@ -103,7 +99,7 @@
     protected Object createBody() {
         if (jmsMessage != null && getExchange() instanceof JmsExchange) {
             JmsExchange exchange = (JmsExchange)getExchange();
-            return (exchange.getBinding().extractBodyFromJms(exchange, jmsMessage));
+            return exchange.getBinding().extractBodyFromJms(exchange, jmsMessage);
         }
         return null;
     }
@@ -114,8 +110,7 @@
             Enumeration names;
             try {
                 names = jmsMessage.getPropertyNames();
-            }
-            catch (JMSException e) {
+            } catch (JMSException e) {
                 throw new MessagePropertyNamesAccessException(e);
             }
             while (names.hasMoreElements()) {
@@ -123,28 +118,27 @@
                 try {
                     Object value = jmsMessage.getObjectProperty(name);
                     map.put(name, value);
-                }
-                catch (JMSException e) {
+                } catch (JMSException e) {
                     throw new MessagePropertyAccessException(name, e);
                 }
             }
         }
     }
-    
+
     private String getDestinationAsString(Destination destination) throws JMSException {
         String result = "";
         if (destination == null) {
-        	result = "null destination!";
+            result = "null destination!";
         } else if (destination instanceof Topic) {
             result += "topic" + File.separator + getSanitizedString(((Topic)destination).getTopicName());
-        }else {
+        } else {
             result += "queue" + File.separator + getSanitizedString(((Queue)destination).getQueueName());
         }
         result += File.separator;
         return result;
     }
+
     private String getSanitizedString(Object value) {
         return value != null ? value.toString().replaceAll("[^a-zA-Z0-9\\.\\_\\-]", "_") : "";
     }
 }
-

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsPollingConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsPollingConsumer.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsPollingConsumer.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsPollingConsumer.java Tue Aug  7 14:33:00 2007
@@ -1,5 +1,4 @@
 /**
- *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,13 +16,14 @@
  */
 package org.apache.camel.component.jms;
 
+import javax.jms.Message;
+
 import org.apache.camel.impl.PollingConsumerSupport;
+
 import org.springframework.jms.core.JmsOperations;
 import org.springframework.jms.core.JmsTemplate;
 import org.springframework.jms.core.JmsTemplate102;
 
-import javax.jms.Message;
-
 /**
  * @version $Revision: 1.1 $
  */
@@ -37,7 +37,7 @@
 
     @Override
     public JmsEndpoint getEndpoint() {
-        return (JmsEndpoint) super.getEndpoint();
+        return (JmsEndpoint)super.getEndpoint();
     }
 
     public JmsExchange receiveNoWait() {
@@ -65,14 +65,12 @@
 
     protected void setReceiveTimeout(long timeout) {
         if (template instanceof JmsTemplate) {
-            JmsTemplate jmsTemplate = (JmsTemplate) template;
+            JmsTemplate jmsTemplate = (JmsTemplate)template;
             jmsTemplate.setReceiveTimeout(timeout);
-        }
-        else if (template instanceof JmsTemplate102) {
-            JmsTemplate102 jmsTemplate102 = (JmsTemplate102) template;
+        } else if (template instanceof JmsTemplate102) {
+            JmsTemplate102 jmsTemplate102 = (JmsTemplate102)template;
             jmsTemplate102.setReceiveTimeout(timeout);
-        }
-        else {
+        } else {
             throw new IllegalArgumentException("Cannot set the receiveTimeout property on unknown JmsOperations type: " + template);
         }
     }

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java Tue Aug  7 14:33:00 2007
@@ -1,5 +1,4 @@
 /**
- *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,22 +16,23 @@
  */
 package org.apache.camel.component.jms;
 
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.Session;
+
 import org.apache.camel.Exchange;
 import org.apache.camel.impl.DefaultProducer;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+
 import org.springframework.jms.core.JmsOperations;
 import org.springframework.jms.core.MessageCreator;
 
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.Session;
-
 /**
  * @version $Revision$
  */
 public class JmsProducer extends DefaultProducer {
-    private static final transient Log log = LogFactory.getLog(JmsProducer.class);
+    private static final transient Log LOG = LogFactory.getLog(JmsProducer.class);
     private final JmsEndpoint endpoint;
     private final JmsOperations template;
 
@@ -46,8 +46,8 @@
         template.send(endpoint.getDestination(), new MessageCreator() {
             public Message createMessage(Session session) throws JMSException {
                 Message message = endpoint.getBinding().makeJmsMessage(exchange, session);
-                if (log.isDebugEnabled()) {
-                    log.debug(endpoint + " sending JMS message: " + message);
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug(endpoint + " sending JMS message: " + message);
                 }
                 return message;
             }

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/MessageListenerProcessor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/MessageListenerProcessor.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/MessageListenerProcessor.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/MessageListenerProcessor.java Tue Aug  7 14:33:00 2007
@@ -1,5 +1,4 @@
 /**
- *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,17 +16,18 @@
  */
 package org.apache.camel.component.jms;
 
+import javax.jms.Message;
+import javax.jms.MessageListener;
+
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.RuntimeCamelException;
 
-import javax.jms.Message;
-import javax.jms.MessageListener;
-
 /**
- * Represents a JMS {@link MessageListener} which can be used directly with any JMS template
- * or derived from to create an MDB for processing messages using a {@link Processor}
- *
+ * Represents a JMS {@link MessageListener} which can be used directly with any
+ * JMS template or derived from to create an MDB for processing messages using a
+ * {@link Processor}
+ * 
  * @version $Revision:520964 $
  */
 public class MessageListenerProcessor implements MessageListener {
@@ -41,10 +41,10 @@
 
     public void onMessage(Message message) {
         try {
-			Exchange exchange = endpoint.createExchange(message);
-			processor.process(exchange);
-		} catch (Exception e) {
-			throw new RuntimeCamelException(e);
-		}
+            Exchange exchange = endpoint.createExchange(message);
+            processor.process(exchange);
+        } catch (Exception e) {
+            throw new RuntimeCamelException(e);
+        }
     }
 }

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/MessagePropertyAccessException.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/MessagePropertyAccessException.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/MessagePropertyAccessException.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/MessagePropertyAccessException.java Tue Aug  7 14:33:00 2007
@@ -1,4 +1,4 @@
-/*
+/**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -23,7 +23,7 @@
  */
 public class MessagePropertyAccessException extends RuntimeJmsException {
     private static final long serialVersionUID = -3996286386119163309L;
-    private String propertyName;
+    private final String propertyName;
 
     public MessagePropertyAccessException(String propertyName, JMSException e) {
         super("Error accessing header: " + propertyName, e);

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/MessagePropertyNamesAccessException.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/MessagePropertyNamesAccessException.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/MessagePropertyNamesAccessException.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/MessagePropertyNamesAccessException.java Tue Aug  7 14:33:00 2007
@@ -1,4 +1,4 @@
-/*
+/**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.

Modified: activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/RuntimeJmsException.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/RuntimeJmsException.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/RuntimeJmsException.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/main/java/org/apache/camel/component/jms/RuntimeJmsException.java Tue Aug  7 14:33:00 2007
@@ -1,4 +1,4 @@
-/*
+/**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.

Modified: activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsEndpointConfigurationTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsEndpointConfigurationTest.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsEndpointConfigurationTest.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsEndpointConfigurationTest.java Tue Aug  7 14:33:00 2007
@@ -1,4 +1,4 @@
-/*
+/**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -16,15 +16,17 @@
  */
 package org.apache.camel.component.jms;
 
+import javax.jms.ConnectionFactory;
+
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.camel.CamelContext;
 import org.apache.camel.ContextTestSupport;
-import org.apache.camel.Processor;
 import org.apache.camel.Exchange;
-import static org.apache.camel.component.jms.JmsComponent.jmsComponentClientAcknowledge;
+import org.apache.camel.Processor;
+
 import org.springframework.jms.listener.AbstractMessageListenerContainer;
 
-import javax.jms.ConnectionFactory;
+import static org.apache.camel.component.jms.JmsComponent.jmsComponentClientAcknowledge;
 
 /**
  * @version $Revision: $

Modified: activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java Tue Aug  7 14:33:00 2007
@@ -1,5 +1,4 @@
 /**
- *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -17,14 +16,15 @@
  */
 package org.apache.camel.component.jms;
 
+import javax.jms.ConnectionFactory;
+
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.camel.CamelContext;
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.builder.RouteBuilder;
-import static org.apache.camel.component.jms.JmsComponent.jmsComponentClientAcknowledge;
 import org.apache.camel.component.mock.MockEndpoint;
 
-import javax.jms.ConnectionFactory;
+import static org.apache.camel.component.jms.JmsComponent.jmsComponentClientAcknowledge;
 
 /**
  * @version $Revision$

Modified: activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringAndJmsNameTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringAndJmsNameTest.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringAndJmsNameTest.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringAndJmsNameTest.java Tue Aug  7 14:33:00 2007
@@ -1,4 +1,4 @@
-/*
+/**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.

Modified: activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringTest.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringTest.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringTest.java Tue Aug  7 14:33:00 2007
@@ -1,4 +1,4 @@
-/*
+/**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.

Modified: activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringWithAutoWireTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringWithAutoWireTest.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringWithAutoWireTest.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteUsingSpringWithAutoWireTest.java Tue Aug  7 14:33:00 2007
@@ -1,4 +1,4 @@
-/*
+/**
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.

Modified: activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/PurchaseOrder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/PurchaseOrder.java?view=diff&rev=563665&r1=563664&r2=563665
==============================================================================
--- activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/PurchaseOrder.java (original)
+++ activemq/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/PurchaseOrder.java Tue Aug  7 14:33:00 2007
@@ -1,5 +1,4 @@
 /**
- *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
@@ -7,7 +6,7 @@
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
  *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,