]
Tristan Tarrant closed ISPN-1242.
---------------------------------
Resolution: Won't Fix
Add dynamic grouping capabilities for unmodifiable key classes.
---------------------------------------------------------------
Key: ISPN-1242
URL:
https://issues.jboss.org/browse/ISPN-1242
Project: Infinispan
Issue Type: Feature Request
Components: Core
Affects Versions: 5.0.0.CR7
Reporter: Erik Salter
The grouping API should be enhanced to add grouping capabilities to a a cache's put()
or replace() methods.
This encompasses the following scenario:
Cache A uses a custom key class where the group is dynamically generated. Cache B's
key is an unmodifiable String that needs to be grouped with the dynamic value of a key
from Cache A. (Cache B's key can't be encapsulated in a custom key class since it
needs to be queried from external entities that will not know the group context).
And in pseudo-code:
{code}
Group class InternalResourceKey {
String group;
...
@Group
String getGroup() {
return group;
}
}
InternalResourceKey key = new InternalResourceKey();
{code}
...
{code}
resourceCache.lock( key );
// Get the previous result.
ResourceResult result = resourceCache.get( key );
ResourceResult newResult = doWork( key, result );
resourceCache.put( key, newResult );
// I also want to group an external identifier that an external client knows about with
the result so they will be on the same node
employeeCache.put( "111-111-1111", newResult, key.getGroup() );
{code}