[jboss-user] [JBossCache] - Pojo doesn't get replicated in datastore

dmary do-not-reply at jboss.com
Thu Dec 13 03:05:56 EST 2007


Hi,

I've got a POJO which contains another POJO extends an ArrayList and when I put in cache, it store in datastore only the POJO which extends ArrayList but not its child elements.
If I use directly an ArrayList, it works like a charm.

Here is the code : @PojoCacheable
  | public class SimpleCircularBuffer<T> extends ArrayList<T> {
  | 
  |   private int               capacity;
  | 
  |   public SimpleCircularBuffer() {
  |     super(1);
  |     this.capacity = 1;
  |   }
  | 
  |   /**
  |    * @param capacity
  |    */
  |   public SimpleCircularBuffer(int capacity) {
  |     super(capacity);
  |     this.capacity = capacity;
  |   }
  | 
  |   public boolean add(T o) {
  |     if (this.capacity == this.size())
  |       super.remove(this.size() - 1);
  |     // super.poll();
  |     super.add(o);
  |     return true;
  |   }
  | 
  |   public int getCapacity() {
  |     return this.capacity;
  |   }
  | 
  |   public void setCapacity(int capacity) {
  |     this.capacity = capacity;
  |   }
  | }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4112466#4112466

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4112466



More information about the jboss-user mailing list