You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
898 B
Java

package org.gcube.data.spd.plugin.fwk.readers;
import java.util.concurrent.BlockingQueue;
import org.gcube.data.spd.plugin.fwk.writers.rswrapper.AbstractLocalWrapper;
import org.gcube.data.streams.Stream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public abstract class AbstractLocalReader<T> implements Stream<T>{
protected static final Logger logger = LoggerFactory.getLogger(AbstractLocalReader.class);
protected BlockingQueue<T> queue;
protected T element = null;
protected int timeoutInSeconds= 2;
AbstractLocalWrapper<T> wrapper ;
public AbstractLocalReader(AbstractLocalWrapper<T> wrapper) {
queue = wrapper.getQueue();
this.wrapper = wrapper;
}
public void setTimeoutInSeconds(int timeoutInSeconds) {
this.timeoutInSeconds = timeoutInSeconds;
}
@Override
public T next() {
return element;
}
@Override
public void remove() {}
}