Repository: qpid-jms Updated Branches: refs/heads/master 289ba89fe -> cd01efb83
We only need one LRUCache instance. Project: http://git-wip-us.apache.org/repos/asf/qpid-jms/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms/commit/cd01efb8 Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms/tree/cd01efb8 Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms/diff/cd01efb8 Branch: refs/heads/master Commit: cd01efb83bfd1701cf06d7b5ea144f2e5ebccf3c Parents: 289ba89 Author: Timothy Bish <tabish...@gmail.com> Authored: Tue Mar 3 13:43:44 2015 -0500 Committer: Timothy Bish <tabish...@gmail.com> Committed: Tue Mar 3 13:43:44 2015 -0500 ---------------------------------------------------------------------- .../org/apache/qpid/jms/selector/LRUCache.java | 91 -------------------- .../qpid/jms/selector/SelectorParser.java | 1 + 2 files changed, 1 insertion(+), 91 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/cd01efb8/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/LRUCache.java ---------------------------------------------------------------------- diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/LRUCache.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/LRUCache.java deleted file mode 100755 index 6e9858d..0000000 --- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/LRUCache.java +++ /dev/null @@ -1,91 +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.qpid.jms.selector; - -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * A Simple LRU Cache - * - * @param <K> - * @param <V> - */ - -public class LRUCache<K, V> extends LinkedHashMap<K, V> { - private static final long serialVersionUID = -342098639681884413L; - protected int maxCacheSize = 10000; - - /** - * Default constructor for an LRU Cache The default capacity is 10000 - */ - public LRUCache() { - this(0,10000, 0.75f, true); - } - - /** - * Constructs a LRUCache with a maximum capacity - * - * @param maximumCacheSize - */ - public LRUCache(int maximumCacheSize) { - this(0, maximumCacheSize, 0.75f, true); - } - - /** - * 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 - * @param loadFactor the load factor. - * @param accessOrder the ordering mode - <tt>true</tt> for access-order, - * <tt>false</tt> for insertion-order. - * @throws IllegalArgumentException if the initial capacity is negative or - * the load factor is non-positive. - */ - - public LRUCache(int initialCapacity, int maximumCacheSize, float loadFactor, boolean accessOrder) { - super(initialCapacity, loadFactor, accessOrder); - this.maxCacheSize = maximumCacheSize; - } - - /** - * @return Returns the maxCacheSize. - */ - public int getMaxCacheSize() { - return maxCacheSize; - } - - /** - * @param maxCacheSize The maxCacheSize to set. - */ - public void setMaxCacheSize(int maxCacheSize) { - this.maxCacheSize = maxCacheSize; - } - - protected boolean removeEldestEntry(Map.Entry<K,V> eldest) { - if( size() > maxCacheSize ) { - onCacheEviction(eldest); - return true; - } - return false; - } - - protected void onCacheEviction(Map.Entry<K,V> eldest) { - } -} http://git-wip-us.apache.org/repos/asf/qpid-jms/blob/cd01efb8/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/SelectorParser.java ---------------------------------------------------------------------- diff --git a/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/SelectorParser.java b/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/SelectorParser.java index 87e74b2..ef9b558 100644 --- a/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/SelectorParser.java +++ b/qpid-jms-client/src/main/java/org/apache/qpid/jms/selector/SelectorParser.java @@ -21,6 +21,7 @@ import java.io.StringReader; import org.apache.qpid.jms.selector.filter.BooleanExpression; import org.apache.qpid.jms.selector.filter.FilterException; import org.apache.qpid.jms.selector.parser.SelectorParserImpl; +import org.apache.qpid.jms.util.LRUCache; public class SelectorParser { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org