activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r534145 [3/3] - in /activemq/camel/trunk: camel-core/src/main/java/org/apache/camel/ camel-core/src/main/java/org/apache/camel/builder/ camel-core/src/main/java/org/apache/camel/builder/xml/ camel-core/src/main/java/org/apache/camel/compone...
Date Tue, 01 May 2007 16:23:54 GMT
Modified: activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java (original)
+++ activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/EndpointMessageListener.java Tue May  1 09:23:37 2007
@@ -35,10 +35,10 @@
 public class EndpointMessageListener<E extends Exchange> implements MessageListener {
     private static final transient Log log = LogFactory.getLog(EndpointMessageListener.class);
     private Endpoint<E> endpoint;
-    private Processor<E> processor;
+    private Processor processor;
     private JmsBinding binding;
 
-    public EndpointMessageListener(Endpoint<E> endpoint, Processor<E> processor) {
+    public EndpointMessageListener(Endpoint<E> endpoint, Processor processor) {
         this.endpoint = endpoint;
         this.processor = processor;
     }

Modified: activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java (original)
+++ activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/JmsBinding.java Tue May  1 09:23:37 2007
@@ -17,6 +17,8 @@
  */
 package org.apache.camel.component.jms;
 
+import org.apache.camel.Exchange;
+
 import javax.jms.BytesMessage;
 import javax.jms.JMSException;
 import javax.jms.MapMessage;
@@ -77,33 +79,33 @@
      * @return a newly created JMS Message instance containing the
      * @throws JMSException if the message could not be created
      */
-    public Message makeJmsMessage(JmsMessage message, Session session) throws JMSException {
-        Message answer = createJmsMessage(message, session);
-        appendJmsProperties(answer, message, session);
+    public Message makeJmsMessage(Exchange exchange, Session session) throws JMSException {
+        Message answer = createJmsMessage(exchange.getIn().getBody(), session);
+        appendJmsProperties(answer, exchange, session);
         return answer;
     }
 
     /**
      * Appends the JMS headers from the Camel {@link JmsMessage}
      */
-    protected void appendJmsProperties(Message jmsMessage, JmsMessage camelMessage, Session session) throws JMSException {
-        Set<Map.Entry<String, Object>> entries = camelMessage.getHeaders().entrySet();
+    protected void appendJmsProperties(Message jmsMessage, Exchange exchange, Session session) throws JMSException {
+        org.apache.camel.Message in = exchange.getIn();
+        Set<Map.Entry<String, Object>> entries = in.getHeaders().entrySet();
         for (Map.Entry<String, Object> entry : entries) {
             String headerName = entry.getKey();
             Object headerValue = entry.getValue();
-            if (shouldOutputHeader(camelMessage, headerName, headerValue)) {
+            if (shouldOutputHeader(in, headerName, headerValue)) {
                 jmsMessage.setObjectProperty(headerName, headerValue);
             }
         }
     }
 
-    protected Message createJmsMessage(JmsMessage message, Session session) throws JMSException {
-        Object value = message.getBody();
-        if (value instanceof String) {
-            return session.createTextMessage((String) value);
+    protected Message createJmsMessage(Object body, Session session) throws JMSException {
+        if (body instanceof String) {
+            return session.createTextMessage((String) body);
         }
-        else if (value instanceof Serializable) {
-            return session.createObjectMessage((Serializable) value);
+        else if (body instanceof Serializable) {
+            return session.createObjectMessage((Serializable) body);
         }
         else {
             return session.createMessage();
@@ -127,7 +129,7 @@
     /**
      * Strategy to allow filtering of headers which are put on the JMS message
      */
-    protected boolean shouldOutputHeader(JmsMessage camelMessage, String headerName, Object headerValue) {
+    protected boolean shouldOutputHeader(org.apache.camel.Message camelMessage, String headerName, Object headerValue) {
         return true;
     }
 }

Modified: activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConsumer.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConsumer.java (original)
+++ activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/JmsConsumer.java Tue May  1 09:23:37 2007
@@ -32,7 +32,7 @@
 public class JmsConsumer extends DefaultConsumer<JmsExchange> {
     private final AbstractMessageListenerContainer listenerContainer;
 
-    public JmsConsumer(JmsEndpoint endpoint, Processor<JmsExchange> processor, AbstractMessageListenerContainer listenerContainer) {
+    public JmsConsumer(JmsEndpoint endpoint, Processor processor, AbstractMessageListenerContainer listenerContainer) {
         super(endpoint, processor);
         this.listenerContainer = listenerContainer;
 
@@ -40,7 +40,7 @@
         this.listenerContainer.setMessageListener(messageListener);
     }
 
-    protected MessageListener createMessageListener(JmsEndpoint endpoint, Processor<JmsExchange> processor) {
+    protected MessageListener createMessageListener(JmsEndpoint endpoint, Processor processor) {
         EndpointMessageListener<JmsExchange> messageListener = new EndpointMessageListener<JmsExchange>(endpoint, processor);
         messageListener.setBinding(endpoint.getBinding());
         return messageListener;

Modified: activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java (original)
+++ activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/JmsEndpoint.java Tue May  1 09:23:37 2007
@@ -60,7 +60,7 @@
         return startService(new JmsProducer(this, template));
     }
 
-    public Consumer<JmsExchange> createConsumer(Processor<JmsExchange> processor) throws Exception {
+    public Consumer<JmsExchange> createConsumer(Processor processor) throws Exception {
         AbstractMessageListenerContainer listenerContainer = configuration.createMessageListenerContainer();
         return createConsumer(processor, listenerContainer);
     }
@@ -73,7 +73,7 @@
      * @return a newly created consumer
      * @throws Exception if the consumer cannot be created
      */
-    public Consumer<JmsExchange> createConsumer(Processor<JmsExchange> processor, AbstractMessageListenerContainer listenerContainer) throws Exception {
+    public Consumer<JmsExchange> createConsumer(Processor processor, AbstractMessageListenerContainer listenerContainer) throws Exception {
         listenerContainer.setDestinationName(destination);
         listenerContainer.setPubSubDomain(pubSubDomain);
         if (selector != null) {

Modified: activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java (original)
+++ activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java Tue May  1 09:23:37 2007
@@ -31,7 +31,7 @@
 /**
  * @version $Revision$
  */
-public class JmsProducer extends DefaultProducer<JmsExchange> {
+public class JmsProducer extends DefaultProducer {
     private static final transient Log log = LogFactory.getLog(JmsProducer.class);
     private final JmsEndpoint endpoint;
     private final JmsOperations template;
@@ -42,10 +42,10 @@
         this.template = template;
     }
 
-    public void process(final JmsExchange exchange) {
+    public void process(final Exchange exchange) {
         template.send(endpoint.getDestination(), new MessageCreator() {
             public Message createMessage(Session session) throws JMSException {
-                Message message = endpoint.getBinding().makeJmsMessage(exchange.getIn(), session);
+                Message message = endpoint.getBinding().makeJmsMessage(exchange, session);
                 if (log.isDebugEnabled()) {
                     log.debug(endpoint + " sending JMS message: " + message);
                 }

Modified: activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/MessageListenerProcessor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/MessageListenerProcessor.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/MessageListenerProcessor.java (original)
+++ activemq/camel/trunk/camel-jms/src/main/java/org/apache/camel/component/jms/MessageListenerProcessor.java Tue May  1 09:23:37 2007
@@ -32,9 +32,9 @@
  */
 public class MessageListenerProcessor implements MessageListener {
     private final JmsEndpoint endpoint;
-    private final Processor<Exchange> processor;
+    private final Processor processor;
 
-    public MessageListenerProcessor(JmsEndpoint endpoint, Processor<Exchange> processor) {
+    public MessageListenerProcessor(JmsEndpoint endpoint, Processor processor) {
         this.endpoint = endpoint;
         this.processor = processor;
     }

Modified: activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java (original)
+++ activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRouteTest.java Tue May  1 09:23:37 2007
@@ -22,6 +22,7 @@
 import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
 import org.apache.camel.Processor;
+import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import static org.apache.camel.component.jms.JmsComponent.jmsComponentClientAcknowledge;
 import org.apache.camel.impl.DefaultCamelContext;
@@ -65,12 +66,11 @@
     }
 
     protected void sendExchange(final Object expectedBody) {
-        client.send(endpoint, new Processor<JmsExchange>() {
-            public void process(JmsExchange exchange) {
+        client.send(endpoint, new Processor() {
+            public void process(Exchange exchange) {
                 // now lets fire in a message
-                JmsMessage in = exchange.getIn();
-                in.setBody(expectedBody);
-                in.setHeader("cheese", 123);
+                exchange.getIn().setBody(expectedBody);
+                exchange.getIn().setHeader("cheese", 123);
             }
         });
     }
@@ -103,10 +103,10 @@
         container.addRoutes(new RouteBuilder() {
             public void configure() {
                 from("activemq:queue:test.a").to("activemq:queue:test.b");
-                from("activemq:queue:test.b").process(new Processor<JmsExchange>() {
-                    public void process(JmsExchange e) {
+                from("activemq:queue:test.b").process(new Processor() {
+                    public void process(Exchange e) {
                         System.out.println("Received exchange: " + e.getIn());
-                        receivedExchange = e;
+                        receivedExchange = (JmsExchange) e;
                         latch.countDown();
                     }
                 });

Modified: activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/TransactedJmsRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/TransactedJmsRouteTest.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/TransactedJmsRouteTest.java (original)
+++ activemq/camel/trunk/camel-jms/src/test/java/org/apache/camel/component/jms/TransactedJmsRouteTest.java Tue May  1 09:23:37 2007
@@ -28,6 +28,7 @@
 import org.apache.camel.CamelContext;
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.Processor;
+import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.processor.DelegateProcessor;
@@ -66,7 +67,7 @@
 					public Processor wrap(Processor processor) {
 						return new DelegateProcessor(processor) {
 				        	@Override
-				        	public void process(Object exchange) throws Exception {
+				        	public void process(Exchange exchange) throws Exception {
 				        		processNext(exchange);
 				        		throw new RuntimeException("rollback");
 				        	}
@@ -83,7 +84,7 @@
 					public Processor wrap(Processor processor) {
 						return new DelegateProcessor(processor) {
 				        	@Override
-				        	public void process(Object exchange) {
+				        	public void process(Exchange exchange) {
 				        		try {
 				        			processNext(exchange);
 				        		} catch ( Throwable e ) {

Modified: activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java (original)
+++ activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaConsumer.java Tue May  1 09:23:37 2007
@@ -47,7 +47,7 @@
     private String namedQuery;
     private String nativeQuery;
 
-    public JpaConsumer(JpaEndpoint endpoint, Processor<Exchange> processor) {
+    public JpaConsumer(JpaEndpoint endpoint, Processor processor) {
         super(endpoint, processor);
         this.endpoint = endpoint;
         this.template = endpoint.createTransactionStrategy();

Modified: activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java (original)
+++ activemq/camel/trunk/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaEndpoint.java Tue May  1 09:23:37 2007
@@ -60,7 +60,7 @@
         return startService(new JpaProducer(this, getProducerExpression()));
     }
 
-    public Consumer<Exchange> createConsumer(Processor<Exchange> processor) throws Exception {
+    public Consumer<Exchange> createConsumer(Processor processor) throws Exception {
         JpaConsumer consumer = new JpaConsumer(this, processor);
         configureConsumer(consumer);
         return startService(consumer);

Modified: activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaTest.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaTest.java (original)
+++ activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaTest.java Tue May  1 09:23:37 2007
@@ -68,7 +68,7 @@
         assertEquals("Should have no results: " + results, 0, results.size());
 
         // lets produce some objects
-        client.send(endpoint, new Processor<Exchange>() {
+        client.send(endpoint, new Processor() {
             public void process(Exchange exchange) {
                 exchange.getIn().setBody(new SendEmail("foo@bar.com"));
             }
@@ -81,7 +81,7 @@
         assertEquals("address property", "foo@bar.com", mail.getAddress());
 
         // now lets create a consumer to consume it
-        consumer = endpoint.createConsumer(new Processor<Exchange>() {
+        consumer = endpoint.createConsumer(new Processor() {
             public void process(Exchange e) {
                 log.info("Received exchange: " + e.getIn());
                 receivedExchange = e;

Modified: activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java (original)
+++ activemq/camel/trunk/camel-jpa/src/test/java/org/apache/camel/component/jpa/JpaWithNamedQueryTest.java Tue May  1 09:23:37 2007
@@ -72,7 +72,7 @@
         assertEquals("Should have no results: " + results, 0, results.size());
 
         // lets produce some objects
-        client.send(endpoint, new Processor<Exchange>() {
+        client.send(endpoint, new Processor() {
             public void process(Exchange exchange) {
                 exchange.getIn().setBody(new MultiSteps("foo@bar.com"));
             }
@@ -85,7 +85,7 @@
         assertEquals("address property", "foo@bar.com", mail.getAddress());
 
         // now lets create a consumer to consume it
-        consumer = endpoint.createConsumer(new Processor<Exchange>() {
+        consumer = endpoint.createConsumer(new Processor() {
             public void process(Exchange e) {
                 log.info("Received exchange: " + e.getIn());
                 receivedExchange = e;

Modified: activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailBinding.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailBinding.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailBinding.java (original)
+++ activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailBinding.java Tue May  1 09:23:37 2007
@@ -17,6 +17,8 @@
  */
 package org.apache.camel.component.mail;
 
+import org.apache.camel.Exchange;
+
 import javax.mail.Message;
 import javax.mail.MessagingException;
 import javax.mail.Address;
@@ -32,7 +34,7 @@
  * @version $Revision: 521240 $
  */
 public class MailBinding {
-    public void populateMailMessage(MailEndpoint endpoint, MimeMessage mimeMessage, MailExchange exchange) {
+    public void populateMailMessage(MailEndpoint endpoint, MimeMessage mimeMessage, Exchange exchange) {
         try {
             appendMailHeaders(mimeMessage, exchange.getIn());
 
@@ -75,7 +77,7 @@
     /**
      * Appends the Mail headers from the Camel {@link MailMessage}
      */
-    protected void appendMailHeaders(MimeMessage mimeMessage, MailMessage camelMessage) throws MessagingException {
+    protected void appendMailHeaders(MimeMessage mimeMessage, org.apache.camel.Message camelMessage) throws MessagingException {
         Set<Map.Entry<String, Object>> entries = camelMessage.getHeaders().entrySet();
         for (Map.Entry<String, Object> entry : entries) {
             String headerName = entry.getKey();
@@ -91,7 +93,7 @@
     /**
      * Strategy to allow filtering of headers which are put on the Mail message
      */
-    protected boolean shouldOutputHeader(MailMessage camelMessage, String headerName, Object headerValue) {
+    protected boolean shouldOutputHeader(org.apache.camel.Message camelMessage, String headerName, Object headerValue) {
         return true;
     }
 }

Modified: activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java (original)
+++ activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailConsumer.java Tue May  1 09:23:37 2007
@@ -42,7 +42,7 @@
     private final MailEndpoint endpoint;
     private final Folder folder;
 
-    public MailConsumer(MailEndpoint endpoint, Processor<MailExchange> processor, Folder folder) {
+    public MailConsumer(MailEndpoint endpoint, Processor processor, Folder folder) {
         super(endpoint, processor);
         this.endpoint = endpoint;
         this.folder = folder;

Modified: activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailEndpoint.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailEndpoint.java (original)
+++ activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailEndpoint.java Tue May  1 09:23:37 2007
@@ -51,7 +51,7 @@
         return startService(new MailProducer(this, sender));
     }
 
-    public Consumer<MailExchange> createConsumer(Processor<MailExchange> processor) throws Exception {
+    public Consumer<MailExchange> createConsumer(Processor processor) throws Exception {
         JavaMailConnection connection = configuration.createJavaMailConnection(this);
         String protocol = getConfiguration().getProtocol();
         if (protocol.equals("smtp")) {
@@ -73,7 +73,7 @@
      * @return a newly created consumer
      * @throws Exception if the consumer cannot be created
      */
-    public Consumer<MailExchange> createConsumer(Processor<MailExchange> processor, Folder folder) throws Exception {
+    public Consumer<MailExchange> createConsumer(Processor processor, Folder folder) throws Exception {
         MailConsumer answer = new MailConsumer(this, processor, folder);
         configureConsumer(answer);
         return startService(answer);

Modified: activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailProducer.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailProducer.java (original)
+++ activemq/camel/trunk/camel-mail/src/main/java/org/apache/camel/component/mail/MailProducer.java Tue May  1 09:23:37 2007
@@ -18,6 +18,7 @@
 package org.apache.camel.component.mail;
 
 import org.apache.camel.impl.DefaultProducer;
+import org.apache.camel.Exchange;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.mail.javamail.JavaMailSender;
@@ -40,7 +41,7 @@
     }
 
 
-    public void process(final MailExchange exchange) {
+    public void process(final Exchange exchange) {
         sender.send(new MimeMessagePreparator() {
             public void prepare(MimeMessage mimeMessage) throws Exception {
                 endpoint.getBinding().populateMailMessage(endpoint, mimeMessage, exchange);

Modified: activemq/camel/trunk/camel-mail/src/test/java/org/apache/camel/component/mail/MailRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-mail/src/test/java/org/apache/camel/component/mail/MailRouteTest.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-mail/src/test/java/org/apache/camel/component/mail/MailRouteTest.java (original)
+++ activemq/camel/trunk/camel-mail/src/test/java/org/apache/camel/component/mail/MailRouteTest.java Tue May  1 09:23:37 2007
@@ -41,7 +41,7 @@
         resultEndpoint = (MockEndpoint) resolveMandatoryEndpoint("mock:result");
         resultEndpoint.expectedBodiesReceived("hello world!");
 
-        client.send("smtp://james@localhost", new Processor<Exchange>() {
+        client.send("smtp://james@localhost", new Processor() {
             public void process(Exchange exchange) {
                 exchange.getIn().setBody("hello world!");
             }

Modified: activemq/camel/trunk/camel-mina/src/main/java/org/apache/camel/component/mina/MinaConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-mina/src/main/java/org/apache/camel/component/mina/MinaConsumer.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-mina/src/main/java/org/apache/camel/component/mina/MinaConsumer.java (original)
+++ activemq/camel/trunk/camel-mina/src/main/java/org/apache/camel/component/mina/MinaConsumer.java Tue May  1 09:23:37 2007
@@ -40,7 +40,7 @@
     private final SocketAddress address;
     private final IoAcceptor acceptor;
 
-    public MinaConsumer(final MinaEndpoint endpoint, Processor<MinaExchange> processor) {
+    public MinaConsumer(final MinaEndpoint endpoint, Processor processor) {
         super(endpoint, processor);
         this.endpoint = endpoint;
          address = endpoint.getAddress();

Modified: activemq/camel/trunk/camel-mina/src/main/java/org/apache/camel/component/mina/MinaEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-mina/src/main/java/org/apache/camel/component/mina/MinaEndpoint.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-mina/src/main/java/org/apache/camel/component/mina/MinaEndpoint.java (original)
+++ activemq/camel/trunk/camel-mina/src/main/java/org/apache/camel/component/mina/MinaEndpoint.java Tue May  1 09:23:37 2007
@@ -53,7 +53,7 @@
         return startService(new MinaProducer(this));
     }
 
-    public Consumer<MinaExchange> createConsumer(Processor<MinaExchange> processor) throws Exception {
+    public Consumer<MinaExchange> createConsumer(Processor processor) throws Exception {
         return startService(new MinaConsumer(this, processor));
     }
 

Modified: activemq/camel/trunk/camel-mina/src/main/java/org/apache/camel/component/mina/MinaProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-mina/src/main/java/org/apache/camel/component/mina/MinaProducer.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-mina/src/main/java/org/apache/camel/component/mina/MinaProducer.java (original)
+++ activemq/camel/trunk/camel-mina/src/main/java/org/apache/camel/component/mina/MinaProducer.java Tue May  1 09:23:37 2007
@@ -18,6 +18,7 @@
 package org.apache.camel.component.mina;
 
 import org.apache.camel.Producer;
+import org.apache.camel.Exchange;
 import org.apache.camel.impl.DefaultProducer;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -34,7 +35,7 @@
  *
  * @version $Revision$
  */
-public class MinaProducer extends DefaultProducer<MinaExchange> {
+public class MinaProducer extends DefaultProducer {
     private static final transient Log log = LogFactory.getLog(MinaProducer.class);
     private IoSession session;
     private MinaEndpoint endpoint;
@@ -44,7 +45,7 @@
         this.endpoint = endpoint;
     }
 
-    public void process(MinaExchange exchange) {
+    public void process(Exchange exchange) {
         if (session == null) {
             throw new IllegalStateException("Not started yet!");
         }

Modified: activemq/camel/trunk/camel-mina/src/test/java/org/apache/camel/component/mina/MinaVmTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-mina/src/test/java/org/apache/camel/component/mina/MinaVmTest.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-mina/src/test/java/org/apache/camel/component/mina/MinaVmTest.java (original)
+++ activemq/camel/trunk/camel-mina/src/test/java/org/apache/camel/component/mina/MinaVmTest.java Tue May  1 09:23:37 2007
@@ -23,6 +23,7 @@
 import org.apache.camel.Message;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
+import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.impl.DefaultCamelContext;
 
@@ -35,7 +36,7 @@
 public class MinaVmTest extends TestCase {
     protected CamelContext container = new DefaultCamelContext();
     protected CountDownLatch latch = new CountDownLatch(1);
-    protected MinaExchange receivedExchange;
+    protected Exchange receivedExchange;
     protected String uri = "mina:vm://localhost:8080";
     protected Producer<MinaExchange> producer;
 
@@ -74,8 +75,8 @@
     protected RouteBuilder createRouteBuilder() {
         return new RouteBuilder() {
             public void configure() {
-                from(uri).process(new Processor<MinaExchange>() {
-                    public void process(MinaExchange e) {
+                from(uri).process(new Processor() {
+                    public void process(Exchange e) {
                         System.out.println("Received exchange: " + e.getIn());
                         receivedExchange = e;
                         latch.countDown();

Modified: activemq/camel/trunk/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiConsumer.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiConsumer.java (original)
+++ activemq/camel/trunk/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiConsumer.java Tue May  1 09:23:37 2007
@@ -42,7 +42,7 @@
 	private Remote stub;
 	private Remote proxy;
 
-	public RmiConsumer(RmiEndpoint endpoint, Processor<PojoExchange> processor) {
+	public RmiConsumer(RmiEndpoint endpoint, Processor processor) {
 		super(endpoint, processor);
 		this.endpoint = endpoint;
 		

Modified: activemq/camel/trunk/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiEndpoint.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiEndpoint.java (original)
+++ activemq/camel/trunk/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiEndpoint.java Tue May  1 09:23:37 2007
@@ -54,7 +54,7 @@
 		return new PojoExchange(getContext());
 	}
 
-	public Consumer<PojoExchange> createConsumer(Processor<PojoExchange> processor) throws Exception {
+	public Consumer<PojoExchange> createConsumer(Processor processor) throws Exception {
 		if( remoteInterfaces == null || remoteInterfaces.size()==0 )
 			throw new RuntimeCamelException("To create an RMI consumer, the RMI endpoint's remoteInterfaces property must be be configured.");
 		return new RmiConsumer(this, processor);

Modified: activemq/camel/trunk/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiProducer.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiProducer.java (original)
+++ activemq/camel/trunk/camel-rmi/src/main/java/org/apache/camel/component/rmi/RmiProducer.java Tue May  1 09:23:37 2007
@@ -26,11 +26,12 @@
 import org.apache.camel.component.pojo.PojoEndpoint;
 import org.apache.camel.component.pojo.PojoExchange;
 import org.apache.camel.impl.DefaultProducer;
+import org.apache.camel.Exchange;
 
 /**
  * @version $Revision: 533076 $
  */
-public class RmiProducer extends DefaultProducer<PojoExchange> {
+public class RmiProducer extends DefaultProducer {
 
 	private final RmiEndpoint endpoint;
 	private Remote remote;
@@ -40,9 +41,9 @@
 		this.endpoint = endpoint;
 	}
 
-	public void process(PojoExchange exchange) throws AccessException, RemoteException, NotBoundException {
-		
-		PojoEndpoint.invoke(getRemote(), exchange);
+	public void process(Exchange exchange) throws AccessException, RemoteException, NotBoundException {
+        PojoExchange pojoExchange = endpoint.toExchangeType(exchange);
+        PojoEndpoint.invoke(getRemote(), pojoExchange);
 	}
 
 	public Remote getRemote() throws AccessException, RemoteException, NotBoundException {

Modified: activemq/camel/trunk/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java (original)
+++ activemq/camel/trunk/camel-script/src/main/java/org/apache/camel/builder/script/ScriptBuilder.java Tue May  1 09:23:37 2007
@@ -43,7 +43,7 @@
  *
  * @version $Revision$
  */
-public class ScriptBuilder<E extends Exchange> implements Expression<E>, Predicate<E>, Processor<E> {
+public class ScriptBuilder<E extends Exchange> implements Expression<E>, Predicate<E>, Processor {
     private String scriptEngineName;
     private Resource scriptResource;
     private String scriptText;
@@ -81,7 +81,7 @@
         }
     }
 
-    public void process(E exchange) {
+    public void process(Exchange exchange) {
         evaluateScript(exchange);
     }
 

Modified: activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringTransactionPolicy.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringTransactionPolicy.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringTransactionPolicy.java (original)
+++ activemq/camel/trunk/camel-spring/src/main/java/org/apache/camel/spring/spi/SpringTransactionPolicy.java Tue May  1 09:23:37 2007
@@ -19,6 +19,7 @@
 
 import org.apache.camel.Processor;
 import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.Exchange;
 import org.apache.camel.processor.DelegateProcessor;
 import org.apache.camel.spi.Policy;
 import org.apache.commons.logging.Log;
@@ -45,16 +46,16 @@
         this.template = template;
     }
 
-    public Processor<E> wrap(Processor<E> processor) {
+    public Processor wrap(Processor processor) {
         final TransactionTemplate transactionTemplate = getTemplate();
         if (transactionTemplate == null) {
             log.warn("No TransactionTemplate available so transactions will not be enabled!");
             return processor;
         }
 
-        return new DelegateProcessor<E>(processor) {
+        return new DelegateProcessor(processor) {
 
-            public void process(final E exchange) {
+            public void process(final Exchange exchange) {
                 transactionTemplate.execute(new TransactionCallbackWithoutResult() {
                     protected void doInTransactionWithoutResult(TransactionStatus status) {
                         try {

Modified: activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/CustomProcessorWithNamespacesTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/CustomProcessorWithNamespacesTest.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/CustomProcessorWithNamespacesTest.java (original)
+++ activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/CustomProcessorWithNamespacesTest.java Tue May  1 09:23:37 2007
@@ -44,7 +44,7 @@
 
         // now lets send a message
         CamelClient<Exchange> client = new CamelClient<Exchange>(context);
-        client.send("direct:start", new Processor<Exchange>() {
+        client.send("direct:start", new Processor() {
             public void process(Exchange exchange) {
                 Message in = exchange.getIn();
                 in.setHeader("name", "James");

Modified: activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/RoutingUsingCamelContextFactoryTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/RoutingUsingCamelContextFactoryTest.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/RoutingUsingCamelContextFactoryTest.java (original)
+++ activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/RoutingUsingCamelContextFactoryTest.java Tue May  1 09:23:37 2007
@@ -47,7 +47,7 @@
 
         // now lets send a message
         CamelClient<Exchange> client = new CamelClient<Exchange>(context);
-        client.send("queue:start", new Processor<Exchange>() {
+        client.send("queue:start", new Processor() {
             public void process(Exchange exchange) {
                 Message in = exchange.getIn();
                 in.setHeader("name", "James");

Modified: activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/example/MyProcessor.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/example/MyProcessor.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/example/MyProcessor.java (original)
+++ activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/example/MyProcessor.java Tue May  1 09:23:37 2007
@@ -26,7 +26,7 @@
 /**
  * @version $Revision: 1.1 $
  */
-public class MyProcessor implements Processor<Exchange> {
+public class MyProcessor implements Processor {
     private static List exchanges = new CopyOnWriteArrayList();
 
     private String name = "James";

Modified: activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/xml/XmlRouteBuilderTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/xml/XmlRouteBuilderTest.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/xml/XmlRouteBuilderTest.java (original)
+++ activemq/camel/trunk/camel-spring/src/test/java/org/apache/camel/spring/xml/XmlRouteBuilderTest.java Tue May  1 09:23:37 2007
@@ -54,7 +54,7 @@
 	
 	@Override
 	protected RouteBuilder buildCustomProcessor() {
-		myProcessor = (Processor<Exchange>) ctx.getBean("myProcessor");
+		myProcessor = (Processor) ctx.getBean("myProcessor");
 		RouteBuilder builder = (RouteBuilder) ctx.getBean("buildCustomProcessor");
 		assertNotNull(builder);
 		return builder;
@@ -62,7 +62,7 @@
 	
 	@Override
 	protected RouteBuilder buildCustomProcessorWithFilter() {
-		myProcessor = (Processor<Exchange>) ctx.getBean("myProcessor");
+		myProcessor = (Processor) ctx.getBean("myProcessor");
 		RouteBuilder builder = (RouteBuilder) ctx.getBean("buildCustomProcessorWithFilter");
 		assertNotNull(builder);
 		return builder;
@@ -70,8 +70,8 @@
 	
 	@Override
 	protected RouteBuilder buildRouteWithInterceptor() {
-		interceptor1 = (DelegateProcessor<Exchange>) ctx.getBean("interceptor1");
-		interceptor2 = (DelegateProcessor<Exchange>) ctx.getBean("interceptor2");
+		interceptor1 = (DelegateProcessor) ctx.getBean("interceptor1");
+		interceptor2 = (DelegateProcessor) ctx.getBean("interceptor2");
 		RouteBuilder builder = (RouteBuilder) ctx.getBean("buildRouteWithInterceptor");
 		assertNotNull(builder);
 		return builder;

Modified: activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppBinding.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppBinding.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppBinding.java (original)
+++ activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppBinding.java Tue May  1 09:23:37 2007
@@ -18,6 +18,7 @@
 package org.apache.camel.component.xmpp;
 
 import org.jivesoftware.smack.packet.Message;
+import org.apache.camel.Exchange;
 
 import java.util.Map;
 import java.util.Set;
@@ -32,7 +33,7 @@
     /**
      * Populates the given XMPP message from the inbound exchange
      */
-    public void populateXmppMessage(Message message, XmppExchange exchange) {
+    public void populateXmppMessage(Message message, Exchange exchange) {
         message.setBody(exchange.getIn().getBody(String.class));
 
         Set<Map.Entry<String, Object>> entries = exchange.getIn().getHeaders().entrySet();
@@ -62,7 +63,7 @@
     /**
      * Strategy to allow filtering of headers which are put on the XMPP message
      */
-    protected boolean shouldOutputHeader(XmppExchange exchange, String headerName, Object headerValue) {
+    protected boolean shouldOutputHeader(Exchange exchange, String headerName, Object headerValue) {
         return true;
     }
 }

Modified: activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java (original)
+++ activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppConsumer.java Tue May  1 09:23:37 2007
@@ -38,7 +38,7 @@
     private static final transient Log log = LogFactory.getLog(XmppConsumer.class);
     private final XmppEndpoint endpoint;
 
-    public XmppConsumer(XmppEndpoint endpoint, Processor<XmppExchange> processor) {
+    public XmppConsumer(XmppEndpoint endpoint, Processor processor) {
         super(endpoint, processor);
         this.endpoint = endpoint;
     }

Modified: activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java (original)
+++ activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppEndpoint.java Tue May  1 09:23:37 2007
@@ -75,7 +75,7 @@
         return startService(new XmppPrivateChatProducer(this, participant));
     }
 
-    public Consumer<XmppExchange> createConsumer(Processor<XmppExchange> processor) throws Exception {
+    public Consumer<XmppExchange> createConsumer(Processor processor) throws Exception {
         return startService(new XmppConsumer(this, processor));
     }
 

Modified: activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppGroupChatProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppGroupChatProducer.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppGroupChatProducer.java (original)
+++ activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppGroupChatProducer.java Tue May  1 09:23:37 2007
@@ -28,7 +28,7 @@
 /**
  * @version $Revision$
  */
-public class XmppGroupChatProducer extends DefaultProducer<XmppExchange> {
+public class XmppGroupChatProducer extends DefaultProducer {
     private static final transient Log log = LogFactory.getLog(XmppGroupChatProducer.class);
     private final XmppEndpoint endpoint;
     private final String room;
@@ -43,13 +43,7 @@
         }
     }
 
-    public void onExchange(Exchange exchange) {
-        // lets convert to the type of an exchange
-        XmppExchange xmppExchange = endpoint.convertTo(XmppExchange.class, exchange);
-        process(xmppExchange);
-    }
-
-    public void process(XmppExchange exchange) {
+    public void process(Exchange exchange) {
         // TODO it would be nice if we could reuse the message from the exchange
         Message message = chat.createMessage();
         message.setTo(room);

Modified: activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppPrivateChatProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppPrivateChatProducer.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppPrivateChatProducer.java (original)
+++ activemq/camel/trunk/camel-xmpp/src/main/java/org/apache/camel/component/xmpp/XmppPrivateChatProducer.java Tue May  1 09:23:37 2007
@@ -28,7 +28,7 @@
 /**
  * @version $Revision$
  */
-public class XmppPrivateChatProducer extends DefaultProducer<XmppExchange> {
+public class XmppPrivateChatProducer extends DefaultProducer {
     private static final transient Log log = LogFactory.getLog(XmppPrivateChatProducer.class);
     private final XmppEndpoint endpoint;
     private final String participant;
@@ -43,13 +43,7 @@
         }
     }
 
-    public void onExchange(Exchange exchange) {
-        // lets convert to the type of an exchange
-        XmppExchange xmppExchange = endpoint.convertTo(XmppExchange.class, exchange);
-        process(xmppExchange);
-    }
-
-    public void process(XmppExchange exchange) {
+    public void process(Exchange exchange) {
         // TODO it would be nice if we could reuse the message from the exchange
         Message message = chat.createMessage();
         message.setTo(participant);

Modified: activemq/camel/trunk/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteTest.java?view=diff&rev=534145&r1=534144&r2=534145
==============================================================================
--- activemq/camel/trunk/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteTest.java (original)
+++ activemq/camel/trunk/camel-xmpp/src/test/java/org/apache/camel/component/xmpp/XmppRouteTest.java Tue May  1 09:23:37 2007
@@ -23,6 +23,7 @@
 import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
 import org.apache.camel.Processor;
+import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.converter.ObjectConverter;
 import org.apache.camel.impl.DefaultCamelContext;
@@ -80,12 +81,11 @@
     }
 
     protected void sendExchange(final Object expectedBody) {
-        client.send(endpoint, new Processor<XmppExchange>() {
-            public void process(XmppExchange exchange) {
+        client.send(endpoint, new Processor() {
+            public void process(Exchange exchange) {
                 // now lets fire in a message
-                XmppMessage in = exchange.getIn();
-                in.setBody(expectedBody);
-                in.setHeader("cheese", 123);
+                exchange.getIn().setBody(expectedBody);
+                exchange.getIn().setHeader("cheese", 123);
             }
         });
     }
@@ -120,10 +120,10 @@
             container.addRoutes(new RouteBuilder() {
                 public void configure() {
                     from(uri1).to(uri2);
-                    from(uri2).process(new Processor<XmppExchange>() {
-                        public void process(XmppExchange e) {
+                    from(uri2).process(new Processor() {
+                        public void process(Exchange e) {
                             log.info("Received exchange: " + e);
-                            receivedExchange = e;
+                            receivedExchange = (XmppExchange) e;
                             latch.countDown();
                         }
                     });



Mime
View raw message