org.ow2.jonas.resource.internal.cm.sql.cache
Interface PreparedStatementCache

All Known Implementing Classes:
AbstractPreparedStatementCacheImpl, PreparedStatementListCacheImpl, PreparedStatementMapCacheImpl

public interface PreparedStatementCache

Prepared Statement Cache Interface

Author:
pelletib

Field Summary
static String CACHE_POLICY_LIST
          Policy : list
static String CACHE_POLICY_MAP
          Policy : map
 
Method Summary
 void close()
          Close logically the cache entries
 void destroy()
          Destroy the cache entries
 PreparedStatementWrapper get(PreparedStatementWrapper psw)
          Retrieve an entry in the cache
 int getMaxPstmtCacheSize()
           
 int getPstmtCacheSize()
           
 String getState(String prefix)
           
 void put(PreparedStatementWrapper psw)
          Add an entry in the cache
 void reallyClose()
          Close really the cache entries
 void setMaxPstmtCacheSize(int maxSize)
          Set the max cache size
 

Field Detail

CACHE_POLICY_LIST

static final String CACHE_POLICY_LIST
Policy : list

See Also:
Constant Field Values

CACHE_POLICY_MAP

static final String CACHE_POLICY_MAP
Policy : map

See Also:
Constant Field Values
Method Detail

put

void put(PreparedStatementWrapper psw)
         throws CacheException,
                SQLException
Add an entry in the cache

Parameters:
psw - : wrapped prepared statement to add
Throws:
CacheException - no more space in cache
SQLException

get

PreparedStatementWrapper get(PreparedStatementWrapper psw)
Retrieve an entry in the cache

Parameters:
psw - : parameters of the prepared statement to retrieve
Returns:
wrapped prepared statement or null if not found

getPstmtCacheSize

int getPstmtCacheSize()
Returns:
Get the current cache size.

getMaxPstmtCacheSize

int getMaxPstmtCacheSize()
Returns:
Get the max cache size.

setMaxPstmtCacheSize

void setMaxPstmtCacheSize(int maxSize)
Set the max cache size

Parameters:
maxSize - The max size to set.

getState

String getState(String prefix)
Parameters:
prefix - indentation
Returns:
a string with a cache state (dump)

destroy

void destroy()
Destroy the cache entries


close

void close()
Close logically the cache entries


reallyClose

void reallyClose()
Close really the cache entries



Copyright © 2011 OW2 Consortium. All Rights Reserved.