org.gcube.portlets.user.speciesdiscovery.server.session
Class Fetcher<T extends FetchingElement>

java.lang.Object
  extended by org.gcube.portlets.user.speciesdiscovery.server.session.Fetcher<T>
All Implemented Interfaces:
Closeable, Runnable

public class Fetcher<T extends FetchingElement>
extends Object
implements Runnable, Closeable

Author:
"Federico De Faveri defaveri@isti.cnr.it"

Field Summary
protected  FetchingBuffer<T> buffer
           
protected  boolean complete
           
protected  org.apache.log4j.Logger logger
           
protected  CloseableIterator<T> source
           
 
Constructor Summary
Fetcher(CloseableIterator<T> source, FetchingBuffer<T> buffer)
           
 
Method Summary
 void close()
           
 CloseableIterator<T> getSource()
           
 boolean isComplete()
           
 void run()
          
 void setSource(CloseableIterator<T> source)
           
protected  void silentClose()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected org.apache.log4j.Logger logger

buffer

protected FetchingBuffer<T extends FetchingElement> buffer

source

protected CloseableIterator<T extends FetchingElement> source

complete

protected boolean complete
Constructor Detail

Fetcher

public Fetcher(CloseableIterator<T> source,
               FetchingBuffer<T> buffer)
Method Detail

getSource

public CloseableIterator<T> getSource()
Returns:
the source

setSource

public void setSource(CloseableIterator<T> source)
Parameters:
source - the source to set

run

public void run()

Specified by:
run in interface Runnable

silentClose

protected void silentClose()

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Throws:
IOException

isComplete

public boolean isComplete()


Copyright © 2013. All Rights Reserved.