public class CacheKeyBuilder extends Object
Takes extra care to build the cache keys that don't thrash persistent caches.
| Constructor and Description |
|---|
CacheKeyBuilder() |
| Modifier and Type | Method and Description |
|---|---|
String |
build()
Inserting the keys from the parameter map only if the keys are defined, prevents thrashing
the existing persistent caches at rolling restart of high-traffic servers.
|
CacheKeyBuilder |
setLegacyParam(int index,
Object value)
Sets a legacy cache key parameter.
|
CacheKeyBuilder |
setParam(String name,
Object value)
Sets a cache key parameter.
|
public CacheKeyBuilder setLegacyParam(int index, Object value)
The legacy cache key parameters have a fixed order. Since the cache key is not required to have all of the legacy parameters filled in, the index of the parameter must be given.
index - the index to place this parameter at; valid values are 0 to
- 1value - the object that determines the legacy parameterpublic CacheKeyBuilder setParam(String name, Object value)
Each parameter needs to be inserted in the cache key builder manually, so that the user has an option to select the parameters that need to become part of the key.
name - the parameter name; if null, the param will not be insertedvalue - the object that determines the value of the parameterpublic String build()
Copyright © 2007-2012. All Rights Reserved.