public class PreparedStatementCache extends java.util.LinkedHashMap<java.lang.String,IfxPreparedStatement>
| Modifier and Type | Field and Description |
|---|---|
protected int |
initialMaximumEntries |
protected long |
maximumDelay |
protected long |
minimumDelay |
protected int |
zeroPointPercentage |
| Constructor and Description |
|---|
PreparedStatementCache(IfxSqliConnect connection,
int maximumEntries)
Creates a new LRU map based on a LinkedHashMap that supports an
upper-limit on the number of entries.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
java.lang.Object |
clone() |
static double |
computeUsedHeapPercentage() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
java.util.Set<java.util.Map.Entry<java.lang.String,IfxPreparedStatement>> |
entrySet() |
boolean |
equals(java.lang.Object o) |
IfxPreparedStatement |
get(java.lang.Object key) |
static java.util.List<org.bson.BSONObject> |
getCacheInfo() |
int |
getMaximumEntries()
Returns the maximum number of entries allowed in this LRU map.
|
static DelayedWeakReference<PreparedStatementCache>[] |
getPreparedStatementCaches() |
int |
hashCode() |
boolean |
isEmpty() |
java.util.Set<java.lang.String> |
keySet() |
IfxPreparedStatement |
put(java.lang.String key,
IfxPreparedStatement value) |
void |
putAll(java.util.Map<? extends java.lang.String,? extends IfxPreparedStatement> m) |
IfxPreparedStatement |
remove(java.lang.Object id) |
protected boolean |
removeEldestEntry(java.util.Map.Entry<java.lang.String,IfxPreparedStatement> eldest)
Returns
true if the maximum number of entries has been
exceeded in the map and therefore the eldest entry needs to be removed. |
void |
setMaximumEntries(int maximumEntries) |
int |
size() |
java.util.Collection<IfxPreparedStatement> |
values() |
protected final int initialMaximumEntries
protected final int zeroPointPercentage
protected final long minimumDelay
protected final long maximumDelay
public PreparedStatementCache(IfxSqliConnect connection, int maximumEntries)
maximumKEntries - the maximum number of entries to allow in the LRU mappublic static java.util.List<org.bson.BSONObject> getCacheInfo()
public static DelayedWeakReference<PreparedStatementCache>[] getPreparedStatementCaches()
public static double computeUsedHeapPercentage()
public int getMaximumEntries()
public void setMaximumEntries(int maximumEntries)
public IfxPreparedStatement get(java.lang.Object key)
get in interface java.util.Map<java.lang.String,IfxPreparedStatement>get in class java.util.LinkedHashMap<java.lang.String,IfxPreparedStatement>protected boolean removeEldestEntry(java.util.Map.Entry<java.lang.String,IfxPreparedStatement> eldest)
true if the maximum number of entries has been
exceeded in the map and therefore the eldest entry needs to be removed.removeEldestEntry in class java.util.LinkedHashMap<java.lang.String,IfxPreparedStatement>public IfxPreparedStatement remove(java.lang.Object id)
remove in interface java.util.Map<java.lang.String,IfxPreparedStatement>remove in class java.util.HashMap<java.lang.String,IfxPreparedStatement>public void clear()
clear in interface java.util.Map<java.lang.String,IfxPreparedStatement>clear in class java.util.LinkedHashMap<java.lang.String,IfxPreparedStatement>public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Map<java.lang.String,IfxPreparedStatement>containsValue in class java.util.LinkedHashMap<java.lang.String,IfxPreparedStatement>public int size()
size in interface java.util.Map<java.lang.String,IfxPreparedStatement>size in class java.util.HashMap<java.lang.String,IfxPreparedStatement>public boolean isEmpty()
isEmpty in interface java.util.Map<java.lang.String,IfxPreparedStatement>isEmpty in class java.util.HashMap<java.lang.String,IfxPreparedStatement>public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Map<java.lang.String,IfxPreparedStatement>containsKey in class java.util.HashMap<java.lang.String,IfxPreparedStatement>public IfxPreparedStatement put(java.lang.String key, IfxPreparedStatement value)
put in interface java.util.Map<java.lang.String,IfxPreparedStatement>put in class java.util.HashMap<java.lang.String,IfxPreparedStatement>public void putAll(java.util.Map<? extends java.lang.String,? extends IfxPreparedStatement> m)
putAll in interface java.util.Map<java.lang.String,IfxPreparedStatement>putAll in class java.util.HashMap<java.lang.String,IfxPreparedStatement>public java.lang.Object clone()
clone in class java.util.HashMap<java.lang.String,IfxPreparedStatement>public java.util.Set<java.lang.String> keySet()
keySet in interface java.util.Map<java.lang.String,IfxPreparedStatement>keySet in class java.util.HashMap<java.lang.String,IfxPreparedStatement>public java.util.Collection<IfxPreparedStatement> values()
values in interface java.util.Map<java.lang.String,IfxPreparedStatement>values in class java.util.HashMap<java.lang.String,IfxPreparedStatement>public java.util.Set<java.util.Map.Entry<java.lang.String,IfxPreparedStatement>> entrySet()
entrySet in interface java.util.Map<java.lang.String,IfxPreparedStatement>entrySet in class java.util.HashMap<java.lang.String,IfxPreparedStatement>public boolean equals(java.lang.Object o)
equals in interface java.util.Map<java.lang.String,IfxPreparedStatement>equals in class java.util.AbstractMap<java.lang.String,IfxPreparedStatement>public int hashCode()
hashCode in interface java.util.Map<java.lang.String,IfxPreparedStatement>hashCode in class java.util.AbstractMap<java.lang.String,IfxPreparedStatement>