1 18 package org.apache.activemq.memory; 19 20 public class CacheEntry { 21 22 public final Object key; 23 public final Object value; 24 25 public CacheEntry next; 26 public CacheEntry previous; 27 public CacheEntryList owner; 28 29 public CacheEntry(Object key, Object value) { 30 this.key=key; 31 this.value = value; 32 } 33 34 39 public boolean remove() { 40 41 if( owner==null || this.key==null || this.next==null ) 44 return false; 45 46 synchronized( owner.tail ) { 47 this.next.previous = this.previous; 48 this.previous.next = this.next; 49 this.owner = null; 50 this.next = this.previous = null; 51 } 52 53 return true; 54 } 55 56 } 57 | Popular Tags |