1. Have you got JBoss Aop to work under 3.2.6?
2. What version of JBossCache you are using?
yes, AOP works fine for other stuff under 3.2.6
but in my case I'm not defining anything in jboss-aop.xml for the caching stuff because I'm adding Map directly to the cache (see previous post)
OK, by using the proxy, we are not updating the original reference now. So my question is: can you just simply replace localSessionMap with proxySessionMap?
Otherwise, we will need to open a Jira issue that needs to be fixed in the next release.
I actually do use proxy for most of the operation, except in some cases I have to iterate over the map values and the proxy version is not clonable. of course I could copy values from proxy to local, clone, iterate and then synch again, but it seems a litte counter intuative because as I understand if you put an instance of a class that references a map into cache then I can directly manipulate the map itself and both local and proxy copy would be synched, correct?
No, because we can't instrument the local version so anything you do on the local version is not intercepted. However, the other way can be true though provided we keep the original reference. But keeping the original reference may not be strightforward. That is, in this case, we will have a local Map, a proxy map, and also indexed value from cache.
It can be done but I have to think about it. Here is the Jira:
ok, I see.
so in the example from TreeCacheAOP guide
Person joe = new Person();
joe.setName("Joe Black"); // This is base class attributes
ArrayList lang = new ArrayList();
// This will map the languages List automatically and swap it out
with the proxy reference.
ArrayList lang = joe.getLanguages(); // Note that lang is a
lang.add("French"); // This will be intercepted by the cache
local to joe "lang" would not be in synch with the proxy
(local would have values: English, Mandaring and
proxy would have values: English, Mandaring, French)? (which might be a little wacky)
but what about if "setLanguages" method was defined as "prepare"
for interception, so if I called something like
would it intercept and update the proxy copy as well and not the local?
Yes, it would update the proxy copy because TreeCacheAop has swapped out the local copy with the proxy one.