public class WSCacheManager extends Object implements IWSCacheManager
IWSCacheManager
interfaceModifier and Type | Field and Description |
---|---|
protected WSClientConfig |
m_clientConfig |
Constructor and Description |
---|
WSCacheManager(WSClientConfig clientConfig)
Create a new WsCacheManager instance given the specified clientConfig object
|
Modifier and Type | Method and Description |
---|---|
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
|
protected WSClientConfig m_clientConfig
public WSCacheManager(WSClientConfig clientConfig)
clientConfig
- configuration object containing IWSCacheManager configuration optionspublic IWSCacheKey getCacheKey(IWSClientSession session, Method method, Object[] args)
IWSCacheManager
getCacheKey
in interface IWSCacheManager
session
- the current sessionmethod
- the target methodargs
- the params for that method invocationpublic Object getCacheValue(IWSCacheKey cacheKey, IWSProxyFactory factory)
IWSCacheManager
getCacheValue
in interface IWSCacheManager
cacheKey
- see IWSCacheManager.getCacheKey(com.webmethods.caf.wsclient.session.IWSClientSession, java.lang.reflect.Method, Object[])
public void putCacheValue(IWSCacheKey cacheKey, Object value, IWSProxyFactory factory)
IWSCacheManager
putCacheValue
in interface IWSCacheManager
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 resultsfactory
- the factory that created the proxy that invoked the webserviceIWSCacheManager.getCacheKey(com.webmethods.caf.wsclient.session.IWSClientSession, java.lang.reflect.Method, Object[])
public WSLruCache getCache(IWSProxyFactory factory)
IWSCacheManager
getCache
in interface IWSCacheManager
public void enableCache(boolean enabled)
IWSCacheManager
enableCache
in interface IWSCacheManager
public boolean isEnabled()
IWSCacheManager
isEnabled
in interface IWSCacheManager
public void flushCache(IWSProxyFactory factory)
IWSCacheManager
flushCache
in interface IWSCacheManager
public void flushAllCaches()
IWSCacheManager
flushAllCaches
in interface IWSCacheManager