org.vertexium.util.LimitedLinkedBlockingQueue Maven / Gradle / Ivy
package org.vertexium.util;
import java.util.Collection;
import java.util.concurrent.LinkedBlockingQueue;
public class LimitedLinkedBlockingQueue extends LinkedBlockingQueue {
public LimitedLinkedBlockingQueue() {
}
public LimitedLinkedBlockingQueue(Collection extends T> c) {
super(c);
}
public LimitedLinkedBlockingQueue(int capacity) {
super(capacity);
}
@Override
public boolean offer(T t) {
try {
put(t);
return true;
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
}
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy