This has come up in the past, and I want to revisit this for a potential future
improvement to the API.
Options are hugely useful in being able to provide additional per-invocation context and
overrides.
But the current mechanism is nothing short of kludgey:
| cache.getInvocationContext().getOptionOverrides().setXYZ();
| cache.doSomething(); // your invocation
|
Ugly since it involves thread locals and there is a lot of code to check for leaks, proper
cleanup, context leaking to additional calls, nested calls with notifications, etc etc
etc.
So I'm looking for suggestions for a better approach here.
FYI, the way this was done in JBC 1.4.x (which is still ugly IMO) was to overload all
methods on the cache with versions that took in an Option class.
e.g.,
| cache.get(Fqn f, Object key);
| cache.get(Fqn f, Object key, Option o);
|
Thoughts and suggestions?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4205521#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...