This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 763d0cb6ba47a71b392a7b9e8494480660a7fa83 Author: Claus Ibsen <[email protected]> AuthorDate: Thu Jan 12 12:00:45 2023 +0100 Remove camel-caffeine-lrucache in v4 --- apache-camel/pom.xml | 4 - bom/camel-bom/pom.xml | 5 - catalog/camel-allcomponents/pom.xml | 5 - .../camel/catalog/others/caffeine-lrucache.json | 16 -- components/camel-caffeine-lrucache/pom.xml | 72 ----- .../services/org/apache/camel/lru-cache-factory | 2 - .../services/org/apache/camel/other.properties | 7 - .../src/generated/resources/caffeine-lrucache.json | 16 -- .../src/main/docs/caffeine-lrucache.adoc | 42 --- .../caffeine/lrucache/CaffeineLRUCache.java | 308 --------------------- .../caffeine/lrucache/CaffeineLRUCacheFactory.java | 217 --------------- .../caffeine/lrucache/CaffeineLRUSoftCache.java | 76 ----- .../caffeine/lrucache/CaffeineLRUWeakCache.java | 76 ----- .../caffeine/lrucache/CaffeineLRUCacheTest.java | 170 ------------ .../lrucache/CaffeineLRUSoftCacheTest.java | 200 ------------- .../src/test/resources/log4j2.properties | 31 --- components/pom.xml | 1 - .../ROOT/pages/camel-4-migration-guide.adoc | 22 +- parent/pom.xml | 5 - 19 files changed, 8 insertions(+), 1267 deletions(-) diff --git a/apache-camel/pom.xml b/apache-camel/pom.xml index ca92b773d6a..86925e7c725 100644 --- a/apache-camel/pom.xml +++ b/apache-camel/pom.xml @@ -124,10 +124,6 @@ <groupId>org.apache.camel</groupId> <artifactId>camel-headersmap</artifactId> </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-caffeine-lrucache</artifactId> - </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-xml-jaxp</artifactId> diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml index f45d3a81434..5e4fa6c7294 100644 --- a/bom/camel-bom/pom.xml +++ b/bom/camel-bom/pom.xml @@ -346,11 +346,6 @@ <artifactId>camel-caffeine</artifactId> <version>${project.version}</version> </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-caffeine-lrucache</artifactId> - <version>${project.version}</version> - </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-cassandraql</artifactId> diff --git a/catalog/camel-allcomponents/pom.xml b/catalog/camel-allcomponents/pom.xml index 8ca037981a7..b2ac535955e 100644 --- a/catalog/camel-allcomponents/pom.xml +++ b/catalog/camel-allcomponents/pom.xml @@ -313,11 +313,6 @@ <artifactId>camel-caffeine</artifactId> <version>${project.version}</version> </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-caffeine-lrucache</artifactId> - <version>${project.version}</version> - </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-cassandraql</artifactId> diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others/caffeine-lrucache.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others/caffeine-lrucache.json deleted file mode 100644 index 5792360bbd7..00000000000 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others/caffeine-lrucache.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "other": { - "kind": "other", - "name": "caffeine-lrucache", - "title": "Caffeine Lrucache", - "description": "Camel Caffeine LRUCache support", - "deprecated": true, - "deprecatedSince": "3.8.0", - "firstVersion": "3.0", - "label": "core", - "supportLevel": "Stable", - "groupId": "org.apache.camel", - "artifactId": "camel-caffeine-lrucache", - "version": "4.0.0-SNAPSHOT" - } -} diff --git a/components/camel-caffeine-lrucache/pom.xml b/components/camel-caffeine-lrucache/pom.xml deleted file mode 100644 index 805c86d54dc..00000000000 --- a/components/camel-caffeine-lrucache/pom.xml +++ /dev/null @@ -1,72 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.apache.camel</groupId> - <artifactId>components</artifactId> - <version>4.0.0-SNAPSHOT</version> - </parent> - - <artifactId>camel-caffeine-lrucache</artifactId> - <packaging>jar</packaging> - <name>Camel :: Caffeine LRUCache (deprecated)</name> - <description>Camel Caffeine LRUCache support</description> - - <properties> - <firstVersion>3.0</firstVersion> - <label>core</label> - <deprecatedSince>3.8.0</deprecatedSince> - </properties> - - <dependencies> - - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-support</artifactId> - </dependency> - - <dependency> - <groupId>com.github.ben-manes.caffeine</groupId> - <artifactId>caffeine</artifactId> - <version>${caffeine-version}</version> - </dependency> - - <!-- testing --> - <dependency> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-jupiter</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-slf4j-impl</artifactId> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <plugins> - </plugins> - </build> - -</project> diff --git a/components/camel-caffeine-lrucache/src/generated/resources/META-INF/services/org/apache/camel/lru-cache-factory b/components/camel-caffeine-lrucache/src/generated/resources/META-INF/services/org/apache/camel/lru-cache-factory deleted file mode 100644 index 61542191148..00000000000 --- a/components/camel-caffeine-lrucache/src/generated/resources/META-INF/services/org/apache/camel/lru-cache-factory +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by camel build tools - do NOT edit this file! -class=org.apache.camel.component.caffeine.lrucache.CaffeineLRUCacheFactory diff --git a/components/camel-caffeine-lrucache/src/generated/resources/META-INF/services/org/apache/camel/other.properties b/components/camel-caffeine-lrucache/src/generated/resources/META-INF/services/org/apache/camel/other.properties deleted file mode 100644 index a9d046483fa..00000000000 --- a/components/camel-caffeine-lrucache/src/generated/resources/META-INF/services/org/apache/camel/other.properties +++ /dev/null @@ -1,7 +0,0 @@ -# Generated by camel build tools - do NOT edit this file! -name=caffeine-lrucache -groupId=org.apache.camel -artifactId=camel-caffeine-lrucache -version=4.0.0-SNAPSHOT -projectName=Camel :: Caffeine LRUCache (deprecated) -projectDescription=Camel Caffeine LRUCache support diff --git a/components/camel-caffeine-lrucache/src/generated/resources/caffeine-lrucache.json b/components/camel-caffeine-lrucache/src/generated/resources/caffeine-lrucache.json deleted file mode 100644 index 5792360bbd7..00000000000 --- a/components/camel-caffeine-lrucache/src/generated/resources/caffeine-lrucache.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "other": { - "kind": "other", - "name": "caffeine-lrucache", - "title": "Caffeine Lrucache", - "description": "Camel Caffeine LRUCache support", - "deprecated": true, - "deprecatedSince": "3.8.0", - "firstVersion": "3.0", - "label": "core", - "supportLevel": "Stable", - "groupId": "org.apache.camel", - "artifactId": "camel-caffeine-lrucache", - "version": "4.0.0-SNAPSHOT" - } -} diff --git a/components/camel-caffeine-lrucache/src/main/docs/caffeine-lrucache.adoc b/components/camel-caffeine-lrucache/src/main/docs/caffeine-lrucache.adoc deleted file mode 100644 index dcfde5b99b4..00000000000 --- a/components/camel-caffeine-lrucache/src/main/docs/caffeine-lrucache.adoc +++ /dev/null @@ -1,42 +0,0 @@ -= Caffeine Lrucache Component (deprecated) -:doctitle: Caffeine Lrucache -:shortname: caffeine-lrucache -:artifactid: camel-caffeine-lrucache -:description: Camel Caffeine LRUCache support -:since: 3.0 -:supportlevel: Stable-deprecated -:deprecated: *deprecated* -//Manually maintained attributes -:camel-spring-boot-name: caffeine-lrucache - -*Since Camel {since}* - -The Caffeine LRU Cache component enables you to perform caching operations using -the simple cache from Caffeine LRU Cache. - -Maven users will need to add the following dependency to -their `pom.xml` for this component: - -[source,xml] ------------------------------------------------------------- -<dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-caffeine-lrucache</artifactId> - <version>x.x.x</version> - <!-- use the same version as your Camel core version --> -</dependency> ------------------------------------------------------------- - -== Options - -There are no options. -// component-configure options: START -// component-configure options: END - -// component options: START -// component options: END - -// endpoint options: START -// endpoint options: END - -include::spring-boot:partial$starter.adoc[] diff --git a/components/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUCache.java b/components/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUCache.java deleted file mode 100644 index 7b31aedd419..00000000000 --- a/components/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUCache.java +++ /dev/null @@ -1,308 +0,0 @@ -/* - * 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.lrucache; - -import java.io.Serializable; -import java.util.Collection; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.concurrent.ForkJoinPool; -import java.util.concurrent.atomic.LongAdder; -import java.util.function.Consumer; - -import com.github.benmanes.caffeine.cache.Cache; -import com.github.benmanes.caffeine.cache.Caffeine; -import com.github.benmanes.caffeine.cache.RemovalCause; -import com.github.benmanes.caffeine.cache.RemovalListener; -import org.apache.camel.support.LRUCache; -import org.apache.camel.support.LRUCacheFactory; -import org.apache.camel.support.service.ServiceHelper; -import org.apache.camel.util.ObjectHelper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * A cache that uses a near optional LRU Cache. - * <p/> - * The Cache is implemented by Caffeine which provides an - * <a href="https://github.com/ben-manes/caffeine/wiki/Efficiency">efficient cache</a>. - * <p/> - * If this cache stores {@link org.apache.camel.Service} then this implementation will on eviction invoke the - * {@link org.apache.camel.Service#stop()} method, to auto-stop the service. - * <p/> - * Use {@link LRUCacheFactory} to create a new instance (do not use the constructor). - * - * @see LRUCacheFactory - * @see CaffeineLRUSoftCache - * @see CaffeineLRUWeakCache - */ -@Deprecated -public class CaffeineLRUCache<K, V> implements LRUCache<K, V>, RemovalListener<K, V>, Serializable { - private static final Logger LOG = LoggerFactory.getLogger(CaffeineLRUCache.class); - - protected final LongAdder hits = new LongAdder(); - protected final LongAdder misses = new LongAdder(); - protected final LongAdder evicted = new LongAdder(); - - private int maxCacheSize; - private final Cache<K, V> cache; - private final Map<K, V> map; - private final Consumer<V> evict; - - /** - * Constructs an empty <tt>LRUCache</tt> instance with the specified maximumCacheSize, and will stop on eviction. - * - * @param maximumCacheSize the max capacity. - * @throws IllegalArgumentException if the initial capacity is negative - */ - public CaffeineLRUCache(int maximumCacheSize) { - this(16, maximumCacheSize); // 16 is the default initial capacity in ConcurrentLinkedHashMap - } - - /** - * Constructs an empty <tt>LRUCache</tt> instance with the specified initial capacity, maximumCacheSize, and will - * stop on eviction. - * - * @param initialCapacity the initial capacity. - * @param maximumCacheSize the max capacity. - * @throws IllegalArgumentException if the initial capacity is negative - */ - public CaffeineLRUCache(int initialCapacity, int maximumCacheSize) { - //Do not stop service if ConcurrentLinkedHashMap try to evict entry when its max capacity is zero. - this(initialCapacity, maximumCacheSize, maximumCacheSize > 0); - } - - /** - * Constructs an empty <tt>LRUCache</tt> instance with the specified initial capacity, maximumCacheSize,load factor - * and ordering mode. - * - * @param initialCapacity the initial capacity. - * @param maximumCacheSize the max capacity. - * @param stopOnEviction whether to stop service on eviction. - * @throws IllegalArgumentException if the initial capacity is negative - */ - public CaffeineLRUCache(int initialCapacity, int maximumCacheSize, boolean stopOnEviction) { - this(initialCapacity, maximumCacheSize, stopOnEviction, false, false, false); - } - - /** - * Constructs an empty <tt>LRUCache</tt> instance with the specified initial capacity, maximumCacheSize,load factor - * and ordering mode. - * - * @param initialCapacity the initial capacity. - * @param maximumCacheSize the max capacity. - * @param stopOnEviction whether to stop service on eviction. - * @param soft whether to use soft values a soft cache (default is false) - * @param weak whether to use weak keys/values as a weak cache (default is false) - * @param syncListener whether to use synchronous call for the eviction listener (default is false) - * @throws IllegalArgumentException if the initial capacity is negative - */ - public CaffeineLRUCache(int initialCapacity, int maximumCacheSize, boolean stopOnEviction, - boolean soft, boolean weak, boolean syncListener) { - this(initialCapacity, maximumCacheSize, stopOnEviction ? CaffeineLRUCache::doStop : CaffeineLRUCache::doNothing, soft, - weak, syncListener); - } - - /** - * Constructs an empty <tt>LRUCache</tt> instance with the specified initial capacity, maximumCacheSize,load factor - * and ordering mode. - * - * @param initialCapacity the initial capacity. - * @param maximumCacheSize the max capacity. - * @param evict callback for evicted elements - * @param soft whether to use soft values a soft cache (default is false) - * @param weak whether to use weak keys/values as a weak cache (default is false) - * @param syncListener whether to use synchronous call for the eviction listener (default is false) - * @throws IllegalArgumentException if the initial capacity is negative - */ - public CaffeineLRUCache(int initialCapacity, int maximumCacheSize, Consumer<V> evict, - boolean soft, boolean weak, boolean syncListener) { - Caffeine<K, V> caffeine = Caffeine.newBuilder() - .initialCapacity(initialCapacity) - .maximumSize(maximumCacheSize) - .removalListener(this); - - if (soft) { - caffeine.softValues(); - } - if (weak) { - caffeine.weakKeys(); - caffeine.weakValues(); - } - if (syncListener) { - caffeine.executor(Runnable::run); - } else { - // - // by default, caffeine uses {@link ForkJoinPool#commonPool()} if an executor is not - // set which causes troubles in SubstrateVM as the common pool should be created at - // runtime. - // - // https://github.com/quarkusio/quarkus/issues/3300 - // - // As workaround we can wrap it so a reference to the commonPool is not retained by - // caffeine's classes. - // - caffeine.executor(task -> ForkJoinPool.commonPool().execute(task)); - } - - this.cache = caffeine.build(); - this.map = cache.asMap(); - this.maxCacheSize = maximumCacheSize; - this.evict = Objects.requireNonNull(evict); - } - - @Override - public V get(Object o) { - V answer = map.get(o); - if (answer != null) { - hits.increment(); - } else { - misses.increment(); - } - return answer; - } - - @Override - public int size() { - return map.size(); - } - - @Override - public boolean isEmpty() { - return map.isEmpty(); - } - - @Override - public boolean containsKey(Object o) { - return map.containsKey(o); - } - - @Override - public boolean containsValue(Object o) { - return map.containsValue(0); - } - - @Override - public V put(K k, V v) { - return map.put(k, v); - } - - @Override - public V remove(Object o) { - return map.remove(o); - } - - @Override - public void putAll(Map<? extends K, ? extends V> map) { - this.cache.putAll(map); - } - - @Override - public void clear() { - map.clear(); - resetStatistics(); - } - - @Override - public Set<K> keySet() { - return map.keySet(); - } - - @Override - public Collection<V> values() { - return map.values(); - } - - @Override - public Set<Entry<K, V>> entrySet() { - return map.entrySet(); - } - - @Override - public void onRemoval(K key, V value, RemovalCause cause) { - if (cause.wasEvicted()) { - evicted.increment(); - LOG.trace("onRemoval {} -> {}", key, value); - evict.accept(value); - } - } - - /** - * Gets the number of cache hits - */ - @Override - public long getHits() { - return hits.longValue(); - } - - /** - * Gets the number of cache misses. - */ - @Override - public long getMisses() { - return misses.longValue(); - } - - /** - * Gets the number of evicted entries. - */ - @Override - public long getEvicted() { - return evicted.longValue(); - } - - /** - * Returns the maxCacheSize. - */ - @Override - public int getMaxCacheSize() { - return maxCacheSize; - } - - /** - * Rest the cache statistics such as hits and misses. - */ - @Override - public void resetStatistics() { - hits.reset(); - misses.reset(); - evicted.reset(); - } - - @Override - public void cleanUp() { - cache.cleanUp(); - } - - @Override - public String toString() { - return "CaffeineLRUCache@" + ObjectHelper.getIdentityHashCode(this); - } - - static <V> void doNothing(V value) { - } - - static <V> void doStop(V value) { - try { - // stop service as its evicted from cache - ServiceHelper.stopService(value); - } catch (Exception e) { - LOG.warn("Error stopping service: " + value + ". This exception will be ignored.", e); - } - } -} diff --git a/components/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUCacheFactory.java b/components/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUCacheFactory.java deleted file mode 100644 index 7796e297475..00000000000 --- a/components/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUCacheFactory.java +++ /dev/null @@ -1,217 +0,0 @@ -/* - * 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.lrucache; - -import java.util.Map; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.function.Consumer; - -import org.apache.camel.spi.annotations.JdkService; -import org.apache.camel.support.LRUCacheFactory; -import org.apache.camel.util.StopWatch; -import org.apache.camel.util.concurrent.ThreadHelper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Factory to create {@link CaffeineLRUCache} instances. - */ -@Deprecated -@JdkService(LRUCacheFactory.FACTORY) -public final class CaffeineLRUCacheFactory extends LRUCacheFactory { - - private static final Logger LOG = LoggerFactory.getLogger(CaffeineLRUCacheFactory.class); - - private static final AtomicBoolean INIT = new AtomicBoolean(); - - static { - boolean warmUp = "true".equalsIgnoreCase(System.getProperty("CamelWarmUpLRUCacheFactory", "true")); - if (warmUp) { - // warm-up LRUCache which happens in a background thread, which can speedup starting Camel - // as the warm-up can run concurrently with starting up Camel and the runtime container Camel may be running inside - warmUp(); - } - } - - /** - * Warm-up the LRUCache to startup Apache Camel faster. - */ - public static void warmUp() { - // create a dummy map in a separate thread to warm-up the Caffeine cache concurrently - // while Camel is starting up. This allows us to overall startup Camel a bit faster - // as Caffeine takes 150+ millis to initialize. - if (INIT.compareAndSet(false, true)) { - // only need to init Caffeine once in the JVM/classloader - Runnable task = () -> { - StopWatch watch = new StopWatch(); - LOG.debug("Warming up LRUCache ..."); - new CaffeineLRUCache<>(16); - LOG.debug("Warming up LRUCache complete in {} millis", watch.taken()); - }; - - String threadName = ThreadHelper.resolveThreadName(null, "LRUCacheFactory"); - - Thread thread = new Thread(task, threadName); - thread.start(); - } - } - - /** - * Constructs an empty <tt>LRUCache</tt> instance with the specified maximumCacheSize, and will stop on eviction. - * - * @param maximumCacheSize the max capacity. - * @throws IllegalArgumentException if the initial capacity is negative - */ - @Override - public <K, V> Map<K, V> createLRUCache(int maximumCacheSize) { - LOG.trace("Creating LRUCache with maximumCacheSize: {}", maximumCacheSize); - return new CaffeineLRUCache<>(maximumCacheSize); - } - - /** - * Constructs an empty <tt>LRUCache</tt> instance with the specified maximumCacheSize, and will stop on eviction. - * - * @param maximumCacheSize the max capacity. - * @throws IllegalArgumentException if the initial capacity is negative - */ - @Override - public <K, V> Map<K, V> createLRUCache(int maximumCacheSize, Consumer<V> onEvict) { - LOG.trace("Creating LRUCache with maximumCacheSize: {}", maximumCacheSize); - return new CaffeineLRUCache<>(16, maximumCacheSize, onEvict, false, false, false); - } - - /** - * Constructs an empty <tt>LRUCache</tt> instance with the specified initial capacity, maximumCacheSize, and will - * stop on eviction. - * - * @param initialCapacity the initial capacity. - * @param maximumCacheSize the max capacity. - * @throws IllegalArgumentException if the initial capacity is negative - */ - @Override - public <K, V> Map<K, V> createLRUCache(int initialCapacity, int maximumCacheSize) { - LOG.trace("Creating LRUCache with initialCapacity: {}, maximumCacheSize: {}", initialCapacity, maximumCacheSize); - return new CaffeineLRUCache<>(initialCapacity, maximumCacheSize); - } - - /** - * Constructs an empty <tt>LRUCache</tt> instance with the specified initial capacity, maximumCacheSize,load factor - * and ordering mode. - * - * @param initialCapacity the initial capacity. - * @param maximumCacheSize the max capacity. - * @param stopOnEviction whether to stop service on eviction. - * @throws IllegalArgumentException if the initial capacity is negative - */ - @Override - public <K, V> Map<K, V> createLRUCache(int initialCapacity, int maximumCacheSize, boolean stopOnEviction) { - LOG.trace("Creating LRUCache with initialCapacity: {}, maximumCacheSize: {}, stopOnEviction: {}", initialCapacity, - maximumCacheSize, stopOnEviction); - return new CaffeineLRUCache<>(initialCapacity, maximumCacheSize, stopOnEviction); - } - - /** - * Constructs an empty <tt>LRUSoftCache</tt> instance with the specified maximumCacheSize, and will stop on - * eviction. - * - * @param maximumCacheSize the max capacity. - * @throws IllegalArgumentException if the initial capacity is negative - */ - @Override - public <K, V> Map<K, V> createLRUSoftCache(int maximumCacheSize) { - LOG.trace("Creating LRUSoftCache with maximumCacheSize: {}", maximumCacheSize); - return new CaffeineLRUSoftCache<>(maximumCacheSize); - } - - /** - * Constructs an empty <tt>LRUSoftCache</tt> instance with the specified maximumCacheSize, and will stop on - * eviction. - * - * @param initialCapacity the initial capacity. - * @param maximumCacheSize the max capacity. - * @throws IllegalArgumentException if the initial capacity is negative - */ - @Override - public <K, V> Map<K, V> createLRUSoftCache(int initialCapacity, int maximumCacheSize) { - LOG.trace("Creating LRUSoftCache with initialCapacity: {}, maximumCacheSize: {}", initialCapacity, maximumCacheSize); - return new CaffeineLRUSoftCache<>(initialCapacity, maximumCacheSize); - } - - /** - * Constructs an empty <tt>LRUSoftCache</tt> instance with the specified maximumCacheSize, and will stop on - * eviction. - * - * @param initialCapacity the initial capacity. - * @param maximumCacheSize the max capacity. - * @param stopOnEviction whether to stop service on eviction. - * @throws IllegalArgumentException if the initial capacity is negative - */ - @Override - public <K, V> Map<K, V> createLRUSoftCache(int initialCapacity, int maximumCacheSize, boolean stopOnEviction) { - LOG.trace("Creating LRUSoftCache with initialCapacity: {}, maximumCacheSize: {}, stopOnEviction: {}", initialCapacity, - maximumCacheSize, stopOnEviction); - return new CaffeineLRUSoftCache<>(initialCapacity, maximumCacheSize, stopOnEviction); - } - - /** - * Constructs an empty <tt>LRUWeakCache</tt> instance with the specified maximumCacheSize, and will stop on - * eviction. - * - * @param maximumCacheSize the max capacity. - * @throws IllegalArgumentException if the initial capacity is negative - */ - @Override - public <K, V> Map<K, V> createLRUWeakCache(int maximumCacheSize) { - LOG.trace("Creating LRUWeakCache with maximumCacheSize: {}", maximumCacheSize); - return new CaffeineLRUWeakCache<>(maximumCacheSize); - } - - /** - * Constructs an empty <tt>LRUWeakCache</tt> instance with the specified maximumCacheSize, and will stop on - * eviction. - * - * @param initialCapacity the initial capacity. - * @param maximumCacheSize the max capacity. - * @throws IllegalArgumentException if the initial capacity is negative - */ - @Override - public <K, V> Map<K, V> createLRUWeakCache(int initialCapacity, int maximumCacheSize) { - LOG.trace("Creating LRUWeakCache with initialCapacity: {}, maximumCacheSize: {}", initialCapacity, maximumCacheSize); - return new CaffeineLRUWeakCache<>(initialCapacity, maximumCacheSize); - } - - /** - * Constructs an empty <tt>LRUWeakCache</tt> instance with the specified maximumCacheSize, and will stop on - * eviction. - * - * @param initialCapacity the initial capacity. - * @param maximumCacheSize the max capacity. - * @param stopOnEviction whether to stop service on eviction. - * @throws IllegalArgumentException if the initial capacity is negative - */ - @Override - public <K, V> Map<K, V> createLRUWeakCache(int initialCapacity, int maximumCacheSize, boolean stopOnEviction) { - LOG.trace("Creating LRUWeakCache with initialCapacity: {}, maximumCacheSize: {}, stopOnEviction: {}", initialCapacity, - maximumCacheSize, stopOnEviction); - return new CaffeineLRUWeakCache<>(initialCapacity, maximumCacheSize, stopOnEviction); - } - - @Override - public String toString() { - return "camel-caffeine-lrucache"; - } -} diff --git a/components/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUSoftCache.java b/components/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUSoftCache.java deleted file mode 100644 index f1213f7e727..00000000000 --- a/components/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUSoftCache.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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.lrucache; - -import org.apache.camel.util.ObjectHelper; - -/** - * A cache that uses a near optional LRU Cache using {@link java.lang.ref.SoftReference}. - * <p/> - * The Cache is implemented by Caffeine which provides an - * <a href="https://github.com/ben-manes/caffeine/wiki/Efficiency">efficient cache</a>. - * <p/> - * This implementation uses {@link java.lang.ref.SoftReference} for stored values in the cache, to support the JVM when - * it wants to reclaim objects when it's running out of memory. Therefore this implementation does not support - * <b>all</b> the {@link java.util.Map} methods. - * <p/> - * <b>Only</b> methods below should be used: - * <ul> - * <li>containsKey - To determine if the key is in the cache and refers to a value</li> - * <li>entrySet - To return a set of all the entries (as key/value pairs)</li> - * <li>get - To get a value from the cache</li> - * <li>isEmpty - To determine if the cache contains any values</li> - * <li>keySet - To return a set of the current keys which refers to a value</li> - * <li>put - To add a value to the cache</li> - * <li>putAll - To add values to the cache</li> - * <li>remove - To remove a value from the cache by its key</li> - * <li>size - To get the current size</li> - * <li>values - To return a copy of all the value in a list</li> - * </ul> - * <p/> - * The {@link #containsValue(Object)} method should <b>not</b> be used as it's not adjusted to check for the existence - * of a value without catering for the soft references. - * <p/> - * Notice that if the JVM reclaims memory, the content of this cache may be garbage collected without any eviction - * notifications. - * <p/> - * Use {@link org.apache.camel.support.LRUCacheFactory} to create a new instance (do not use the constructor). - * - * @see org.apache.camel.support.LRUCacheFactory - * @see CaffeineLRUCache - * @see CaffeineLRUWeakCache - */ -@Deprecated -public class CaffeineLRUSoftCache<K, V> extends CaffeineLRUCache<K, V> { - - public CaffeineLRUSoftCache(int maximumCacheSize) { - this(16, maximumCacheSize); - } - - public CaffeineLRUSoftCache(int initialCapacity, int maximumCacheSize) { - this(initialCapacity, maximumCacheSize, false); - } - - public CaffeineLRUSoftCache(int initialCapacity, int maximumCacheSize, boolean stopOnEviction) { - super(initialCapacity, maximumCacheSize, stopOnEviction, true, false, false); - } - - @Override - public String toString() { - return "CaffeineLRUSoftCache@" + ObjectHelper.getIdentityHashCode(this); - } -} diff --git a/components/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUWeakCache.java b/components/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUWeakCache.java deleted file mode 100644 index 755e275d28d..00000000000 --- a/components/camel-caffeine-lrucache/src/main/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUWeakCache.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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.lrucache; - -import org.apache.camel.util.ObjectHelper; - -/** - * A cache that uses a near optional LRU Cache using {@link java.lang.ref.WeakReference}. - * <p/> - * The Cache is implemented by Caffeine which provides an - * <a href="https://github.com/ben-manes/caffeine/wiki/Efficiency">efficient cache</a>. - * <p/> - * This implementation uses {@link java.lang.ref.WeakReference} for stored values in the cache, to support the JVM when - * it wants to reclaim objects for example during garbage collection. Therefore this implementation does not support - * <b>all</b> the {@link java.util.Map} methods. - * <p/> - * The following methods is <b>only</b> be be used: - * <ul> - * <li>containsKey - To determine if the key is in the cache and refers to a value</li> - * <li>entrySet - To return a set of all the entries (as key/value paris)</li> - * <li>get - To get a value from the cache</li> - * <li>isEmpty - To determine if the cache contains any values</li> - * <li>keySet - To return a set of the current keys which refers to a value</li> - * <li>put - To add a value to the cache</li> - * <li>putAll - To add values to the cache</li> - * <li>remove - To remove a value from the cache by its key</li> - * <li>size - To get the current size</li> - * <li>values - To return a copy of all the value in a list</li> - * </ul> - * <p/> - * The {@link #containsValue(Object)} method should <b>not</b> be used as it's not adjusted to check for the existence - * of a value without catering for the soft references. - * <p/> - * Notice that if the JVM reclaim memory the content of this cache may be garbage collected, without any eviction - * notifications. - * <p/> - * Use {@link org.apache.camel.support.LRUCacheFactory} to create a new instance (do not use the constructor). - * - * @see org.apache.camel.support.LRUCacheFactory - * @see CaffeineLRUCache - * @see CaffeineLRUSoftCache - */ -@Deprecated -public class CaffeineLRUWeakCache<K, V> extends CaffeineLRUCache<K, V> { - - public CaffeineLRUWeakCache(int maximumCacheSize) { - this(16, maximumCacheSize); - } - - public CaffeineLRUWeakCache(int initialCapacity, int maximumCacheSize) { - this(initialCapacity, maximumCacheSize, false); - } - - public CaffeineLRUWeakCache(int initialCapacity, int maximumCacheSize, boolean stopOnEviction) { - super(initialCapacity, maximumCacheSize, stopOnEviction, false, true, false); - } - - @Override - public String toString() { - return "CaffeineLRUWeakCache@" + ObjectHelper.getIdentityHashCode(this); - } -} diff --git a/components/camel-caffeine-lrucache/src/test/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUCacheTest.java b/components/camel-caffeine-lrucache/src/test/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUCacheTest.java deleted file mode 100644 index 79ab9d12efb..00000000000 --- a/components/camel-caffeine-lrucache/src/test/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUCacheTest.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * 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.lrucache; - -import org.apache.camel.Service; -import org.apache.camel.support.LRUCache; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertSame; - -public class CaffeineLRUCacheTest { - - private LRUCache<String, Service> cache; - - @BeforeEach - public void setUp() { - // for testing use sync listener - cache = new CaffeineLRUCache<>(10, 10, true, false, false, true); - } - - @Test - public void testLRUCache() { - MyService service1 = new MyService(); - MyService service2 = new MyService(); - - cache.put("A", service1); - cache.put("B", service2); - - assertEquals(2, cache.size()); - - assertSame(service1, cache.get("A")); - assertSame(service2, cache.get("B")); - } - - @Test - public void testLRUCacheEviction() { - MyService service1 = new MyService(); - MyService service2 = new MyService(); - MyService service3 = new MyService(); - MyService service4 = new MyService(); - MyService service5 = new MyService(); - MyService service6 = new MyService(); - MyService service7 = new MyService(); - MyService service8 = new MyService(); - MyService service9 = new MyService(); - MyService service10 = new MyService(); - MyService service11 = new MyService(); - MyService service12 = new MyService(); - - cache.put("A", service1); - assertNull(service1.getStopped()); - cache.put("B", service2); - assertNull(service2.getStopped()); - cache.put("C", service3); - assertNull(service3.getStopped()); - cache.put("D", service4); - assertNull(service4.getStopped()); - cache.put("E", service5); - assertNull(service5.getStopped()); - cache.put("F", service6); - assertNull(service6.getStopped()); - cache.put("G", service7); - assertNull(service7.getStopped()); - cache.put("H", service8); - assertNull(service8.getStopped()); - cache.put("I", service9); - assertNull(service9.getStopped()); - cache.put("J", service10); - assertNull(service10.getStopped()); - - // we are now full - assertEquals(10, cache.size()); - - cache.put("K", service11); - assertNull(service11.getStopped()); - - // the eviction is async so force cleanup - cache.cleanUp(); - - cache.put("L", service12); - - // the eviction is async so force cleanup - cache.cleanUp(); - - assertEquals(10, cache.size()); - } - - @Test - public void testLRUCacheHitsAndMisses() { - MyService service1 = new MyService(); - MyService service2 = new MyService(); - - cache.put("A", service1); - cache.put("B", service2); - - assertEquals(0, cache.getHits()); - assertEquals(0, cache.getMisses()); - - cache.get("A"); - assertEquals(1, cache.getHits()); - assertEquals(0, cache.getMisses()); - - cache.get("A"); - assertEquals(2, cache.getHits()); - assertEquals(0, cache.getMisses()); - - cache.get("B"); - assertEquals(3, cache.getHits()); - assertEquals(0, cache.getMisses()); - - cache.get("C"); - assertEquals(3, cache.getHits()); - assertEquals(1, cache.getMisses()); - - cache.get("D"); - assertEquals(3, cache.getHits()); - assertEquals(2, cache.getMisses()); - - cache.resetStatistics(); - assertEquals(0, cache.getHits()); - assertEquals(0, cache.getMisses()); - - cache.get("B"); - assertEquals(1, cache.getHits()); - assertEquals(0, cache.getMisses()); - - cache.clear(); - assertEquals(0, cache.getHits()); - assertEquals(0, cache.getMisses()); - - cache.get("B"); - assertEquals(0, cache.getHits()); - assertEquals(1, cache.getMisses()); - } - - private static final class MyService implements Service { - - private Boolean stopped; - - @Override - public void start() { - } - - @Override - public void stop() { - stopped = true; - } - - public Boolean getStopped() { - return stopped; - } - } -} diff --git a/components/camel-caffeine-lrucache/src/test/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUSoftCacheTest.java b/components/camel-caffeine-lrucache/src/test/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUSoftCacheTest.java deleted file mode 100644 index 2f2fa683003..00000000000 --- a/components/camel-caffeine-lrucache/src/test/java/org/apache/camel/component/caffeine/lrucache/CaffeineLRUSoftCacheTest.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * 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.lrucache; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertTrue; - -/** - * - */ -public class CaffeineLRUSoftCacheTest { - - @Test - public void testLRUSoftCacheGetAndPut() { - CaffeineLRUSoftCache<Integer, Object> cache = new CaffeineLRUSoftCache<>(1000); - - cache.put(1, "foo"); - cache.put(2, "bar"); - - assertEquals("foo", cache.get(1)); - assertEquals("bar", cache.get(2)); - assertEquals(null, cache.get(3)); - assertEquals(2, cache.size()); - } - - @Test - public void testLRUSoftCacheHitsAndMisses() { - CaffeineLRUSoftCache<Integer, Object> cache = new CaffeineLRUSoftCache<>(1000); - - cache.put(1, "foo"); - cache.put(2, "bar"); - - assertEquals(0, cache.getHits()); - assertEquals(0, cache.getMisses()); - - cache.get(1); - assertEquals(1, cache.getHits()); - assertEquals(0, cache.getMisses()); - - cache.get(3); - assertEquals(1, cache.getHits()); - assertEquals(1, cache.getMisses()); - - cache.get(2); - assertEquals(2, cache.getHits()); - assertEquals(1, cache.getMisses()); - } - - @Test - public void testLRUSoftCachePutOverride() { - CaffeineLRUSoftCache<Integer, Object> cache = new CaffeineLRUSoftCache<>(1000); - - Object old = cache.put(1, "foo"); - assertNull(old); - old = cache.put(2, "bar"); - assertNull(old); - - assertEquals("foo", cache.get(1)); - assertEquals("bar", cache.get(2)); - - old = cache.put(1, "changed"); - assertEquals("foo", old); - assertEquals("changed", cache.get(1)); - assertEquals(2, cache.size()); - } - - @Test - public void testLRUSoftCachePutAll() { - CaffeineLRUSoftCache<Integer, Object> cache = new CaffeineLRUSoftCache<>(1000); - - Map<Integer, Object> map = new HashMap<>(); - map.put(1, "foo"); - map.put(2, "bar"); - - cache.putAll(map); - - assertEquals("foo", cache.get(1)); - assertEquals("bar", cache.get(2)); - assertEquals(null, cache.get(3)); - assertEquals(2, cache.size()); - } - - @Test - public void testLRUSoftCachePutAllAnotherLRUSoftCache() { - CaffeineLRUSoftCache<Integer, Object> cache = new CaffeineLRUSoftCache<>(1000); - - CaffeineLRUSoftCache<Integer, Object> cache2 = new CaffeineLRUSoftCache<>(1000); - cache2.put(1, "foo"); - cache2.put(2, "bar"); - - cache.putAll(cache2); - - assertEquals("foo", cache.get(1)); - assertEquals("bar", cache.get(2)); - assertEquals(null, cache.get(3)); - assertEquals(2, cache.size()); - } - - @Test - public void testLRUSoftCacheRemove() { - CaffeineLRUSoftCache<Integer, Object> cache = new CaffeineLRUSoftCache<>(1000); - - cache.put(1, "foo"); - cache.put(2, "bar"); - - assertEquals("bar", cache.get(2)); - cache.remove(2); - assertEquals(null, cache.get(2)); - } - - @Test - public void testLRUSoftCacheValues() { - CaffeineLRUSoftCache<Integer, Object> cache = new CaffeineLRUSoftCache<>(1000); - - cache.put(1, "foo"); - cache.put(2, "bar"); - - Collection<Object> col = cache.values(); - assertEquals(2, col.size()); - - Iterator<Object> it = col.iterator(); - assertEquals("foo", it.next()); - assertEquals("bar", it.next()); - } - - @Test - public void testLRUSoftCacheEmpty() { - CaffeineLRUSoftCache<Integer, Object> cache = new CaffeineLRUSoftCache<>(1000); - - assertTrue(cache.isEmpty()); - - cache.put(1, "foo"); - assertFalse(cache.isEmpty()); - - cache.put(2, "bar"); - assertFalse(cache.isEmpty()); - - cache.remove(2); - assertFalse(cache.isEmpty()); - - cache.clear(); - assertTrue(cache.isEmpty()); - } - - @Test - public void testLRUSoftCacheContainsKey() { - CaffeineLRUSoftCache<Integer, Object> cache = new CaffeineLRUSoftCache<>(1000); - - assertFalse(cache.containsKey(1)); - cache.put(1, "foo"); - assertTrue(cache.containsKey(1)); - - assertFalse(cache.containsKey(2)); - cache.put(2, "foo"); - assertTrue(cache.containsKey(2)); - - cache.clear(); - assertFalse(cache.containsKey(1)); - assertFalse(cache.containsKey(2)); - } - - @Test - public void testLRUSoftCacheKeySet() { - CaffeineLRUSoftCache<Integer, Object> cache = new CaffeineLRUSoftCache<>(1000); - - cache.put(1, "foo"); - cache.put(2, "foo"); - - Set<Integer> keys = cache.keySet(); - assertEquals(2, keys.size()); - - Iterator<Integer> it = keys.iterator(); - assertEquals(1, it.next().intValue()); - assertEquals(2, it.next().intValue()); - } -} diff --git a/components/camel-caffeine-lrucache/src/test/resources/log4j2.properties b/components/camel-caffeine-lrucache/src/test/resources/log4j2.properties deleted file mode 100644 index 4f7d2f0dbbd..00000000000 --- a/components/camel-caffeine-lrucache/src/test/resources/log4j2.properties +++ /dev/null @@ -1,31 +0,0 @@ -## --------------------------------------------------------------------------- -## 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. -## --------------------------------------------------------------------------- - -appender.out.type = File -appender.out.name = out -appender.out.fileName = target/camel-headersmap-test.log -appender.out.layout.type = PatternLayout -appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n -appender.stdout.type = Console -appender.stdout.name = stdout -appender.stdout.layout.type = PatternLayout -appender.stdout.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n - -rootLogger.level = INFO - -rootLogger.appenderRef.out.ref = out -#rootLogger.appenderRef.out.ref = stdout diff --git a/components/pom.xml b/components/pom.xml index 21778e7e10e..de0e4d5a6aa 100644 --- a/components/pom.xml +++ b/components/pom.xml @@ -100,7 +100,6 @@ <module>camel-box</module> <module>camel-braintree</module> <module>camel-caffeine</module> - <module>camel-caffeine-lrucache</module> <module>camel-cassandraql</module> <module>camel-cbor</module> <module>camel-chatscript</module> diff --git a/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc b/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc index 0d78ac63915..b2ce635dbe8 100644 --- a/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-4-migration-guide.adoc @@ -10,23 +10,17 @@ xref:camel-4x-upgrade-guide.adoc[Camel 4.x Upgrade Guide]. Camel 4 supports Java 17. Support for Java 11 is dropped. -== camel-cdi +== Removed Components -The `camel-cdi` component has been removed, and is no longer supported. +The following components has been removed: -== camel-zipkin - -The `camel-zipkin` component has been removed, and is no longer supported. - -== camel-swagger-java - -The `camel-swagger-java` component has been removed (use `camel-openapi-java` instead). -Removed `camel-restdsl-swagger-plugin` (use `camel-restdsl-openapi-plugin instead). +- camel-caffeine-lrucache +- camel-cdi +- camel-restdsl-swagger-plugin +- camel-swagger-java +- camel-xstream +- camel-zikin == camel-caffeine The `keyType` parameter has been removed. The Key for the cache will now be only `String` type. More information in CAMEL-18877. - -== camel-xstream - -The `camel-xstream` component has been removed, and is no longer supported. diff --git a/parent/pom.xml b/parent/pom.xml index 1f3fa27f360..72494cb8767 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -976,11 +976,6 @@ <artifactId>camel-caffeine</artifactId> <version>${project.version}</version> </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-caffeine-lrucache</artifactId> - <version>${project.version}</version> - </dependency> <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-cassandraql</artifactId>
