org.gcube.data.harmonization.occurrence.queue
Class QueueReceiver

java.lang.Object
  extended by java.lang.Thread
      extended by org.gcube.data.harmonization.occurrence.queue.QueueReceiver
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
ImportHandler, MergeHandler

public abstract class QueueReceiver
extends Thread


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
protected  AtomicBoolean continueListening
           
protected  String currentMessage
           
protected  AtomicInteger errorCount
           
protected  AtomicInteger readCount
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
QueueReceiver()
           
 
Method Summary
 void bind(com.rabbitmq.client.Channel channel, String routingKey)
           
abstract  void cleanup()
           
 int getComputedCount()
           
 String getExchangeName()
           
abstract  void handleMessage()
           
abstract  void rollback()
           
 void run()
           
 void stopListening()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

continueListening

protected AtomicBoolean continueListening

readCount

protected AtomicInteger readCount

errorCount

protected AtomicInteger errorCount

currentMessage

protected String currentMessage
Constructor Detail

QueueReceiver

public QueueReceiver()
Method Detail

bind

public void bind(com.rabbitmq.client.Channel channel,
                 String routingKey)
          throws IOException
Throws:
IOException

getExchangeName

public String getExchangeName()

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread

stopListening

public void stopListening()

getComputedCount

public int getComputedCount()

handleMessage

public abstract void handleMessage()
                            throws Exception
Throws:
Exception

rollback

public abstract void rollback()
                       throws Exception
Throws:
Exception

cleanup

public abstract void cleanup()


Copyright © 2012. All Rights Reserved.