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

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

public class FetchingSession<T extends FetchingElement>
extends Object
implements Closeable

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

Field Summary
protected  AggregatorIterator<T> aggregatorIterator
           
protected  FetchingBuffer<T> buffer
           
protected  Fetcher<T> fetcher
           
protected  Thread fetcherThread
           
protected  org.apache.log4j.Logger logger
           
protected  CloseableIterator<T> source
           
 
Constructor Summary
FetchingSession(CloseableIterator<T> source, FetchingBuffer<T> buffer)
           
 
Method Summary
 void addAggregator(Aggregator<T,?> aggregator)
           
 void close()
           
 Aggregator<T,?> getAggregator(String name)
           
 FetchingBuffer<T> getBuffer()
           
 int getBufferSize()
           
 boolean isComplete()
           
protected  void setupAggregatorIterator()
           
 void startFetching()
           
 
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

fetcher

protected Fetcher<T extends FetchingElement> fetcher

fetcherThread

protected Thread fetcherThread

source

protected CloseableIterator<T extends FetchingElement> source

aggregatorIterator

protected AggregatorIterator<T extends FetchingElement> aggregatorIterator
Constructor Detail

FetchingSession

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

addAggregator

public void addAggregator(Aggregator<T,?> aggregator)

setupAggregatorIterator

protected void setupAggregatorIterator()

getAggregator

public Aggregator<T,?> getAggregator(String name)

startFetching

public void startFetching()

close

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

isComplete

public boolean isComplete()

getBuffer

public FetchingBuffer<T> getBuffer()
                                                    throws Exception
Throws:
Exception

getBufferSize

public int getBufferSize()
                  throws Exception
Throws:
Exception


Copyright © 2013. All Rights Reserved.