[jboss-dev-forums] [Design of JBossCache] - static field replication in PojoCache
ben.wang@jboss.com
do-not-reply at jboss.com
Fri Nov 10 03:11:37 EST 2006
I am trying to scope out the requirement for the static field replication. Here are what I have:
1. Create a @Replicatable field annotation so user can annotate the POJO to designate the static field for replication, e.g.,
| @org.jboss.cache.pojo.annotation.PojoCacheable
| public class POJO
| {
| @org.jboss.cache.pojo.annotation.Replicatble
| public static int someStaticVar;
|
| ...
| }
|
such that POJO.someStatic=10 will trigger the replication.
2. Only support the static variable of either Primitive or Serializable. I.e., can't support another "aspectized" POJO.
3. The fqn name for the static field varialbe is global and is known a priori, e.g., in the above case, someStaticVar will be stored under:
/__JBoss_Static_/POJO/someStaticVar
4. The static variable will be stored under the cache during POJO initialization (even when no POJO has not been put into the cache yet!)
5. And finally, there can be only ONE PojoCache instance per VM! This is needed to follow the normal Java semantics. Furthermore, if we have multiple cache instances, which cache instance are we going to store the static variables under?
Of course, the last requirement is more restrictive and more importantly make the unit testing difficult.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3984816#3984816
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3984816
More information about the jboss-dev-forums
mailing list