You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2016/02/13 12:38:56 UTC
camel git commit: Optimize toString on camel-redis producer
Repository: camel
Updated Branches:
refs/heads/master c309a8d5e -> 9129c7792
Optimize toString on camel-redis producer
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9129c779
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9129c779
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9129c779
Branch: refs/heads/master
Commit: 9129c779291b9d98e3cabb58192be417413ecc2d
Parents: c309a8d
Author: Andrea Cosentino <an...@gmail.com>
Authored: Sat Feb 13 12:38:19 2016 +0100
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Sat Feb 13 12:38:19 2016 +0100
----------------------------------------------------------------------
.../java/org/apache/camel/component/redis/RedisProducer.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/9129c779/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/RedisProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/RedisProducer.java b/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/RedisProducer.java
index a99e319..e803137 100755
--- a/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/RedisProducer.java
+++ b/components/camel-spring-redis/src/main/java/org/apache/camel/component/redis/RedisProducer.java
@@ -26,6 +26,8 @@ import org.apache.camel.util.URISupport;
public class RedisProducer extends DefaultProducer {
private final RedisClient redisClient;
+ private transient String redisProducerToString;
+
public RedisProducer(RedisEndpoint endpoint, RedisConfiguration configuration) {
super(endpoint);
redisClient = new RedisClient(configuration.getRedisTemplate());
@@ -46,6 +48,9 @@ public class RedisProducer extends DefaultProducer {
@Override
public String toString() {
- return "RedisProducer[" + URISupport.sanitizeUri(getEndpoint().getEndpointUri()) + "]";
+ if (redisProducerToString == null) {
+ redisProducerToString = "RedisProducer[" + URISupport.sanitizeUri(getEndpoint().getEndpointUri()) + "]";
+ }
+ return redisProducerToString;
}
}