Package org.apache.tika.batch
Class ConsumersManager
- java.lang.Object
- 
- org.apache.tika.batch.ConsumersManager
 
- 
- Direct Known Subclasses:
- DBConsumersManager,- FSConsumersManager
 
 public abstract class ConsumersManager extends Object Simple interface around a collection of consumers that allows for initializing and shutting shared resources (e.g. db connection, index, writer, etc.)
- 
- 
Constructor SummaryConstructors Constructor Description ConsumersManager(List<FileResourceConsumer> consumers)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description List<FileResourceConsumer>getConsumers()Get the consumerslonggetConsumersManagerMaxMillis()BatchProcesswill throw an exception if the ConsumersManager doesn't complete init() or shutdown() within this amount of time.voidinit()This is called by BatchProcess before submitting the threadsvoidsetConsumersManagerMaxMillis(long consumersManagerMaxMillis)voidshutdown()This is called by BatchProcess immediately before closing.
 
- 
- 
- 
Constructor Detail- 
ConsumersManagerpublic ConsumersManager(List<FileResourceConsumer> consumers) 
 
- 
 - 
Method Detail- 
getConsumerspublic List<FileResourceConsumer> getConsumers() Get the consumers- Returns:
- consumers
 
 - 
initpublic void init() This is called by BatchProcess before submitting the threads
 - 
shutdownpublic void shutdown() This is called by BatchProcess immediately before closing. Beware! Some of the consumers may have hung or may not have completed.
 - 
getConsumersManagerMaxMillispublic long getConsumersManagerMaxMillis() BatchProcesswill throw an exception if the ConsumersManager doesn't complete init() or shutdown() within this amount of time.- Returns:
- the maximum time allowed for init() or shutdown()
 
 - 
setConsumersManagerMaxMillispublic void setConsumersManagerMaxMillis(long consumersManagerMaxMillis) - Parameters:
- consumersManagerMaxMillis- maximum number of milliseconds to allow for init() or shutdown()
- See Also:
- getConsumersManagerMaxMillis()
 
 
- 
 
-