com.googlecode.fascinator.indexer
Class SolrWrapperQueueConsumer

java.lang.Object
  extended by com.googlecode.fascinator.indexer.SolrWrapperQueueConsumer
All Implemented Interfaces:
GenericListener, Runnable, javax.jms.MessageListener

public class SolrWrapperQueueConsumer
extends Object
implements GenericListener

Consumer for documents to index in Solr. Aggregating the final write in this location allows for a common buffer to prevent timing issues from threaded buffers, as well as allowing us to run thread safe embedded solr.

Author:
Greg Pendlebury

Field Summary
static String QUEUE_ID
          Queue name
 
Constructor Summary
SolrWrapperQueueConsumer()
          Constructor required by ServiceLoader.
 
Method Summary
 String getId()
          Return the ID string for this listener
 void init(JsonSimpleConfig config)
          Initialization method
 void onMessage(javax.jms.Message message)
          Callback function for incoming messages.
 void run()
          Start thread running
 void setPriority(int newPriority)
          Sets the priority level for the thread.
 void start()
          Start the queue based on the name identifier
 void stop()
          Stop the Render Queue Consumer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUEUE_ID

public static final String QUEUE_ID
Queue name

See Also:
Constant Field Values
Constructor Detail

SolrWrapperQueueConsumer

public SolrWrapperQueueConsumer()
Constructor required by ServiceLoader. Be sure to use init()

Method Detail

run

public void run()
Start thread running

Specified by:
run in interface Runnable

init

public void init(JsonSimpleConfig config)
          throws Exception
Initialization method

Specified by:
init in interface GenericListener
Parameters:
config - Configuration to use
Throws:
Exception - if any errors occur

getId

public String getId()
Return the ID string for this listener

Specified by:
getId in interface GenericListener

start

public void start()
           throws Exception
Start the queue based on the name identifier

Specified by:
start in interface GenericListener
Throws:
javax.jms.JMSException - if an error occurred starting the JMS connections
Exception

stop

public void stop()
          throws Exception
Stop the Render Queue Consumer. Including stopping the storage and indexer

Specified by:
stop in interface GenericListener
Throws:
Exception

onMessage

public void onMessage(javax.jms.Message message)
Callback function for incoming messages.

Specified by:
onMessage in interface javax.jms.MessageListener
Parameters:
message - The incoming message

setPriority

public void setPriority(int newPriority)
Sets the priority level for the thread. Used by the OS.

Specified by:
setPriority in interface GenericListener
Parameters:
newPriority - The priority level to set the thread at


Copyright © 2009-2012. All Rights Reserved.