Package org.jboss.jca.adapters.jdbc
Class PreparedStatementCache
- java.lang.Object
-
- org.jboss.jca.adapters.jdbc.PreparedStatementCache
-
- All Implemented Interfaces:
CacheListener<CachedPreparedStatement>
public class PreparedStatementCache extends Object implements CacheListener<CachedPreparedStatement>
Cache for PreparedStatements. When ps ages out, close it.- Author:
- Jesper Pedersen
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPreparedStatementCache.KeyKey class
-
Constructor Summary
Constructors Constructor Description PreparedStatementCache(int max, JdbcStatisticsPlugin stats)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CachedPreparedStatementget(PreparedStatementCache.Key key)GetvoidonEviction(CachedPreparedStatement evicted)On evictionvoidput(PreparedStatementCache.Key key, CachedPreparedStatement value)Putintsize()SizeStringtoString()
-
-
-
Constructor Detail
-
PreparedStatementCache
public PreparedStatementCache(int max, JdbcStatisticsPlugin stats)Constructor- Parameters:
max- The max valuestats- The statistics plugin
-
-
Method Detail
-
get
public CachedPreparedStatement get(PreparedStatementCache.Key key)
Get- Parameters:
key- The key- Returns:
- The value
-
put
public void put(PreparedStatementCache.Key key, CachedPreparedStatement value)
Put- Parameters:
key- The keyvalue- The value
-
size
public int size()
Size- Returns:
- The size
-
onEviction
public void onEviction(CachedPreparedStatement evicted)
On eviction- Specified by:
onEvictionin interfaceCacheListener<CachedPreparedStatement>- Parameters:
evicted- The value being evicted
-
-