camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject camel git commit: Deprecated api on producer - should use endpoint like consumer does
Date Mon, 29 Feb 2016 10:36:22 GMT
Repository: camel
Updated Branches:
  refs/heads/master 926e509f3 -> 7fc38807b


Deprecated api on producer - should use endpoint like consumer does


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

Branch: refs/heads/master
Commit: 7fc38807b801d33c8f87e8b29a0f148b228559ef
Parents: 926e509
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Mon Feb 29 10:52:43 2016 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Mon Feb 29 11:36:15 2016 +0100

----------------------------------------------------------------------
 camel-core/src/main/java/org/apache/camel/Producer.java          | 4 ++++
 .../src/main/java/org/apache/camel/impl/ProducerCache.java       | 2 +-
 .../java/org/apache/camel/management/PublishEventNotifier.java   | 2 +-
 .../java/org/apache/camel/impl/CamelPostProcessorHelperTest.java | 2 +-
 .../org/apache/camel/impl/PojoProduceInterceptEndpointTest.java  | 2 +-
 5 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7fc38807/camel-core/src/main/java/org/apache/camel/Producer.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/Producer.java b/camel-core/src/main/java/org/apache/camel/Producer.java
index 2b890bc..f6be6f4 100644
--- a/camel-core/src/main/java/org/apache/camel/Producer.java
+++ b/camel-core/src/main/java/org/apache/camel/Producer.java
@@ -28,7 +28,9 @@ public interface Producer extends Processor, Service, IsSingleton, EndpointAware
      * Creates a new exchange to send to this endpoint
      * 
      * @return a newly created exchange
+     * @deprecated use {@link Endpoint#createExchange()} - will be removed in Camel 3.0
      */
+    @Deprecated
     Exchange createExchange();
 
     /**
@@ -36,7 +38,9 @@ public interface Producer extends Processor, Service, IsSingleton, EndpointAware
      *
      * @param pattern the exchange pattern
      * @return a newly created exchange
+     * @deprecated use {@link Endpoint#createExchange(ExchangePattern)} - will be removed
in Camel 3.0
      */
+    @Deprecated
     Exchange createExchange(ExchangePattern pattern);
 
     /**

http://git-wip-us.apache.org/repos/asf/camel/blob/7fc38807/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java b/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java
index 586cc69..9be2825 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/ProducerCache.java
@@ -380,7 +380,7 @@ public class ProducerCache extends ServiceSupport {
         return doInProducer(endpoint, exchange, pattern, new ProducerCallback<Exchange>()
{
             public Exchange doInProducer(Producer producer, Exchange exchange, ExchangePattern
pattern) {
                 if (exchange == null) {
-                    exchange = pattern != null ? producer.createExchange(pattern) : producer.createExchange();
+                    exchange = pattern != null ? producer.getEndpoint().createExchange(pattern)
: producer.getEndpoint().createExchange();
                 }
 
                 if (processor != null) {

http://git-wip-us.apache.org/repos/asf/camel/blob/7fc38807/camel-core/src/main/java/org/apache/camel/management/PublishEventNotifier.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/management/PublishEventNotifier.java
b/camel-core/src/main/java/org/apache/camel/management/PublishEventNotifier.java
index cd92275..17d0ed9 100644
--- a/camel-core/src/main/java/org/apache/camel/management/PublishEventNotifier.java
+++ b/camel-core/src/main/java/org/apache/camel/management/PublishEventNotifier.java
@@ -58,7 +58,7 @@ public class PublishEventNotifier extends EventNotifierSupport implements
CamelC
             return;
         }
 
-        Exchange exchange = producer.createExchange();
+        Exchange exchange = producer.getEndpoint().createExchange();
         exchange.getIn().setBody(event);
 
         // make sure we don't send out events for this as well

http://git-wip-us.apache.org/repos/asf/camel/blob/7fc38807/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java
b/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java
index f4fff4e..3bacc23 100644
--- a/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java
+++ b/camel-core/src/test/java/org/apache/camel/impl/CamelPostProcessorHelperTest.java
@@ -468,7 +468,7 @@ public class CamelPostProcessorHelperTest extends ContextTestSupport {
         public void produceSomething(String body) throws Exception {
             assertEquals("Hello World", body);
 
-            Exchange exchange = producer.createExchange();
+            Exchange exchange = producer.getEndpoint().createExchange();
             exchange.addOnCompletion(mySynchronization);
             exchange.getIn().setBody(body);
             producer.process(exchange);

http://git-wip-us.apache.org/repos/asf/camel/blob/7fc38807/camel-core/src/test/java/org/apache/camel/impl/PojoProduceInterceptEndpointTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/impl/PojoProduceInterceptEndpointTest.java
b/camel-core/src/test/java/org/apache/camel/impl/PojoProduceInterceptEndpointTest.java
index 553d28e..5e08225 100644
--- a/camel-core/src/test/java/org/apache/camel/impl/PojoProduceInterceptEndpointTest.java
+++ b/camel-core/src/test/java/org/apache/camel/impl/PojoProduceInterceptEndpointTest.java
@@ -97,7 +97,7 @@ public class PojoProduceInterceptEndpointTest extends TestCase {
         Producer producer;
 
         public Object doSomething(String body) throws Exception {
-            Exchange exchange = producer.createExchange();
+            Exchange exchange = producer.getEndpoint().createExchange();
             exchange.getIn().setBody(body);
             producer.process(exchange);
             return exchange.hasOut() ? exchange.getOut().getBody() : exchange.getIn().getBody();


Mime
View raw message