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() |
static double |
computeUsedHeapPercentage() |
boolean |
equals(java.lang.Object o) |
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() |
static com.informix.jdbc.PreparedStatementCache.PreparedStatementCleanupThread |
getPreparedStatementCleanupThread() |
int |
hashCode() |
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) |
static void |
startCache() |
static void |
stopCache() |
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, valuesprotected 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 com.informix.jdbc.PreparedStatementCache.PreparedStatementCleanupThread getPreparedStatementCleanupThread()
public static void startCache()
public static void stopCache()
public 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)
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 void clear()
clear in interface java.util.Map<java.lang.String,IfxPreparedStatement>clear in class java.util.LinkedHashMap<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>