com.webmethods.caf.wsclient.cache
Interface IWSCacheManager

All Known Implementing Classes:
WSCacheManager

public interface IWSCacheManager

Interface for implementing a manager for wsclient library caching Items are split into the caches based upon:


Method Summary
 void enableCache(boolean enabled)
          Either enable or disable cache
 void flushAllCaches()
          Flush all caches for all interfaces
 void flushCache(IWSProxyFactory factory)
          Flush the cache associated with the specified factory
 WSLruCache getCache(IWSProxyFactory factory)
          Obtain a Cache for a specific proxy factory This is mostly for testing purposes and you should not need to talk to directly to the WSLruCache
 IWSCacheKey getCacheKey(IWSClientSession session, Method method, Object[] args)
          Generate a cache key based on the input information
 Object getCacheValue(IWSCacheKey cacheKey, IWSProxyFactory factory)
          Get the value stored in the cache for a given key
 boolean isEnabled()
          Determine that the cache is enabled or disabled
 void putCacheValue(IWSCacheKey cacheKey, Object value, IWSProxyFactory factory)
          Put the data into the cache
 

Method Detail

getCacheKey

IWSCacheKey getCacheKey(IWSClientSession session,
                        Method method,
                        Object[] args)
Generate a cache key based on the input information

Parameters:
session - the current session
method - the target method
args - the params for that method invocation

getCacheValue

Object getCacheValue(IWSCacheKey cacheKey,
                     IWSProxyFactory factory)
Get the value stored in the cache for a given key

Parameters:
cacheKey - see IWSCacheManager.getCacheKey(com.webmethods.caf.wsclient.session.IWSClientSession, java.lang.reflect.Method, Object[])
Returns:
the cached object if found, null otherwise

putCacheValue

void putCacheValue(IWSCacheKey cacheKey,
                   Object value,
                   IWSProxyFactory factory)
Put the data into the cache

Parameters:
cacheKey - the key generated by calls to IWSCacheManager.getCacheKey(com.webmethods.caf.wsclient.session.IWSClientSession, java.lang.reflect.Method, java.lang.Object[])
value - the web service invoke results
factory - the factory that created the proxy that invoked the webservice
See Also:
IWSCacheManager.getCacheKey(com.webmethods.caf.wsclient.session.IWSClientSession, java.lang.reflect.Method, Object[])

getCache

WSLruCache getCache(IWSProxyFactory factory)
Obtain a Cache for a specific proxy factory This is mostly for testing purposes and you should not need to talk to directly to the WSLruCache

Parameters:
factory -

enableCache

void enableCache(boolean enabled)
Either enable or disable cache

Parameters:
enabled -

isEnabled

boolean isEnabled()
Determine that the cache is enabled or disabled

Returns:
true if enabled, false otherwise

flushCache

void flushCache(IWSProxyFactory factory)
Flush the cache associated with the specified factory


flushAllCaches

void flushAllCaches()
Flush all caches for all interfaces