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 2017/06/22 10:47:01 UTC

[1/3] camel git commit: Camel-Caffeine: A bit more docs

Repository: camel
Updated Branches:
  refs/heads/master 1c712e6ab -> 7f8456a18


Camel-Caffeine: A bit more docs


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

Branch: refs/heads/master
Commit: 7e7897abb941dc42a88e468e01acec4ed94ae538
Parents: ffe1edf
Author: Andrea Cosentino <an...@gmail.com>
Authored: Thu Jun 22 11:13:45 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Jun 22 12:28:03 2017 +0200

----------------------------------------------------------------------
 .../camel/component/caffeine/cache/CaffeineCacheEndpoint.java     | 3 +++
 .../camel/component/caffeine/load/CaffeineLoadCacheEndpoint.java  | 3 +++
 2 files changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7e7897ab/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/cache/CaffeineCacheEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/cache/CaffeineCacheEndpoint.java b/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/cache/CaffeineCacheEndpoint.java
index 5f3169f..1ff90eb 100644
--- a/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/cache/CaffeineCacheEndpoint.java
+++ b/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/cache/CaffeineCacheEndpoint.java
@@ -33,6 +33,9 @@ import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriPath;
 import org.apache.camel.util.ObjectHelper;
 
+/**
+ * The caffeine-cache component is used for integration with Caffeine Cache.
+ */
 @UriEndpoint(firstVersion = "2.20.0", scheme = "caffeine-cache", title = "Caffeine Cache", syntax = "caffeine-cache:cacheName", label = "cache,datagrid,clustering")
 public class CaffeineCacheEndpoint extends DefaultEndpoint {
     @UriPath(description = "the cache name")

http://git-wip-us.apache.org/repos/asf/camel/blob/7e7897ab/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheEndpoint.java b/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheEndpoint.java
index 6edd5eb..ea9da27 100644
--- a/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheEndpoint.java
+++ b/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheEndpoint.java
@@ -33,6 +33,9 @@ import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriPath;
 import org.apache.camel.util.ObjectHelper;
 
+/**
+ * The caffeine-loadcache component is used for integration with Caffeine Load Cache.
+ */
 @UriEndpoint(firstVersion = "2.20.0", scheme = "caffeine-loadcache", title = "Caffeine LoadCache", syntax = "caffeine-loadcache:cacheName", label = "cache,datagrid,clustering")
 public class CaffeineLoadCacheEndpoint extends DefaultEndpoint {
     @UriPath(description = "the cache name")


[2/3] camel git commit: CAMEL-11435 - Camel-Caffeine: Support Time-based and size-based eviction in Caffeine

Posted by ac...@apache.org.
CAMEL-11435 - Camel-Caffeine: Support Time-based and size-based eviction in Caffeine


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

Branch: refs/heads/master
Commit: ffe1edf3bb339e7a574eab40be2054ee41383d31
Parents: 1c712e6
Author: Andrea Cosentino <an...@gmail.com>
Authored: Thu Jun 22 11:07:44 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Jun 22 12:28:03 2017 +0200

----------------------------------------------------------------------
 .../src/main/docs/caffeine-cache-component.adoc |  5 +-
 .../main/docs/caffeine-loadcache-component.adoc |  5 +-
 .../caffeine/CaffeineConfiguration.java         | 40 ++++++++++++++++
 .../camel/component/caffeine/EvictionType.java  | 49 ++++++++++++++++++++
 .../caffeine/cache/CaffeineCacheEndpoint.java   | 12 ++++-
 .../load/CaffeineLoadCacheEndpoint.java         | 12 ++++-
 .../CaffeineCacheComponentConfiguration.java    | 40 ++++++++++++++++
 ...CaffeineLoadCacheComponentConfiguration.java | 40 ++++++++++++++++
 8 files changed, 197 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/ffe1edf3/components/camel-caffeine/src/main/docs/caffeine-cache-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-caffeine/src/main/docs/caffeine-cache-component.adoc b/components/camel-caffeine/src/main/docs/caffeine-cache-component.adoc
index d1a95df..de0dfdd 100644
--- a/components/camel-caffeine/src/main/docs/caffeine-cache-component.adoc
+++ b/components/camel-caffeine/src/main/docs/caffeine-cache-component.adoc
@@ -61,7 +61,7 @@ with the following path and query parameters:
 | **cacheName** | *Required* the cache name |  | String
 |=======================================================================
 
-#### Query Parameters (14 parameters):
+#### Query Parameters (17 parameters):
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |=======================================================================
@@ -73,6 +73,9 @@ with the following path and query parameters:
 | **action** (producer) | To configure the default cache action. If an action is set in the message header then the operation from the header takes precedence. |  | String
 | **cache** (producer) | To configure the default an already instantianted cache to be used |  | Cache
 | **cacheLoader** (producer) | To configure a CacheLoader in case of a LoadCache use |  | CacheLoader
+| **evictionType** (producer) | Set the eviction Type for this cache | size_based | EvictionType
+| **expireAfterAccessTime** (producer) | Set the expire After Access Time in case of time based Eviction (in seconds) | 300 | int
+| **expireAfterWriteTime** (producer) | Set the expire After Access Write in case of time based Eviction (in seconds) | 300 | int
 | **initialCapacity** (producer) | Set the initial Capacity for the cache | 10000 | int
 | **key** (producer) | To configure the default action key. If a key is set in the message header then the key from the header takes precedence. |  | Object
 | **maximumSize** (producer) | Set the maximum size for the cache | 10000 | int

http://git-wip-us.apache.org/repos/asf/camel/blob/ffe1edf3/components/camel-caffeine/src/main/docs/caffeine-loadcache-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-caffeine/src/main/docs/caffeine-loadcache-component.adoc b/components/camel-caffeine/src/main/docs/caffeine-loadcache-component.adoc
index 1acb9fa..a13c1ea 100644
--- a/components/camel-caffeine/src/main/docs/caffeine-loadcache-component.adoc
+++ b/components/camel-caffeine/src/main/docs/caffeine-loadcache-component.adoc
@@ -61,7 +61,7 @@ with the following path and query parameters:
 | **cacheName** | *Required* the cache name |  | String
 |=======================================================================
 
-#### Query Parameters (14 parameters):
+#### Query Parameters (17 parameters):
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |=======================================================================
@@ -73,6 +73,9 @@ with the following path and query parameters:
 | **action** (producer) | To configure the default cache action. If an action is set in the message header then the operation from the header takes precedence. |  | String
 | **cache** (producer) | To configure the default an already instantianted cache to be used |  | Cache
 | **cacheLoader** (producer) | To configure a CacheLoader in case of a LoadCache use |  | CacheLoader
+| **evictionType** (producer) | Set the eviction Type for this cache | size_based | EvictionType
+| **expireAfterAccessTime** (producer) | Set the expire After Access Time in case of time based Eviction (in seconds) | 300 | int
+| **expireAfterWriteTime** (producer) | Set the expire After Access Write in case of time based Eviction (in seconds) | 300 | int
 | **initialCapacity** (producer) | Set the initial Capacity for the cache | 10000 | int
 | **key** (producer) | To configure the default action key. If a key is set in the message header then the key from the header takes precedence. |  | Object
 | **maximumSize** (producer) | Set the maximum size for the cache | 10000 | int

http://git-wip-us.apache.org/repos/asf/camel/blob/ffe1edf3/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/CaffeineConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/CaffeineConfiguration.java b/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/CaffeineConfiguration.java
index ccfd1d2..2820491 100644
--- a/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/CaffeineConfiguration.java
+++ b/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/CaffeineConfiguration.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.caffeine;
 
 import com.github.benmanes.caffeine.cache.Cache;
 import com.github.benmanes.caffeine.cache.CacheLoader;
+import com.github.benmanes.caffeine.cache.Expiry;
 
 import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.spi.UriParam;
@@ -45,6 +46,12 @@ public class CaffeineConfiguration implements Cloneable {
     private int initialCapacity = 10000;
     @UriParam(label = "producer", defaultValue = "10000")
     private int maximumSize = 10000;
+    @UriParam(label = "producer", defaultValue = "size_based")
+    private EvictionType evictionType = EvictionType.SIZE_BASED;
+    @UriParam(label = "producer", defaultValue = "300")
+    private int expireAfterAccessTime = 300;
+    @UriParam(label = "producer", defaultValue = "300")
+    private int expireAfterWriteTime = 300;
 
     public CaffeineConfiguration() {
     }
@@ -162,6 +169,39 @@ public class CaffeineConfiguration implements Cloneable {
         this.maximumSize = maximumSize;
     }
 
+    public EvictionType getEvictionType() {
+        return evictionType;
+    }
+
+    /**
+     * Set the eviction Type for this cache
+     */
+    public void setEvictionType(EvictionType evictionType) {
+        this.evictionType = evictionType;
+    }
+
+    public int getExpireAfterAccessTime() {
+        return expireAfterAccessTime;
+    }
+
+    /**
+     * Set the expire After Access Time in case of time based Eviction (in seconds)
+     */
+    public void setExpireAfterAccessTime(int expireAfterAccessTime) {
+        this.expireAfterAccessTime = expireAfterAccessTime;
+    }
+
+    public int getExpireAfterWriteTime() {
+        return expireAfterWriteTime;
+    }
+
+    /**
+     * Set the expire After Access Write in case of time based Eviction (in seconds)
+     */
+    public void setExpireAfterWriteTime(int expireAfterWriteTime) {
+        this.expireAfterWriteTime = expireAfterWriteTime;
+    }
+
     // ****************************
     // Cloneable
     // ****************************

http://git-wip-us.apache.org/repos/asf/camel/blob/ffe1edf3/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/EvictionType.java
----------------------------------------------------------------------
diff --git a/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/EvictionType.java b/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/EvictionType.java
new file mode 100644
index 0000000..aebe5a8
--- /dev/null
+++ b/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/EvictionType.java
@@ -0,0 +1,49 @@
+/**
+ * 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.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (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
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.caffeine;
+
+public enum EvictionType {
+
+    // type
+    SIZE_BASED("size_based"),
+    TIME_BASED("time_based");
+
+
+    private static EvictionType[] values = values();
+    private final String type;
+
+    EvictionType(String type) {
+        this.type = type;
+    }
+
+    public static EvictionType getEvictionType(String name) {
+        if (name == null) {
+            return null;
+        }
+        for (EvictionType evictionType : values) {
+            if (evictionType.toString().equalsIgnoreCase(name) || evictionType.name().equalsIgnoreCase(name)) {
+                return evictionType;
+            }
+        }
+        throw new IllegalArgumentException(String.format("Eviction type '%s' is not supported by this component.", name));
+    }
+
+    public String toString() {
+        return type;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/ffe1edf3/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/cache/CaffeineCacheEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/cache/CaffeineCacheEndpoint.java b/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/cache/CaffeineCacheEndpoint.java
index 00891a1..5f3169f 100644
--- a/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/cache/CaffeineCacheEndpoint.java
+++ b/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/cache/CaffeineCacheEndpoint.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.caffeine.cache;
 
+import java.util.concurrent.TimeUnit;
+
 import com.github.benmanes.caffeine.cache.Cache;
 import com.github.benmanes.caffeine.cache.Caffeine;
 
@@ -23,6 +25,7 @@ import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import org.apache.camel.component.caffeine.CaffeineConfiguration;
+import org.apache.camel.component.caffeine.EvictionType;
 import org.apache.camel.impl.DefaultEndpoint;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriEndpoint;
@@ -63,8 +66,13 @@ public class CaffeineCacheEndpoint extends DefaultEndpoint {
             cache = configuration.getCache();
         } else {
             Caffeine<Object, Object> builder = Caffeine.newBuilder();
-            builder.initialCapacity(configuration.getInitialCapacity());
-            builder.maximumSize(configuration.getMaximumSize());
+            if (configuration.getEvictionType() == EvictionType.SIZE_BASED) {
+                builder.initialCapacity(configuration.getInitialCapacity());
+                builder.maximumSize(configuration.getMaximumSize());
+            } else if (configuration.getEvictionType() == EvictionType.TIME_BASED) {
+                builder.expireAfterAccess(configuration.getExpireAfterAccessTime(), TimeUnit.SECONDS);
+                builder.expireAfterAccess(configuration.getExpireAfterWriteTime(), TimeUnit.SECONDS);
+            }
             if (configuration.isStatsEnabled()) {
                 builder.recordStats();
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/ffe1edf3/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheEndpoint.java b/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheEndpoint.java
index 7cf27ce..6edd5eb 100644
--- a/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheEndpoint.java
+++ b/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/load/CaffeineLoadCacheEndpoint.java
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.caffeine.load;
 
+import java.util.concurrent.TimeUnit;
+
 import com.github.benmanes.caffeine.cache.Caffeine;
 import com.github.benmanes.caffeine.cache.LoadingCache;
 
@@ -23,6 +25,7 @@ import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import org.apache.camel.component.caffeine.CaffeineConfiguration;
+import org.apache.camel.component.caffeine.EvictionType;
 import org.apache.camel.impl.DefaultEndpoint;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriEndpoint;
@@ -63,8 +66,13 @@ public class CaffeineLoadCacheEndpoint extends DefaultEndpoint {
             cache = (LoadingCache)configuration.getCache();
         } else {
             Caffeine<Object, Object> builder = Caffeine.newBuilder();
-            builder.initialCapacity(configuration.getInitialCapacity());
-            builder.maximumSize(configuration.getMaximumSize());
+            if (configuration.getEvictionType() == EvictionType.SIZE_BASED) {
+                builder.initialCapacity(configuration.getInitialCapacity());
+                builder.maximumSize(configuration.getMaximumSize());
+            } else if (configuration.getEvictionType() == EvictionType.TIME_BASED) {
+                builder.expireAfterAccess(configuration.getExpireAfterAccessTime(), TimeUnit.SECONDS);
+                builder.expireAfterAccess(configuration.getExpireAfterWriteTime(), TimeUnit.SECONDS);
+            }
             if (configuration.isStatsEnabled()) {
                 builder.recordStats();
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/ffe1edf3/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/cache/springboot/CaffeineCacheComponentConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/cache/springboot/CaffeineCacheComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/cache/springboot/CaffeineCacheComponentConfiguration.java
index 1d43dad..f4b73de 100644
--- a/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/cache/springboot/CaffeineCacheComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/cache/springboot/CaffeineCacheComponentConfiguration.java
@@ -19,6 +19,8 @@ package org.apache.camel.component.caffeine.cache.springboot;
 import javax.annotation.Generated;
 import com.github.benmanes.caffeine.cache.Cache;
 import com.github.benmanes.caffeine.cache.CacheLoader;
+import org.apache.camel.component.caffeine.EvictionType;
+import org.apache.camel.component.caffeine.cache.CaffeineCacheComponent;
 import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 
@@ -107,6 +109,20 @@ public class CaffeineCacheComponentConfiguration
          * Set the maximum size for the cache
          */
         private Integer maximumSize = 10000;
+        /**
+         * Set the eviction Type for this cache
+         */
+        private EvictionType evictionType = EvictionType.size_based;
+        /**
+         * Set the expire After Access Time in case of time based Eviction (in
+         * seconds)
+         */
+        private Integer expireAfterAccessTime = 300;
+        /**
+         * Set the expire After Access Write in case of time based Eviction (in
+         * seconds)
+         */
+        private Integer expireAfterWriteTime = 300;
 
         public Boolean getCreateCacheIfNotExist() {
             return createCacheIfNotExist;
@@ -187,5 +203,29 @@ public class CaffeineCacheComponentConfiguration
         public void setMaximumSize(Integer maximumSize) {
             this.maximumSize = maximumSize;
         }
+
+        public EvictionType getEvictionType() {
+            return evictionType;
+        }
+
+        public void setEvictionType(EvictionType evictionType) {
+            this.evictionType = evictionType;
+        }
+
+        public Integer getExpireAfterAccessTime() {
+            return expireAfterAccessTime;
+        }
+
+        public void setExpireAfterAccessTime(Integer expireAfterAccessTime) {
+            this.expireAfterAccessTime = expireAfterAccessTime;
+        }
+
+        public Integer getExpireAfterWriteTime() {
+            return expireAfterWriteTime;
+        }
+
+        public void setExpireAfterWriteTime(Integer expireAfterWriteTime) {
+            this.expireAfterWriteTime = expireAfterWriteTime;
+        }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/ffe1edf3/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/load/springboot/CaffeineLoadCacheComponentConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/load/springboot/CaffeineLoadCacheComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/load/springboot/CaffeineLoadCacheComponentConfiguration.java
index 426e9a6..e024b9b 100644
--- a/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/load/springboot/CaffeineLoadCacheComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/load/springboot/CaffeineLoadCacheComponentConfiguration.java
@@ -19,6 +19,8 @@ package org.apache.camel.component.caffeine.load.springboot;
 import javax.annotation.Generated;
 import com.github.benmanes.caffeine.cache.Cache;
 import com.github.benmanes.caffeine.cache.CacheLoader;
+import org.apache.camel.component.caffeine.EvictionType;
+import org.apache.camel.component.caffeine.load.CaffeineLoadCacheComponent;
 import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 
@@ -107,6 +109,20 @@ public class CaffeineLoadCacheComponentConfiguration
          * Set the maximum size for the cache
          */
         private Integer maximumSize = 10000;
+        /**
+         * Set the eviction Type for this cache
+         */
+        private EvictionType evictionType = EvictionType.size_based;
+        /**
+         * Set the expire After Access Time in case of time based Eviction (in
+         * seconds)
+         */
+        private Integer expireAfterAccessTime = 300;
+        /**
+         * Set the expire After Access Write in case of time based Eviction (in
+         * seconds)
+         */
+        private Integer expireAfterWriteTime = 300;
 
         public Boolean getCreateCacheIfNotExist() {
             return createCacheIfNotExist;
@@ -187,5 +203,29 @@ public class CaffeineLoadCacheComponentConfiguration
         public void setMaximumSize(Integer maximumSize) {
             this.maximumSize = maximumSize;
         }
+
+        public EvictionType getEvictionType() {
+            return evictionType;
+        }
+
+        public void setEvictionType(EvictionType evictionType) {
+            this.evictionType = evictionType;
+        }
+
+        public Integer getExpireAfterAccessTime() {
+            return expireAfterAccessTime;
+        }
+
+        public void setExpireAfterAccessTime(Integer expireAfterAccessTime) {
+            this.expireAfterAccessTime = expireAfterAccessTime;
+        }
+
+        public Integer getExpireAfterWriteTime() {
+            return expireAfterWriteTime;
+        }
+
+        public void setExpireAfterWriteTime(Integer expireAfterWriteTime) {
+            this.expireAfterWriteTime = expireAfterWriteTime;
+        }
     }
 }
\ No newline at end of file


[3/3] camel git commit: CAMEL-11435 - Fix defaultValue for EvictionType to make it work with camel-caffeine-starter

Posted by ac...@apache.org.
CAMEL-11435 - Fix defaultValue for EvictionType to make it work with camel-caffeine-starter


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

Branch: refs/heads/master
Commit: 7f8456a18fc071cbe37530dcde6174806001eedd
Parents: 7e7897a
Author: Andrea Cosentino <an...@gmail.com>
Authored: Thu Jun 22 11:46:18 2017 +0200
Committer: Andrea Cosentino <an...@gmail.com>
Committed: Thu Jun 22 12:28:04 2017 +0200

----------------------------------------------------------------------
 .../camel-caffeine/src/main/docs/caffeine-cache-component.adoc  | 2 +-
 .../src/main/docs/caffeine-loadcache-component.adoc             | 2 +-
 .../apache/camel/component/caffeine/CaffeineConfiguration.java  | 2 +-
 components/readme.adoc                                          | 4 ++--
 .../cache/springboot/CaffeineCacheComponentConfiguration.java   | 4 ++--
 .../springboot/CaffeineLoadCacheComponentConfiguration.java     | 5 +++--
 6 files changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7f8456a1/components/camel-caffeine/src/main/docs/caffeine-cache-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-caffeine/src/main/docs/caffeine-cache-component.adoc b/components/camel-caffeine/src/main/docs/caffeine-cache-component.adoc
index de0dfdd..9119b3f 100644
--- a/components/camel-caffeine/src/main/docs/caffeine-cache-component.adoc
+++ b/components/camel-caffeine/src/main/docs/caffeine-cache-component.adoc
@@ -73,7 +73,7 @@ with the following path and query parameters:
 | **action** (producer) | To configure the default cache action. If an action is set in the message header then the operation from the header takes precedence. |  | String
 | **cache** (producer) | To configure the default an already instantianted cache to be used |  | Cache
 | **cacheLoader** (producer) | To configure a CacheLoader in case of a LoadCache use |  | CacheLoader
-| **evictionType** (producer) | Set the eviction Type for this cache | size_based | EvictionType
+| **evictionType** (producer) | Set the eviction Type for this cache | SIZE_BASED | EvictionType
 | **expireAfterAccessTime** (producer) | Set the expire After Access Time in case of time based Eviction (in seconds) | 300 | int
 | **expireAfterWriteTime** (producer) | Set the expire After Access Write in case of time based Eviction (in seconds) | 300 | int
 | **initialCapacity** (producer) | Set the initial Capacity for the cache | 10000 | int

http://git-wip-us.apache.org/repos/asf/camel/blob/7f8456a1/components/camel-caffeine/src/main/docs/caffeine-loadcache-component.adoc
----------------------------------------------------------------------
diff --git a/components/camel-caffeine/src/main/docs/caffeine-loadcache-component.adoc b/components/camel-caffeine/src/main/docs/caffeine-loadcache-component.adoc
index a13c1ea..5abef6e 100644
--- a/components/camel-caffeine/src/main/docs/caffeine-loadcache-component.adoc
+++ b/components/camel-caffeine/src/main/docs/caffeine-loadcache-component.adoc
@@ -73,7 +73,7 @@ with the following path and query parameters:
 | **action** (producer) | To configure the default cache action. If an action is set in the message header then the operation from the header takes precedence. |  | String
 | **cache** (producer) | To configure the default an already instantianted cache to be used |  | Cache
 | **cacheLoader** (producer) | To configure a CacheLoader in case of a LoadCache use |  | CacheLoader
-| **evictionType** (producer) | Set the eviction Type for this cache | size_based | EvictionType
+| **evictionType** (producer) | Set the eviction Type for this cache | SIZE_BASED | EvictionType
 | **expireAfterAccessTime** (producer) | Set the expire After Access Time in case of time based Eviction (in seconds) | 300 | int
 | **expireAfterWriteTime** (producer) | Set the expire After Access Write in case of time based Eviction (in seconds) | 300 | int
 | **initialCapacity** (producer) | Set the initial Capacity for the cache | 10000 | int

http://git-wip-us.apache.org/repos/asf/camel/blob/7f8456a1/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/CaffeineConfiguration.java
----------------------------------------------------------------------
diff --git a/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/CaffeineConfiguration.java b/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/CaffeineConfiguration.java
index 2820491..fdf6d84 100644
--- a/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/CaffeineConfiguration.java
+++ b/components/camel-caffeine/src/main/java/org/apache/camel/component/caffeine/CaffeineConfiguration.java
@@ -46,7 +46,7 @@ public class CaffeineConfiguration implements Cloneable {
     private int initialCapacity = 10000;
     @UriParam(label = "producer", defaultValue = "10000")
     private int maximumSize = 10000;
-    @UriParam(label = "producer", defaultValue = "size_based")
+    @UriParam(label = "producer", defaultValue = "SIZE_BASED")
     private EvictionType evictionType = EvictionType.SIZE_BASED;
     @UriParam(label = "producer", defaultValue = "300")
     private int expireAfterAccessTime = 300;

http://git-wip-us.apache.org/repos/asf/camel/blob/7f8456a1/components/readme.adoc
----------------------------------------------------------------------
diff --git a/components/readme.adoc b/components/readme.adoc
index 4acb59e..6e739af 100644
--- a/components/readme.adoc
+++ b/components/readme.adoc
@@ -126,10 +126,10 @@ Number of Components: 274 in 188 JAR artifacts (17 deprecated)
 `browse:name` | 1.3 | The browse component is used for viewing the messages received on endpoints that supports BrowsableEndpoint.
 
 | link:camel-caffeine/src/main/docs/caffeine-cache-component.adoc[Caffeine Cache] (camel-caffeine) +
-`caffeine-cache:cacheName` | 2.20 | Camel Caffeine support
+`caffeine-cache:cacheName` | 2.20 | The caffeine-cache component is used for integration with Caffeine Cache.
 
 | link:camel-caffeine/src/main/docs/caffeine-loadcache-component.adoc[Caffeine LoadCache] (camel-caffeine) +
-`caffeine-loadcache:cacheName` | 2.20 | Camel Caffeine support
+`caffeine-loadcache:cacheName` | 2.20 | The caffeine-loadcache component is used for integration with Caffeine Load Cache.
 
 | link:camel-context/src/main/docs/context-component.adoc[Camel Context] (camel-context) +
 `context:contextId:localEndpointUrl` | 2.7 | *deprecated* The context component allows to send/receive messages between Camel routes in a black box way.

http://git-wip-us.apache.org/repos/asf/camel/blob/7f8456a1/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/cache/springboot/CaffeineCacheComponentConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/cache/springboot/CaffeineCacheComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/cache/springboot/CaffeineCacheComponentConfiguration.java
index f4b73de..155551c 100644
--- a/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/cache/springboot/CaffeineCacheComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/cache/springboot/CaffeineCacheComponentConfiguration.java
@@ -25,7 +25,7 @@ import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 
 /**
- * Camel Caffeine support
+ * The caffeine-cache component is used for integration with Caffeine Cache.
  * 
  * Generated by camel-package-maven-plugin - do not edit this file!
  */
@@ -112,7 +112,7 @@ public class CaffeineCacheComponentConfiguration
         /**
          * Set the eviction Type for this cache
          */
-        private EvictionType evictionType = EvictionType.size_based;
+        private EvictionType evictionType = EvictionType.SIZE_BASED;
         /**
          * Set the expire After Access Time in case of time based Eviction (in
          * seconds)

http://git-wip-us.apache.org/repos/asf/camel/blob/7f8456a1/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/load/springboot/CaffeineLoadCacheComponentConfiguration.java
----------------------------------------------------------------------
diff --git a/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/load/springboot/CaffeineLoadCacheComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/load/springboot/CaffeineLoadCacheComponentConfiguration.java
index e024b9b..9d39e35 100644
--- a/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/load/springboot/CaffeineLoadCacheComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-caffeine-starter/src/main/java/org/apache/camel/component/caffeine/load/springboot/CaffeineLoadCacheComponentConfiguration.java
@@ -25,7 +25,8 @@ import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 
 /**
- * Camel Caffeine support
+ * The caffeine-loadcache component is used for integration with Caffeine Load
+ * Cache.
  * 
  * Generated by camel-package-maven-plugin - do not edit this file!
  */
@@ -112,7 +113,7 @@ public class CaffeineLoadCacheComponentConfiguration
         /**
          * Set the eviction Type for this cache
          */
-        private EvictionType evictionType = EvictionType.size_based;
+        private EvictionType evictionType = EvictionType.SIZE_BASED;
         /**
          * Set the expire After Access Time in case of time based Eviction (in
          * seconds)