1 33 34 package com.icesoft.faces.async.render; 35 36 import edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue; 37 import org.apache.commons.logging.Log; 38 import org.apache.commons.logging.LogFactory; 39 40 63 class SingleEntryQueue extends LinkedBlockingQueue { 64 65 private static Log log = LogFactory.getLog(SingleEntryQueue.class); 66 67 public SingleEntryQueue(int capacity) { 68 super(capacity); 69 } 70 71 public boolean offer(Object objectToOffer) { 72 if (this.contains(objectToOffer)) { 73 if (log.isTraceEnabled()) { 74 log.trace("object is already in work queue: " + objectToOffer); 75 } 76 return true; 82 } 83 return super.offer(objectToOffer); 84 } 85 } 86 | Popular Tags |