[jboss-user] [JBossCache] - Re: Pojo doesn't get replicated in datastore
jason.greene@jboss.com
do-not-reply at jboss.com
Thu Dec 13 08:47:22 EST 2007
This is an Interesting use case. It poses a problem because with inheritance, field changes can, and in this case are performed by the code in the super class. This is normally solved by instrumenting the super class as well. However, with JDK collection types, we can not redefine them, since they are on the bootclasspath, and thus would violate the JRE license. So for those types proxies are used. The proxies only follow the collection interfaces, so any additional state can't be stored. Perhaps an extendable type handler system is needed, that would you to customize how a type is stored in the cache. I will look at that as a future enhancement.
For now you should be able to work around this problem, by using delegation instead of inheritance. Try modifying SimpleCircularBuffer to implement List, and then add a field which is an ArrayList, which you delegate all calls too (with the exception of your additional methods)
Let me know your findings. Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112561#4112561
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112561
More information about the jboss-user
mailing list