Class WSCacheManager
java.lang.Object
com.webmethods.caf.wsclient.cache.impl.WSCacheManager
- All Implemented Interfaces:
IWSCacheManager
Default implementation of the
IWSCacheManager
interface-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWSCacheManager
(WSClientConfig clientConfig) Create a new WsCacheManager instance given the specified clientConfig object -
Method Summary
Modifier and TypeMethodDescriptionvoid
enableCache
(boolean enabled) Either enable or disable cachevoid
Flush all caches for all interfacesvoid
flushCache
(IWSProxyFactory factory) Flush the cache associated with the specified factorygetCache
(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 WSLruCachegetCacheKey
(IWSClientSession session, Method method, Object[] args) Generate a cache key based on the input informationgetCacheValue
(IWSCacheKey cacheKey, IWSProxyFactory factory) Get the value stored in the cache for a given keyboolean
Determine that the cache is enabled or disabledvoid
putCacheValue
(IWSCacheKey cacheKey, Object value, IWSProxyFactory factory) Put the data into the cache
-
Field Details
-
m_clientConfig
-
-
Constructor Details
-
WSCacheManager
Create a new WsCacheManager instance given the specified clientConfig object- Parameters:
clientConfig
- configuration object containing IWSCacheManager configuration options
-
-
Method Details
-
getCacheKey
Description copied from interface:IWSCacheManager
Generate a cache key based on the input information- Specified by:
getCacheKey
in interfaceIWSCacheManager
- Parameters:
session
- the current sessionmethod
- the target methodargs
- the params for that method invocation
-
getCacheValue
Description copied from interface:IWSCacheManager
Get the value stored in the cache for a given key- Specified by:
getCacheValue
in interfaceIWSCacheManager
- Parameters:
cacheKey
- seeIWSCacheManager.getCacheKey(com.webmethods.caf.wsclient.session.IWSClientSession, java.lang.reflect.Method, Object[])
- Returns:
- the cached object if found, null otherwise
-
putCacheValue
Description copied from interface:IWSCacheManager
Put the data into the cache- Specified by:
putCacheValue
in interfaceIWSCacheManager
- Parameters:
cacheKey
- the key generated by calls toIWSCacheManager.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 webservice- See Also:
-
getCache
Description copied from interface:IWSCacheManager
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- Specified by:
getCache
in interfaceIWSCacheManager
-
enableCache
public void enableCache(boolean enabled) Description copied from interface:IWSCacheManager
Either enable or disable cache- Specified by:
enableCache
in interfaceIWSCacheManager
-
isEnabled
public boolean isEnabled()Description copied from interface:IWSCacheManager
Determine that the cache is enabled or disabled- Specified by:
isEnabled
in interfaceIWSCacheManager
- Returns:
- true if enabled, false otherwise
-
flushCache
Description copied from interface:IWSCacheManager
Flush the cache associated with the specified factory- Specified by:
flushCache
in interfaceIWSCacheManager
-
flushAllCaches
public void flushAllCaches()Description copied from interface:IWSCacheManager
Flush all caches for all interfaces- Specified by:
flushAllCaches
in interfaceIWSCacheManager
-